mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-16 06:16:52 +00:00
* add podDisruptive to traitdefinition * fix docs & example * fix diff and add docs * use bool type for podDisruptive Co-authored-by: 天元 <jianbo.sjb@alibaba-inc.com>
27 lines
690 B
YAML
27 lines
690 B
YAML
apiVersion: core.oam.dev/v1beta1
|
|
kind: TraitDefinition
|
|
metadata:
|
|
annotations:
|
|
definition.oam.dev/description: "Specify auto scale by annotation"
|
|
name: kautoscale
|
|
namespace: vela-system
|
|
spec:
|
|
appliesToWorkloads:
|
|
- webservice # this should be some knative like workload
|
|
podDisruptive: true
|
|
schematic:
|
|
cue:
|
|
template: |-
|
|
import "encoding/json"
|
|
patch: {
|
|
metadata: annotations: {
|
|
"my.autoscale.ann": json.Marshal({
|
|
"minReplicas": parameter.min
|
|
"maxReplicas": parameter.max
|
|
})
|
|
}
|
|
}
|
|
parameter: {
|
|
min: *1 | int
|
|
max: *3 | int
|
|
} |