github.com/oam-dev/kubevela@v1.9.11/vela-templates/registry/auto-gen/kautoscale.yaml (about)

     1  # Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
     2  # Definition source cue file: vela-templates/definitions/registry/kautoscale.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: TraitDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/description: Specify auto scale by annotation
     8    name: kautoscale
     9    namespace: vela-system
    10  spec:
    11    appliesToWorkloads:
    12      - deployments.apps
    13    podDisruptive: true
    14    schematic:
    15      cue:
    16        template: |
    17          import "encoding/json"
    18  
    19          patch: metadata: annotations: "my.autoscale.ann": json.Marshal({
    20          	minReplicas: parameter.min
    21          	maxReplicas: parameter.max
    22          })
    23          parameter: {
    24          	min: *1 | int
    25          	max: *3 | int
    26          }
    27