爲了服務升級過程當中提供可持續的不中斷的服務,Kubernetes 提供了rolling update機制,具體配置須要修改對應服務的yaml文件
api
minReadySeconds: 100 # 容器啓動建立多少s後服務可用
strategy:
# indicate which strategy we want for rolling update
type: RollingUpdate
rollingUpdate:
maxSurge: 1 # 升級過程當中最多能夠比原先設置多出的POD數量app
maxUnavailable: 1 # 升級過程當中最多有多少個POD處於沒法提供服務的狀態this
replicas: 2 # 目的副本集個數spa
kubwx apply -f svc-zipkin.yaml --recordserver
kubwx rollout pause deployment zipkin-serverip
kubwx rollout resume deployment zipkin-serverget
kubwx rollout history deployment zipkin-serverio
kubwx rollout undo deployment zipkin-server容器
kubwx rollout undo deployment zipkin-server --to-revision=13stream