From ad3f503c0c73356396b9f15db1f4cd171cc9dbc2 Mon Sep 17 00:00:00 2001 From: William Turner Date: Thu, 6 Oct 2022 03:35:51 -0400 Subject: [PATCH] Fix default value for kubelet_secure_addresses (#9355) --- roles/kubernetes/node/defaults/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index 6cf237ea1..e90008c68 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -26,7 +26,10 @@ kubelet_fail_swap_on: true kubelet_systemd_hardening: false # List of secure IPs for kubelet -kubelet_secure_addresses: "{{ groups['kube_control_plane'] | map('extract', hostvars, ['ansible_host']) | join(' ') }}" +kubelet_secure_addresses: >- + {%- for host in groups['kube_control_plane'] -%} + {{ hostvars[host]['ip'] | default(fallback_ips[host]) }}{{ ' ' if not loop.last else '' }} + {%- endfor -%} # Reserve this space for kube resources kube_memory_reserved: 256Mi