kubevela.github.io/docs/reference/addons/kruise-rollout.md

3.4 KiB

title
kruise-rollout

Kruise Rollout addon provides canary release capabilities for Kubernetes Deployment, Statefulset and OpenKruise CloneSet. For more details, please refer to: Kruise Rollout.

Installation

$ vela addon enable kruise-rollout
Addon: kruise-rollout enabled Successfully.

Uninstallation

$ vela addon disable kruise-rollout

Usage

Kurise rollout addon help to canary rollout your workload no matter defined with webservice or contained in a helm.

If your workload is in a helm chart please refer to doc for more usage info, otherwise please refer to usage of webservice component.

Properties

Name Description Type Required Default
canary Configuration for canary rollout strategy Canary true
workloadType Specify the target worklaod type WorkloadType false

Canary

Name Description Type Required Default
steps Defines the entire rollout process in steps CanaryStep true
trafficRoutings Define traffic routing related service, ingress information []TrafficRouting true
CanaryStep
Name Description Type Required Default
weight Define the percentage of traffic routing to the new version in each step, e.g., 20%, 40%... int false
replicas Define the replicas of release to the new version in each step, e.g., 5, 10... int false
duration Define the behavior after release each step, if not filled, the default requires manual determination. If filled, it indicates the time to wait in seconds, e.g., 60 int false
TrafficRouting
Name Description Type Required Default
service Define service name stirng false context.name
ingressName Define ingress name string false context.name
WorkloadType
Name Description Type Required Default
apiVersion Target workload's apiVersion string true
kind Target workload's kind string true

Example

cat <<EOF | vela up -f -
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: canary-demo
  annotations:
    app.oam.dev/publishVersion: v1
spec:
  components:
  - name: canary-demo
    type: webservice
    properties:
      image: barnett/canarydemo:v1
      ports:
      - port: 8090
    traits:
    - type: scaler
      properties:
        replicas: 5
    - type: gateway
      properties:
        domain: canary-demo.com
        http:
          "/version": 8090
    - type: kruise-rollout
      properties:
        canary:
          steps:
           # The first batch of Canary releases 20% Pods, and 20% traffic imported to the new version, require manual confirmation before subsequent releases are completed
          - weight: 20
          # The second batch of Canary releases 90% Pods, and 90% traffic imported to the new version.
          - weight: 90
          trafficRoutings:
            - type: nginx
EOF