From 8e28ba38d285e2d8213b12070768cb165675d083 Mon Sep 17 00:00:00 2001 From: Florent Monbillard Date: Thu, 16 May 2019 04:23:42 -0400 Subject: [PATCH] Add Load Balancer IP to API servers SANs (#4775) - Add loadbalancer_apiserver.address to apiserver_sans --- roles/kubernetes/master/tasks/kubeadm-setup.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes/master/tasks/kubeadm-setup.yml b/roles/kubernetes/master/tasks/kubeadm-setup.yml index a00702c95..510cbc6be 100644 --- a/roles/kubernetes/master/tasks/kubeadm-setup.yml +++ b/roles/kubernetes/master/tasks/kubeadm-setup.yml @@ -55,7 +55,7 @@ - name: kubeadm | aggregate all SANs set_fact: - apiserver_sans: "{{ (sans_base + groups['kube-master'] + sans_lb + sans_supp + sans_access_ip + sans_ip + sans_address) | unique }}" + apiserver_sans: "{{ (sans_base + groups['kube-master'] + sans_lb + sans_lb_ip + sans_supp + sans_access_ip + sans_ip + sans_address) | unique }}" vars: sans_base: - "kubernetes" @@ -66,6 +66,7 @@ - "localhost" - "127.0.0.1" sans_lb: "{{ [apiserver_loadbalancer_domain_name] if apiserver_loadbalancer_domain_name is defined else [] }}" + sans_lb_ip: "{{ [loadbalancer_apiserver.address] if loadbalancer_apiserver is defined and loadbalancer_apiserver.address is defined else [] }}" sans_supp: "{{ supplementary_addresses_in_ssl_keys if supplementary_addresses_in_ssl_keys is defined else [] }}" sans_access_ip: "{{ groups['kube-master'] | map('extract', hostvars, 'access_ip') | list | select('defined') | list }}" sans_ip: "{{ groups['kube-master'] | map('extract', hostvars, 'ip') | list | select('defined') | list }}"