mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
polish for pr
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: WorkloadDefinition
|
||||
metadata:
|
||||
name: backend
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: "standard.oam.dev/v1alpha1"
|
||||
definition.oam.dev/kind: "PodSpecWorkload"
|
||||
definition.oam.dev/description: "Backend worker without ports exposed"
|
||||
spec:
|
||||
definitionRef:
|
||||
name: backend
|
||||
childResourceKinds:
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
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: [
|
||||
for e in parameter.env {
|
||||
if (e._useSecret==true)
|
||||
{
|
||||
name: e.name
|
||||
valueFrom: {
|
||||
secretKeyRef: {
|
||||
name: e.secretKeyRef.name
|
||||
key: e.secretKeyRef.key
|
||||
}
|
||||
}
|
||||
_useSecret: true
|
||||
}
|
||||
if (e._useSecret==false)
|
||||
{
|
||||
name: e.name
|
||||
value: e.value
|
||||
_useSecret: false
|
||||
}
|
||||
}
|
||||
]
|
||||
ports: [{
|
||||
containerPort: parameter.port
|
||||
protocol: "TCP"
|
||||
name: "default"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
#backend: {
|
||||
name: string
|
||||
image: string
|
||||
port: int
|
||||
|
||||
env: [...{
|
||||
name: string
|
||||
value: string | *""
|
||||
_useSecret: *false | bool
|
||||
secretKeyRef: {
|
||||
name: string | *""
|
||||
key: string | *""
|
||||
}
|
||||
...
|
||||
}]
|
||||
}
|
||||
parameter: #backend
|
||||
@@ -1,54 +0,0 @@
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: WorkloadDefinition
|
||||
metadata:
|
||||
name: webservice
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: "standard.oam.dev/v1alpha1"
|
||||
definition.oam.dev/kind: "PodSpecWorkload"
|
||||
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
|
||||
Reference in New Issue
Block a user