forked from kubealex/libvirt-k8s-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path25_complete_setup.yml
28 lines (26 loc) · 903 Bytes
/
25_complete_setup.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
---
- name: Prepare files for cluster management
hosts: masters
tasks:
- name: Fetch kubeconfig file
fetch:
src: /etc/kubernetes/admin.conf
dest: admin.kubeconfig
flat: yes
become: true
when: inventory_hostname == groups['masters'][0]
- name: Label worker nodes, remove taints from master nodes if selected
hosts: masters
run_once: true
vars_files:
- vars/k8s_cluster.yml
tasks:
- block:
- name: Label worker nodes
shell: kubectl label nodes {{ hostvars[item].node_fqdn }} node-role.kubernetes.io/worker=
loop: "{{ groups['workers'] }}"
- name: Remove taint from master nodes
shell: kubectl taint node {{ hostvars[item].node_fqdn }} node-role.kubernetes.io/master-
loop: "{{ groups['masters'] }}"
when: k8s.master_schedulable
when: inventory_hostname == groups['masters'][0]