mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
add webservice template
This commit is contained in:
@@ -59,9 +59,11 @@ Also the examples are based on Alibaba Cloud settings
|
||||
|
||||
### Import the database workload definition
|
||||
|
||||
First, register the db workload definition:
|
||||
`kubectl apply -f script/def_db.yaml`
|
||||
|
||||
|
||||
The webservice workload is customized a little.
|
||||
`kubectl apply -f script/webservice.yaml`
|
||||
Don't forget to update vela:
|
||||
`vela system update`
|
||||
|
||||
### Apply the appfile
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
apiVersion: core.oam.dev/v1alpha2
|
||||
kind: WorkloadDefinition
|
||||
metadata:
|
||||
name: rds
|
||||
annotations:
|
||||
definition.oam.dev/apiVersion: "database.example.org/v1alpha1"
|
||||
definition.oam.dev/kind: "PostgreSQLInstance"
|
||||
definition.oam.dev/description: "rds on Alibaba Cloud"
|
||||
spec:
|
||||
definitionRef:
|
||||
name: rds.apps
|
||||
extension:
|
||||
template: |
|
||||
output: {
|
||||
apiVersion: "database.example.org/v1alpha1"
|
||||
kind: "PostgreSQLInstance"
|
||||
metadata:
|
||||
name: context.name
|
||||
spec: {
|
||||
selector: matchLabels: {
|
||||
"app.oam.dev/component": context.name
|
||||
}
|
||||
|
||||
template: {
|
||||
metadata: labels: {
|
||||
"app.oam.dev/component": context.name
|
||||
}
|
||||
|
||||
spec: {
|
||||
parameters:
|
||||
storageGB: 20
|
||||
compositionSelector: {
|
||||
matchLabels:
|
||||
provider: parameter.provider
|
||||
}
|
||||
writeConnectionSecretToRef:
|
||||
name: parameter.secretname
|
||||
}
|
||||
}
|
||||
|
||||
selector:
|
||||
matchLabels:
|
||||
"app.oam.dev/component": context.name
|
||||
}
|
||||
}
|
||||
|
||||
parameter: {
|
||||
secretname: *"db-conn" | string
|
||||
provider: *"alibaba" | string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user