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
  • 相关阅读:
    Java设计模式—单例模式
    Java集合框架
    Java进程和线程
    Java IO
    Java异常类
    Java面向对象—抽象类和接口
    Java面向对象—多态
    Java面向对象—继承
    Java面向对象
    Java基础语法
  • 原文地址:https://www.cnblogs.com/effortsing/p/10598087.html
Copyright © 2011-2022 走看看