Skip to content

Commit

Permalink
Migrate node-role.kubernetes.io/master to node-role.kubernetes.io/con…
Browse files Browse the repository at this point in the history
…trol-plane
  • Loading branch information
unai-ttxu committed Sep 21, 2023
1 parent f964b34 commit 110e43e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubeadm.k8s.io/v1beta3
fapiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
{% if kubeadm_token is defined %}
bootstrapTokens:
Expand All @@ -18,8 +18,6 @@ nodeRegistration:
{% endif %}
{% if inventory_hostname in groups['kube_control_plane'] and inventory_hostname not in groups['kube_node'] %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ nodeRegistration:
criSocket: {{ cri_socket }}
{% if inventory_hostname in groups['kube_control_plane'] and inventory_hostname not in groups['kube_node'] %}
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
{% else %}
Expand Down
9 changes: 9 additions & 0 deletions roles/upgrade/post-upgrade/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
--timeout={{ upgrade_post_cilium_wait_timeout }}
delegate_to: "{{ groups['kube_control_plane'][0] }}"

- name: Ensure control-plane taints after upgrade
command: "{{ kubectl }} taint --overwrite node {{ kube_override_hostname|default(inventory_hostname) }} {{ item }}"
delegate_to: "{{ groups['kube_control_plane'][0] }}"
with_items:
- "node-role.kubernetes.io/control-plane:NoSchedule"
when:
- inventory_hostname in groups['kube_control_plane']
- inventory_hostname not in groups['kube_node']

- name: Confirm node uncordon
pause:
echo: yes
Expand Down

0 comments on commit 110e43e

Please sign in to comment.