2021-01-19 17:41:00 +08:00
|
|
|
# to set up 'kube_master' nodes
|
|
|
|
- hosts: kube_master
|
2017-11-11 19:14:21 +08:00
|
|
|
roles:
|
2021-04-01 19:18:59 +08:00
|
|
|
- kube-lb
|
2017-11-11 19:14:21 +08:00
|
|
|
- kube-master
|
2018-03-16 18:23:34 +08:00
|
|
|
- kube-node
|
|
|
|
tasks:
|
2018-09-29 09:06:19 +08:00
|
|
|
- name: Making master nodes SchedulingDisabled
|
2022-10-09 20:43:19 +08:00
|
|
|
shell: "{{ base_dir }}/bin/kubectl cordon {{ inventory_hostname }} "
|
2021-01-19 17:41:00 +08:00
|
|
|
when: "inventory_hostname not in groups['kube_node']"
|
2018-03-16 18:23:34 +08:00
|
|
|
ignore_errors: true
|
2022-10-09 20:43:19 +08:00
|
|
|
connection: local
|
2018-03-16 18:23:34 +08:00
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
- name: Setting master role name
|
2022-10-09 20:43:19 +08:00
|
|
|
shell: "{{ base_dir }}/bin/kubectl label node {{ inventory_hostname }} kubernetes.io/role=master --overwrite"
|
2018-05-22 15:57:44 +08:00
|
|
|
ignore_errors: true
|
2022-10-09 20:43:19 +08:00
|
|
|
connection: local
|