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

     1  apiVersion: core.oam.dev/v1beta1
     2  kind: Application
     3  metadata:
     4    name: book-info
     5    namespace: default
     6  spec:
     7    components:
     8      - name: reviews
     9        type: webservice
    10        properties:
    11          image: docker.io/istio/examples-bookinfo-reviews-v3:1.16.2
    12          port: 9080
    13          volumes:
    14            - name: wlp-output
    15              type: emptyDir
    16              mountPath: /opt/ibm/wlp/output
    17            - name: tmp
    18              type: emptyDir
    19              mountPath: /tmp
    20  
    21        traits:
    22          - type: canary-traffic
    23            properties:
    24              port:
    25                - 9080
    26  
    27          - type: rollout
    28            properties:
    29              targetSize: 2
    30              # This means to rollout two more replicas in two batches.
    31              rolloutBatches:
    32                - replicas: 1
    33                - replicas: 1
    34  
    35      - name: productpage
    36        type: webservice
    37        properties:
    38          image: docker.io/istio/examples-bookinfo-productpage-v1:1.16.2
    39          port: 9080
    40  
    41        traits:
    42          - type: expose
    43            properties:
    44              port:
    45                - 9080
    46  
    47          - type: istio-gateway
    48            properties:
    49              hosts:
    50                - "*"
    51              gateway: ingressgateway
    52              match:
    53                - exact: /productpage
    54                - prefix: /static
    55                - exact: /login
    56                - prefix: /api/v1/products
    57              port: 9080
    58  
    59      - name: ratings
    60        type: webservice
    61        properties:
    62          image: docker.io/istio/examples-bookinfo-ratings-v1:1.16.2
    63          port: 9080
    64  
    65        traits:
    66          - type: expose
    67            properties:
    68              port:
    69                - 9080
    70  
    71      - name: details
    72        type: webservice
    73        properties:
    74          image: docker.io/istio/examples-bookinfo-details-v1:1.16.2
    75          port: 9080
    76  
    77        traits:
    78          - type: expose
    79            properties:
    80              port:
    81                - 9080
    82  
    83    workflow:
    84      steps:
    85        - name: rollout-1st-batch
    86          type: canary-rollout
    87          properties:
    88            # just upgrade first batch of component
    89            batchPartition: 0
    90            traffic:
    91              weightedTargets:
    92                - revision: reviews-v1
    93                  weight: 90 # 90% shift to new version
    94                - revision: reviews-v2
    95                  weight: 10 # 10% shift to new version
    96  
    97        # give user time to verify part of traffic shifting to newRevision
    98        - name: manual-approval
    99          type: suspend
   100  
   101        - name: rollout-rest
   102          type: canary-rollout
   103          properties:
   104            # upgrade all batches of component
   105            batchPartition: 1
   106            traffic:
   107              weightedTargets:
   108                - revision: reviews-v2
   109                  weight: 100 # 100% shift to new version