mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-16 06:16:52 +00:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
apiVersion: core.oam.dev/v1alpha2
|
|
kind: WorkloadDefinition
|
|
metadata:
|
|
name: webservice
|
|
annotations:
|
|
definition.oam.dev/description: "Flight tracker web ui"
|
|
spec:
|
|
definitionRef:
|
|
name: podspecworkloads.standard.oam.dev
|
|
childResourceKinds:
|
|
- apiVersion: apps/v1
|
|
kind: Deployment
|
|
- apiVersion: v1
|
|
kind: Service
|
|
extension:
|
|
template: |
|
|
output: {
|
|
apiVersion: "standard.oam.dev/v1alpha1"
|
|
kind: "PodSpecWorkload"
|
|
metadata: name: parameter.name
|
|
spec: {
|
|
replicas: 1
|
|
podSpec: {
|
|
containers: [{
|
|
image: parameter.image
|
|
name: parameter.name
|
|
env: parameter.env
|
|
ports: [{
|
|
containerPort: parameter.port
|
|
protocol: "TCP"
|
|
}]
|
|
}]
|
|
}
|
|
}
|
|
}
|
|
#webservice: {
|
|
name: string
|
|
image: string
|
|
port: int
|
|
|
|
env: [...{
|
|
name: string
|
|
value?: string
|
|
valueFrom?: {
|
|
secretKeyRef: {
|
|
name: string
|
|
key: string
|
|
}
|
|
}
|
|
}]
|
|
}
|
|
parameter: #webservice |