Skip to content
Snippets Groups Projects
Verified Commit 144cc34f authored by cyrinux's avatar cyrinux :construction_worker_tone1:
Browse files

chore: add label zone with ansible

parent 6aae8df3
No related branches found
No related tags found
No related merge requests found
Pipeline #32747 failed with stages
in 15 minutes and 35 seconds
......@@ -13,7 +13,7 @@
content: "nameserver {{ node_dns }}"
when: node_dns is defined
# This is require so thqt kubectl apply -k works with remote git
# This is require so that kubectl apply -k works with remote git
- name: Install git for kustomize
ansible.builtin.package:
name: git
......@@ -48,6 +48,14 @@
retries: 10
delay: 5
- name: Label cluster nodes zone
ansible.builtin.shell: "kubectl label node {{ hostvars[item.1].inventory_hostname }} topology.kubernetes.io/zone={{ item.0.zone }}"
loop: "{{ groups | dict2items(key_name='role', value_name='nodes') | subelements('nodes') }}"
environment:
KUBECONFIG: "{{ kubeconfig }}"
retries: 10
delay: 5
- name: Taint master nodes
ansible.builtin.shell: "kubectl taint --overwrite=true node {{ hostvars[item].inventory_hostname }} node-role.kubernetes.io/control-plane=\"\":NoSchedule"
loop: "{{ groups['master'] }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment