github.com/oam-dev/kubevela@v1.9.11/docs/examples/workflow/canary-rollout/rollout-v2.yaml (about)

     1  apiVersion: core.oam.dev/v1beta1
     2  kind: Application
     3  metadata:
     4    name: canary-test
     5    namespace: default
     6  spec:
     7    components:
     8      - name: canarydemo
     9        type: webservice
    10        properties:
    11          image: docker.io/barnett/canarydemo:v2
    12          port: 8090
    13  
    14        traits:
    15          - type: canary-traffic
    16            properties:
    17              port:
    18                - 8090
    19  
    20          - type: rollout
    21            properties:
    22              targetSize: 2
    23              # This means to rollout two more replicas in two batches.
    24              rolloutBatches:
    25                - replicas: 1
    26                - replicas: 1
    27  
    28      - name: gateway
    29        type: webservice
    30        properties:
    31          image: docker.io/barnett/canarydemo-gateway:v2
    32          port: 8091
    33  
    34        traits:
    35          - type: expose
    36            properties:
    37              port:
    38                - 8091
    39  
    40          - type: istio-gateway
    41            properties:
    42              hosts:
    43                - "*"
    44              gateway: ingressgateway
    45              match:
    46                - exact: /server
    47              port: 8091
    48  
    49  
    50  
    51    workflow:
    52      steps:
    53        - name: rollout-1st-batch
    54          type: canary-rollout
    55          properties:
    56            # just upgrade first batch of component
    57            batchPartition: 0
    58            traffic:
    59              weightedTargets:
    60                - revision: canarydemo-v1
    61                  weight: 90 # 90% shift to new version
    62                - revision: canarydemo-v2
    63                  weight: 10 # 10% shift to new version
    64  
    65        # give user time to verify part of traffic shifting to newRevision
    66        - name: manual-approval
    67          type: suspend
    68  
    69        - name: rollout-rest
    70          type: canary-rollout
    71          properties:
    72            # upgrade all batches of component
    73            batchPartition: 1
    74            traffic:
    75              weightedTargets:
    76                - revision: canarydemo-v2
    77                  weight: 100 # 100% shift to new version