From 98d766c68e8f0fe0592bf985d1f3cb0645f25cda Mon Sep 17 00:00:00 2001 From: Dann Date: Wed, 14 Nov 2018 03:23:30 -0500 Subject: [PATCH] Moves apiserver port to bindPort when using controlPlaneEndpoint (#3449) --- .../master/templates/kubeadm-config.v1alpha1.yaml.j2 | 3 ++- .../master/templates/kubeadm-config.v1alpha2.yaml.j2 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes/master/templates/kubeadm-config.v1alpha1.yaml.j2 b/roles/kubernetes/master/templates/kubeadm-config.v1alpha1.yaml.j2 index 531c27f9a..44d16ddf4 100644 --- a/roles/kubernetes/master/templates/kubeadm-config.v1alpha1.yaml.j2 +++ b/roles/kubernetes/master/templates/kubeadm-config.v1alpha1.yaml.j2 @@ -2,7 +2,8 @@ apiVersion: kubeadm.k8s.io/v1alpha1 kind: MasterConfiguration api: {% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %} - controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }} + controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }} + bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }} {% else %} advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }} bindPort: {{ kube_apiserver_port }} diff --git a/roles/kubernetes/master/templates/kubeadm-config.v1alpha2.yaml.j2 b/roles/kubernetes/master/templates/kubeadm-config.v1alpha2.yaml.j2 index 39c11cba9..38053be6a 100644 --- a/roles/kubernetes/master/templates/kubeadm-config.v1alpha2.yaml.j2 +++ b/roles/kubernetes/master/templates/kubeadm-config.v1alpha2.yaml.j2 @@ -2,7 +2,8 @@ apiVersion: kubeadm.k8s.io/v1alpha2 kind: MasterConfiguration api: {% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %} - controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }} + controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }} + bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }} {% else %} advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }} bindPort: {{ kube_apiserver_port }}