forked from TimeBye/kubeadm-ha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
86-remove-etcd.yml
38 lines (35 loc) · 1.04 KB
/
86-remove-etcd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- hosts:
- del-etcd
vars_prompt:
name: "restore_confirmation"
prompt: "确实要移除 etcd 节点? 输入“yes”确认移除。"
default: "no"
private: no
pre_tasks:
- name: 移除确认
fail:
msg: "移除确认失败,取消移除 etcd 节点操作。"
when: restore_confirmation != "yes"
roles:
- remove/etcd
# 删除etcd节点后刷新master节点kubeadm配置
- hosts:
- kube-master
roles:
- kube-master
- hosts:
- kube-master
tasks:
- name: "更新第一个 master 节点:{{ inventory_hostname }} 的配置"
shell: >
kubeadm upgrade apply --config=/etc/kubernetes/kubeadm-config.yaml --force
when: inventory_hostname == groups['kube-master'][0]
- name: "更新 master 节点:{{ inventory_hostname }} 的配置"
shell: >
kubeadm upgrade node
{% if kube_version.split('.')[1]|int == 13 %}
experimental-control-plane
{% endif %}
when:
- inventory_hostname != groups['kube-master'][0]
- inventory_hostname in groups['kube-master']