mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2025-06-06 01:17:19 +02:00
only the control-plane master gets the ability to set taints
This commit is contained in:
parent
57a3880428
commit
16de20c8e4
@ -5,17 +5,3 @@
|
|||||||
args:
|
args:
|
||||||
creates: /etc/kubernetes/kubelet.conf
|
creates: /etc/kubernetes/kubelet.conf
|
||||||
tags: ["skip_ansible_lint"]
|
tags: ["skip_ansible_lint"]
|
||||||
|
|
||||||
- name: Allow pods on control plane (if configured).
|
|
||||||
command: "kubectl taint nodes {{ inventory_hostname_short }} node-role.kubernetes.io/control-plane-"
|
|
||||||
register: taint_removed
|
|
||||||
until: >
|
|
||||||
("untainted" in taint_removed.stdout) or
|
|
||||||
("not found" in taint_removed.stdout)
|
|
||||||
changed_when: "'untainted' in taint_removed.stdout"
|
|
||||||
failed_when: false
|
|
||||||
retries: 100
|
|
||||||
delay: 5
|
|
||||||
when:
|
|
||||||
- kubernetes_allow_pods_on_control_plane | bool
|
|
||||||
- join_ctrl_plane.changed
|
|
||||||
|
@ -190,11 +190,3 @@
|
|||||||
register: weave_result
|
register: weave_result
|
||||||
changed_when: "'created' in weave_result.stdout"
|
changed_when: "'created' in weave_result.stdout"
|
||||||
when: kubernetes_pod_network.cni == 'weave'
|
when: kubernetes_pod_network.cni == 'weave'
|
||||||
|
|
||||||
# TODO: Check if taint exists with something like `kubectl describe nodes`
|
|
||||||
# instead of using kubernetes_init_stat.stat.exists check.
|
|
||||||
- name: Allow pods on control plane (if configured).
|
|
||||||
command: "kubectl taint nodes --all node-role.kubernetes.io/control-plane-"
|
|
||||||
when:
|
|
||||||
- kubernetes_allow_pods_on_control_plane | bool
|
|
||||||
- not kubernetes_init_stat.stat.exists
|
|
||||||
|
@ -110,3 +110,17 @@
|
|||||||
when:
|
when:
|
||||||
- kubernetes_allow_pods_on_control_plane | bool
|
- kubernetes_allow_pods_on_control_plane | bool
|
||||||
- not kubernetes_init_stat.stat.exists
|
- not kubernetes_init_stat.stat.exists
|
||||||
|
|
||||||
|
- name: Allow pods on control plane (if configured).
|
||||||
|
command: "kubectl taint nodes --all node-role.kubernetes.io/control-plane-"
|
||||||
|
register: taint_removed
|
||||||
|
until: >
|
||||||
|
("untainted" in taint_removed.stdout) or
|
||||||
|
("not found" in taint_removed.stdout)
|
||||||
|
changed_when: "'untainted' in taint_removed.stdout"
|
||||||
|
failed_when: false
|
||||||
|
retries: 100
|
||||||
|
delay: 5
|
||||||
|
when:
|
||||||
|
- join_ctrl_plane.changed
|
||||||
|
- inventory_hostname == groups['k8s_control_plane'][0]
|
||||||
|
Loading…
Reference in New Issue
Block a user