mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-16 14:27:00 +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>
63 lines
2.0 KiB
YAML
63 lines
2.0 KiB
YAML
apiVersion: core.oam.dev/v1beta1
|
|
kind: TraitDefinition
|
|
metadata:
|
|
name: rollout
|
|
namespace: vela-system
|
|
annotations:
|
|
definition.oam.dev/description: "Configures Canary deployment strategy for your application."
|
|
spec:
|
|
appliesToWorkloads:
|
|
- webservice
|
|
definitionRef:
|
|
name: canaries.flagger.app
|
|
workloadRefPath: spec.targetRef
|
|
revisionEnabled: true
|
|
podDisruptive: true
|
|
extension:
|
|
install:
|
|
helm:
|
|
repo: oam-flagger
|
|
name: flagger
|
|
namespace: vela-system
|
|
url: https://oam.dev/flagger/archives/
|
|
version: 1.1.0
|
|
schematic:
|
|
cue:
|
|
template: |-
|
|
outputs: rollout: {{
|
|
apiVersion: "flagger.app/v1beta1"
|
|
kind: "Canary"
|
|
spec: {
|
|
provider: "smi"
|
|
progressDeadlineSeconds: 60
|
|
service: {
|
|
// Currently Traffic route is not supported, but this is required field for flagger CRD
|
|
port: 80
|
|
// Currently Traffic route is not supported, but this is required field for flagger CRD
|
|
targetPort: 8080
|
|
}
|
|
analysis: {
|
|
interval: parameter.interval
|
|
// max number of failed metric checks before rollback
|
|
threshold: 10
|
|
// max traffic percentage routed to canary
|
|
// percentage (0-100)
|
|
maxWeight: 50
|
|
// canary increment step
|
|
// percentage (0-100)
|
|
stepWeight: parameter.stepWeight
|
|
// max replicas scale up to canary
|
|
maxReplicas: parameter.replicas
|
|
}
|
|
}
|
|
}}
|
|
parameter: {
|
|
// +usage=Total replicas of the workload
|
|
replicas: *2 | int
|
|
// +alias=step-weight
|
|
// +usage=Weight percent of every step in rolling update
|
|
stepWeight: *50 | int
|
|
// +usage=Schedule interval time
|
|
interval: *"30s" | string
|
|
}
|
|
|