github.com/oam-dev/kubevela@v1.9.11/pkg/definition/testdata/custom-trait-affinity-v1.yaml (about)

     1  apiVersion: core.oam.dev/v1beta1
     2  kind: DefinitionRevision
     3  metadata:
     4    labels:
     5      app.kubernetes.io/managed-by: Helm
     6      custom.definition.oam.dev/ui-hidden: 'true'
     7      trait.oam.dev/name: affinity
     8    name: affinity-v1
     9    namespace: rev-test-custom-ns
    10  spec:
    11    componentDefinition:
    12      metadata: {}
    13      spec:
    14        workload:
    15          definition:
    16            apiVersion: ''
    17            kind: ''
    18      status: {}
    19    definitionType: Trait
    20    policyDefinition:
    21      metadata: {}
    22      spec:
    23        definitionRef:
    24          name: ''
    25      status: {}
    26    revision: 1
    27    revisionHash: 9db54dd8da7e4bd5
    28    traitDefinition:
    29      apiVersion: core.oam.dev/v1beta1
    30      kind: TraitDefinition
    31      metadata:
    32        annotations:
    33          definition.oam.dev/description: >-
    34            affinity specify affinity and tolerationon K8s pod for your workload
    35            which follows the pod spec in path 'spec.template'.
    36        name: affinity
    37        namespace: rev-test-custom-ns
    38      spec:
    39        appliesToWorkloads:
    40          - '*'
    41        definitionRef:
    42          name: ''
    43        podDisruptive: true
    44        schematic:
    45          cue:
    46            template: |
    47              parameter: {
    48              	// +usage=Specify the number of workload
    49              	replicas: *1 | int
    50              }
    51              // +patchStrategy=retainKeys
    52              patch: spec: replicas: parameter.replicas
    53      status: {}
    54    workflowStepDefinition:
    55      metadata: {}
    56      spec:
    57        definitionRef:
    58          name: ''
    59      status: {}