9.4部署策略详解

部署策略

  • Rolling update

  • Recreate

  • 蓝绿部署

  • 金丝雀

Recreate

spec:
  strategy:
    type: Recreate

Rolling update

spec:
  strategy:
    rollingUpdate:
      maxSuige: 25%
      maxUnavailable: 25%
    type: RollingUpdate
kubectl rollout pause deploy web-rollingupdate    # 暂停部署
kubectl rollout resume deploy web-rollingupdate    # 恢复部署
kubectl rollout undo deploy web-rollingupdate    # 回滚

蓝绿部署

spec:
  template:
    metadata:
      labels:
        app: web-bluegren
        version: v1.0

金丝雀部署

spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort:8080
  selector:
    app: web-bluegreen
  type: ClusterIP

Last updated

Was this helpful?