mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-22 08:17:45 -02:30
Test group membership with group_names
Testing for group membership with group names makes Kubespray more tolerant towards the structure of the inventory. Where 'inventory_hostname in groups["some_group"] would fail if "some_group" is not defined, '"some_group" in group_names' would not.
This commit is contained in:
@@ -65,14 +65,14 @@
|
||||
that: ansible_memtotal_mb >= minimal_master_memory_mb
|
||||
when:
|
||||
- not ignore_assert_errors
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
|
||||
- name: Stop if memory is too small for nodes
|
||||
assert:
|
||||
that: ansible_memtotal_mb >= minimal_node_memory_mb
|
||||
when:
|
||||
- not ignore_assert_errors
|
||||
- inventory_hostname in groups['kube_node']
|
||||
- ('kube_node' in group_names)
|
||||
|
||||
# This command will fail if cgroups are not enabled on the node.
|
||||
# For reference: https://kubernetes.io/docs/concepts/architecture/cgroups/#check-cgroup-version
|
||||
@@ -92,7 +92,7 @@
|
||||
msg: "Do not schedule more pods on a node than inet addresses are available."
|
||||
when:
|
||||
- not ignore_assert_errors
|
||||
- inventory_hostname in groups['k8s_cluster']
|
||||
- ('k8s_cluster' in group_names)
|
||||
- kube_network_node_prefix is defined
|
||||
- kube_network_plugin != 'calico'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user