• 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
    
  • 相关阅读:
    Java中的IO操作和缓冲区
    Java是否还能再辉煌十年?
    Java的字符串操作
    WordCount(Java实现)
    自我介绍+软工5问
    数据库系统第六章【关系数据理论】(B站视频)
    ini 配置文件读取程序(C语言)
    epoll介绍 实例
    Blizzardhash算法oneway hash
    pychartdir模块安装
  • 原文地址:https://www.cnblogs.com/Applogize/p/14397795.html
Copyright © 2020-2023  润新知