zoukankan      html  css  js  c++  java
  • Deployment更新

    1.查看镜像

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

    2.更改镜像

    [root@k8s-master01 ~]# kubectl set image delploy nginx nginx=nginx:1.15.3 --record  ### --record:记录
    

    3.查看状态

    [root@k8s-master01 ~]# kubectl get po
    NAME                     READY   STATUS              RESTARTS   AGE
    nginx-5dfc8689c6-gjnps   0/1     ContainerCreating   0          6s
    nginx-66bbc9fdc5-jmgwq   1/1     Running             0          40m
    nginx-66bbc9fdc5-rjqpk   1/1     Running             0          15m
    # 查看进度
    [root@k8s-master01 ~]# kubectl rollout status deploy nginx
    Waiting for deployment "nginx" rollout to finish: 1 out of 2 new replicas have been updated...
    Waiting for deployment "nginx" rollout to finish: 1 out of 2 new replicas have been updated...
    Waiting for deployment "nginx" rollout to finish: 1 out of 2 new replicas have been updated...
    Waiting for deployment "nginx" rollout to finish: 1 old replicas are pending termination...
    Waiting for deployment "nginx" rollout to finish: 1 old replicas are pending termination...
    deployment "nginx" successfully rolled out
    
    # 查看流程
    [root@k8s-master01 ~]# kubectl describe deploy nginx
    # 查看RS
    [root@k8s-master01 ~]# kubectl get po --show-labels
    NAME                     READY   STATUS    RESTARTS   AGE   LABELS
    nginx-6cdd5dd489-njqjd   1/1     Running   0          10m   app=nginx,pod-template-hash=6cdd5dd489
    nginx-6cdd5dd489-pb8qk   1/1     Running   0          10m   app=nginx,pod-template-hash=6cdd5dd489
    # 查看状态
    [root@k8s-master01 ~]# kubectl get po
    NAME                     READY   STATUS        RESTARTS   AGE
    nginx-5dfc8689c6-cw87q   1/1     Running       0          60s
    nginx-5dfc8689c6-gjnps   1/1     Running       0          2m4s
    nginx-66bbc9fdc5-jmgwq   0/1     Terminating   0          42m   # 我们的副本是2,滚动更新会先1一个running后,会删除一个pod,在起一个。
    查看镜像
    [root@k8s-master01 ~]# kubectl get po nginx-5dfc8689c6-cw87q -oyaml|grep image
                f:image: {}
                f:imagePullPolicy: {}
      - image: nginx:1.15.3
        imagePullPolicy: IfNotPresent
        image: nginx:1.15.3
        imageID: docker-pullable://nginx@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3
    
    
  • 相关阅读:
    使用Azure Rest API获得Access Token介绍
    Azure Service Fabric应用程序日志记录与展现
    Azure Web App创建Python应用
    AzureWeb App如何做私有仓储的部署
    Python web在IIS上发布方法和原理
    [转载]DriverStore文件夹特别大,能删除吗?
    Azure Web APP中Local Git 如何部署分支
    Azure Web 应用如何修改 IIS 配置
    文件上传绕过
    windows下通过配置服务器安全策略指定IP地址远程访问服务器的设置方法
  • 原文地址:https://www.cnblogs.com/Applogize/p/14381989.html
Copyright © 2011-2022 走看看