2018-05-11 11:07:14 +08:00
|
|
|
|
# 集群更新存在一定风险,请谨慎操作
|
2018-05-11 12:02:41 +08:00
|
|
|
|
# 使用命令:ansible-playbook -t upgrade_k8s 22.upgrade.yml
|
2018-05-11 11:07:14 +08:00
|
|
|
|
|
|
|
|
|
# 更新kubectl二进制
|
|
|
|
|
- hosts:
|
|
|
|
|
- kube-master
|
|
|
|
|
- kube-node
|
|
|
|
|
- deploy
|
|
|
|
|
- etcd
|
|
|
|
|
- lb
|
|
|
|
|
roles:
|
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
|
|
# 更新etcd集群
|
|
|
|
|
- hosts: etcd
|
|
|
|
|
roles:
|
|
|
|
|
- etcd
|
|
|
|
|
|
|
|
|
|
# docker更新,为保证不中断业务,不自动重启docker服务
|
|
|
|
|
- hosts:
|
|
|
|
|
- kube-master
|
|
|
|
|
- kube-node
|
|
|
|
|
roles:
|
|
|
|
|
- docker
|
|
|
|
|
|
|
|
|
|
# 更新master节点
|
|
|
|
|
- hosts: kube-master
|
|
|
|
|
roles:
|
|
|
|
|
- kube-master
|
|
|
|
|
- kube-node
|
|
|
|
|
|
|
|
|
|
# 更新node节点
|
|
|
|
|
- hosts: kube-node
|
|
|
|
|
roles:
|
|
|
|
|
- { role: kube-node, when: "DEPLOY_MODE != 'allinone'" }
|