# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/registry/kautoscale.cue
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:
    - deployments.apps
  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
        }

