mirror of https://github.com/easzlab/kubeasz.git
更新集群升级操作说明及脚本
parent
cdf778b6ab
commit
867cc21b63
|
@ -25,12 +25,11 @@ $ ETCDCTL_API=3 etcdctl --write-out=table snapshot status backup.db
|
||||||
- 3a.如果不需要升级 docker版本:执行 `ansible-playbook -t upgrade_k8s 22.upgrade.yml` 即可完成k8s 升级,不会中断业务应用
|
- 3a.如果不需要升级 docker版本:执行 `ansible-playbook -t upgrade_k8s 22.upgrade.yml` 即可完成k8s 升级,不会中断业务应用
|
||||||
- 注:确实不需要频繁去升级 docker
|
- 注:确实不需要频繁去升级 docker
|
||||||
|
|
||||||
- 3b.如果可以接受短暂业务中断,执行 `ansible-playbook -t upgrade_k8s,restart_dockerd 22.upgrade.yml` 即可升级 k8s和 docker(如果有新的docker二进制)
|
- 3b.如果可以接受短暂业务中断,执行 `ansible-playbook -t upgrade_k8s,upgrade_docker 22.upgrade.yml` 即可升级 k8s和 docker(如果有新的docker二进制)
|
||||||
|
|
||||||
- 3c.如果要求零中断升级 k8s和 docker
|
- 3c.如果要求零中断升级 k8s和 docker
|
||||||
- i 执行 `ansible-playbook -t upgrade_k8s 22.upgrade.yml` (该步骤不会影响k8s上的业务应用)
|
- i 执行 `ansible-playbook -t upgrade_k8s,download_docker 22.upgrade.yml` (该步骤不会影响k8s上的业务应用)
|
||||||
- ii 逐个升级重启每个node节点的dockerd服务
|
- ii 逐个升级重启每个node节点的dockerd服务
|
||||||
- 待重启节点,先应用`kubectl cordon`和`kubectl drain`命令迁移业务pod
|
- 待重启节点,先应用`kubectl cordon`和`kubectl drain`命令迁移业务pod
|
||||||
- 待重启节点执行 `systemctl restart docker`
|
- 待重启节点执行 `systemctl restart docker`
|
||||||
- 恢复节点可调度 `kubectl uncordon`
|
- 恢复节点可调度 `kubectl uncordon`
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#主要组件版本如下
|
#主要组件版本如下
|
||||||
export K8S_VER=v1.10.2
|
export K8S_VER=v1.10.2
|
||||||
export ETCD_VER=v3.3.8
|
export ETCD_VER=v3.3.8
|
||||||
export DOCKER_VER=18.03.1-ce
|
export DOCKER_VER=17.03.2-ce
|
||||||
export CNI_VER=v0.7.0
|
export CNI_VER=v0.7.0
|
||||||
export DOCKER_COMPOSE=1.18.0
|
export DOCKER_COMPOSE=1.18.0
|
||||||
export HARBOR=v1.2.2
|
export HARBOR=v1.2.2
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
- docker-containerd-ctr
|
- docker-containerd-ctr
|
||||||
- dockerd
|
- dockerd
|
||||||
- docker-proxy
|
- docker-proxy
|
||||||
tags: upgrade_k8s
|
tags: upgrade_docker, download_docker
|
||||||
|
|
||||||
- name: docker命令自动补全
|
- name: docker命令自动补全
|
||||||
copy: src=docker dest=/etc/bash_completion.d/docker mode=0644
|
copy: src=docker dest=/etc/bash_completion.d/docker mode=0644
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
- name: 创建docker的systemd unit文件
|
- name: 创建docker的systemd unit文件
|
||||||
template: src=docker.service.j2 dest=/etc/systemd/system/docker.service
|
template: src=docker.service.j2 dest=/etc/systemd/system/docker.service
|
||||||
tags: upgrade_k8s
|
tags: upgrade_docker, download_docker
|
||||||
|
|
||||||
- name: 开机启用docker 服务
|
- name: 开机启用docker 服务
|
||||||
shell: systemctl enable docker
|
shell: systemctl enable docker
|
||||||
|
@ -40,10 +40,9 @@
|
||||||
|
|
||||||
- name: 开启docker 服务
|
- name: 开启docker 服务
|
||||||
shell: systemctl daemon-reload && systemctl restart docker
|
shell: systemctl daemon-reload && systemctl restart docker
|
||||||
tags: restart_dockerd
|
tags: upgrade_docker
|
||||||
|
|
||||||
## 可选 ------安装docker查询镜像 tag的小工具----
|
## 可选 ------安装docker查询镜像 tag的小工具----
|
||||||
# 先要安装轻量JSON处理程序‘jq’,已在 prepare 节点安装
|
# 先要安装轻量JSON处理程序‘jq’,已在 prepare 节点安装
|
||||||
- name: 下载 docker-tag
|
- name: 下载 docker-tag
|
||||||
copy: src=docker-tag dest={{ bin_dir }}/docker-tag mode=0755
|
copy: src=docker-tag dest={{ bin_dir }}/docker-tag mode=0755
|
||||||
tags: docker-tag
|
|
||||||
|
|
Loading…
Reference in New Issue