apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
  name: scaler
  namespace: default
spec:
  appliesToWorkloads:
    - deployments.apps
    - containerizedworkloads.core.oma.dev
  definitionRef:
    name: manualscalertraits.core.oam.dev
  workloadRefPath: spec.workloadRef
  extension:
    template: |-
      outputs: scaler: {
      	apiVersion: "core.oam.dev/v1alpha2"
      	kind:       "ManualScalerTrait"
      	spec: {
      		replicaCount: parameter.replicas
      	}
      }
      parameter: {
      	//+short=r
      	replicas: *2 | int
      }
