github.com/oam-dev/kubevela@v1.9.11/vela-templates/definitions/registry/kautoscale.cue (about) 1 import "encoding/json" 2 3 kautoscale: { 4 type: "trait" 5 annotations: {} 6 labels: {} 7 description: "Specify auto scale by annotation" 8 attributes: { 9 podDisruptive: true 10 appliesToWorkloads: ["deployments.apps"] 11 } 12 } 13 template: { 14 patch: metadata: annotations: "my.autoscale.ann": json.Marshal({ 15 minReplicas: parameter.min 16 maxReplicas: parameter.max 17 }) 18 parameter: { 19 min: *1 | int 20 max: *3 | int 21 } 22 }