zoukankan      html  css  js  c++  java
  • 滚动升级、回退镜像实例

    [root@lab2 dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v2 -n development
    [root@lab2 dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v1 -n development
    replicationcontroller/dandang image updated
    
    
    
    1、升级镜像
    
    [root@lab2 dandang]# ls
    dandang.v1.yaml  dandang.v2.yaml
    
    [root@lab2 dandang]# kubectl get deploy -n development
    NAME                  DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
    nginx1-7-deployment   2         2         2            2           4d
    nginx1-8-deployment   2         2         2            2           4d
    traefik-ingress-lb    1         1         1            1           4d
    
    [root@lab2 dandang]# cat dandang.v2.yaml 
    apiVersion: v1
    kind: ReplicationController
    metadata:
      name: dandang
      namespace: development
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            name: dandang
        spec:
          containers:
          - name: dandang
            image: 10.1.1.71:5000/library/dandang.ceshi:v2
            ports:
            - containerPort: 8080
    
    [root@lab2 dandang]# kubectl get ReplicationController -n development
    NAME      DESIRED   CURRENT   READY     AGE
    dandang   1         1         1         22h
    mysql     1         1         1         3d
    redis     1         1         1         3d
    
    [root@lab2 dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v2 -n development
    replicationcontroller/dandang image updated
    
    
    
    
    2、回退镜像
    
    
    回滚到上一个版本:
    
    [root@lab2 dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v1 -n development
    replicationcontroller/dandang image updated
  • 相关阅读:
    操作系统要点总结
    ARP的通信过程
    判断网段、子网、网络号
    C++要点总结
    枚举类型
    C指针总结
    C运算符总结
    替换空格
    WCF编写时候的测试
    WCF创建到使用到发布
  • 原文地址:https://www.cnblogs.com/effortsing/p/10598087.html
Copyright © 2011-2022 走看看