StatefulSet更新策略

1.当前版本

[root@k8s-master01 ~]# kubectl get sts web -oyaml|grep image
                f:imagePullPolicy: {}
                f:image: {}
      - image: nginx:1.15.2
        imagePullPolicy: IfNotPresent

2.修改镜像版本

[root@k8s-master01 ~]# kubectl edit sts web
    spec:
      containers:
      - image: nginx:1.15.4
        imagePullPolicy: IfNotPresent
        name: nginx
        ports:
        - containerPort: 80

3.查看流程

[root@k8s-master01 ~]# kubectl get pod -l app=nginx -w
NAME                     READY   STATUS    RESTARTS   AGE
nginx-6cdd5dd489-bs5wz   1/1     Running   0          4d16h
nginx-6cdd5dd489-n8xv9   1/1     Running   0          4d16h
web-0                    1/1     Running   0          3m12s
web-1                    1/1     Running   0          4m2s
web-2                    1/1     Running   0          4m36s
web-2                    1/1     Terminating   0          4m57s
web-2                    0/1     Terminating   0          4m58s
web-2                    0/1     Terminating   0          5m10s
web-2                    0/1     Terminating   0          5m10s
web-2                    0/1     Pending       0          0s
web-2                    0/1     Pending       0          0s
web-2                    0/1     ContainerCreating   0          0s
web-2                    1/1     Running             0          21s
web-1                    1/1     Terminating         0          4m57s
web-1                    0/1     Terminating         0          4m57s
web-1                    0/1     Terminating         0          5m7s
web-1                    0/1     Terminating         0          5m7s
web-1                    0/1     Pending             0          0s
web-1                    0/1     Pending             0          0s
web-1                    0/1     ContainerCreating   0          0s
web-1                    1/1     Running             0          19s
web-0                    1/1     Terminating         0          4m36s
web-0                    0/1     Terminating         0          4m37s
web-0                    0/1     Terminating         0          5m1s
web-0                    0/1     Terminating         0          5m1s
web-0                    0/1     Pending             0          0s
web-0                    0/1     Pending             0          0s
web-0                    0/1     ContainerCreating   0          0s
web-0                    1/1     Running             0          20s

4.查看结果

[root@k8s-master01 ~]# kubectl get sts web -oyaml|grep image
                f:imagePullPolicy: {}
                f:image: {}
      - image: nginx:1.15.4
        imagePullPolicy: IfNotPresent
上一篇:k8s-HPA自动扩缩容


下一篇:Pointnet_cls