Kubernetes Deployment 并行重启Pod

Kubernetes Deployment 并行重启Pod

参考:https://stackoverflow.com/questions/59050709/how-to-rollout-restart-deployment-through-the-api

kubernetes 1.5 之后可以使用

kubectl rollout restart deployment my-deployment

API 可以调用 PATCH

参数:

apiVersion: apps/v1
kind: Deployment
spec:
  strategy:
    rollingUpdate:
      maxSurge: 并行数
  template:
    metadata:
      annotations: #增加restartedAt 加现在时间,可以立刻重启
        kubectl.kubernetes.io/restartedAt: '2021-01-01T15:04:05Z07:00' 
posted @ 2021-06-03 17:36  sixinshuier  阅读(354)  评论(0编辑  收藏  举报