mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-22 01:03:27 +00:00
28 lines
675 B
YAML
28 lines
675 B
YAML
apiVersion: core.oam.dev/v1beta1
|
|
kind: TraitDefinition
|
|
metadata:
|
|
annotations:
|
|
definition.oam.dev/description: "Configures replicas for your service."
|
|
name: myscaler
|
|
spec:
|
|
appliesToWorkloads:
|
|
- deployments.apps
|
|
definitionRef:
|
|
name: manualscalertraits.core.oam.dev
|
|
workloadRefPath: spec.workloadRef
|
|
schematic:
|
|
cue:
|
|
template: |
|
|
outputs: scaler: {
|
|
apiVersion: "core.oam.dev/v1alpha2"
|
|
kind: "ManualScalerTrait"
|
|
spec: {
|
|
replicaCount: parameter.replicas
|
|
}
|
|
}
|
|
parameter: {
|
|
//+short=r
|
|
//+usage=Replicas of the workload
|
|
replicas: *1 | int
|
|
}
|