fix: configure Kubernetes feature gates with dictionaries (#13608)

* fix: configure Kubernetes feature gates with dictionaries

* docs: update feature gate settings to dictionaries
This commit is contained in:
Frank
2026-10-15 15:26:39 +00:00
committed by GitHub
parent 6b3cbe1cbb
commit bebc536fae
11 changed files with 59 additions and 57 deletions
+18
View File
@@ -84,6 +84,24 @@
run_once: true
when: not ignore_assert_errors
- name: Stop if feature gates are not dictionaries of booleans
assert:
that:
- lookup('ansible.builtin.vars', item) is mapping
- lookup('ansible.builtin.vars', item) | dict2items | rejectattr('value', 'boolean') | length == 0
fail_msg: >-
{{ item }} must be a dictionary of feature gate names and boolean values.
Replace lists such as ["NodeSwap=true"] with {NodeSwap: true}.
loop:
- kube_feature_gates
- kube_apiserver_feature_gates
- kube_controller_feature_gates
- kube_scheduler_feature_gates
- kube_proxy_feature_gates
- kubelet_feature_gates
- kubeadm_feature_gates
when: not ignore_assert_errors
- name: Stop if even number of etcd hosts
assert:
that: groups.get('etcd', groups.kube_control_plane) | length is not divisibleby 2