滚动升级、回退镜像实例
发布时间:2020-12-14 01:50:11 所属栏目:Linux 来源:网络整理
导读:[[email?protected] dandang] # kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v2 -n development [[email?protected] dandang] # kubectl set image replicationcontroller/dandang dandang=10.1.1.71:50
[[email?protected] dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v2 -n development [[email?protected] dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v1 -n development replicationcontroller/dandang image updated 1、升级镜像 [[email?protected] dandang]# ls dandang.v1.yaml dandang.v2.yaml [[email?protected] 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 [[email?protected] 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 [[email?protected] 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 [[email?protected] dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v2 -n development replicationcontroller/dandang image updated 2、回退镜像 回滚到上一个版本: [[email?protected] dandang]# kubectl set image replicationcontroller/dandang dandang=10.1.1.71:5000/library/dandang.ceshi:v1 -n development replicationcontroller/dandang image updated (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |