# This example demonstrates a Rollout using the blue-green update strategy, which contains a manual # gate before promoting the new stack. apiVersion:argoproj.io/v1alpha1 kind:Rollout metadata: name:rollout-bluegreen spec: replicas:2 revisionHistoryLimit:2 selector: matchLabels: app:rollout-bluegreen template: metadata: labels: app:rollout-bluegreen spec: containers: -name:rollouts-demo image:nginx:1.7.9 imagePullPolicy:Always ports: -containerPort:8080 strategy: blueGreen: # activeService specifies the service to update with the new template hash at time of promotion. # This field is mandatory for the blueGreen update strategy. activeService:rollout-bluegreen-active # previewService specifies the service to update with the new template hash before promotion. # This allows the preview stack to be reachable without serving production traffic. # This field is optional. previewService:rollout-bluegreen-preview # autoPromotionEnabled disables automated promotion of the new stack by pausing the rollout # immediately before the promotion. If omitted, the default behavior is to promote the new # stack as soon as the ReplicaSet are completely ready/available. # Rollouts can be resumed using: `kubectl argo rollouts promote ROLLOUT` autoPromotionEnabled:false#这里控制是否手动控制更新进度 # kubectl-argo-rollouts promote rollout-bluegreen 这个可以继续更新 --- kind:Service apiVersion:v1 metadata: name:rollout-bluegreen-active spec: selector: app:rollout-bluegreen ports: -protocol:TCP port:80 targetPort:8080