controlPlaneEndpoint set up through load balancer should be possible … (#3888)

* controlPlaneEndpoint set up through load balancer should be possible  even in single master setups

Enable load balancer for single-master setups
Fixes an issue where single-master setups are not reachable using the usual admin.conf from outside the cluster. 

controlPlaneEndpoint set up through load balancer should be possible  even in single master setups

* add fix to other api versions

* remove obsolete check completely

* remove check, pass 2

* removes checks in client configuration

* delete 'and'
pull/3941/head
Zefool 2018-12-25 09:03:32 +01:00 committed by Kubernetes Prow Robot
parent cd42e649a7
commit 6ebcaab2bb
8 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@ kind: NodeConfiguration
caCertPath: {{ kube_cert_dir }}/ca.crt
token: {{ kubeadm_token }}
discoveryTokenAPIServers:
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
- {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
- {{ kubeadm_discovery_address | replace("https://", "")}}

View File

@ -8,7 +8,7 @@ discoveryToken: {{ kubeadm_token }}
tlsBootstrapToken: {{ kubeadm_token }}
token: {{ kubeadm_token }}
discoveryTokenAPIServers:
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
- {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
- {{ kubeadm_discovery_address | replace("https://", "")}}

View File

@ -8,7 +8,7 @@ discoveryToken: {{ kubeadm_token }}
tlsBootstrapToken: {{ kubeadm_token }}
token: {{ kubeadm_token }}
discoveryTokenAPIServers:
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
- {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
- {{ kubeadm_discovery_address | replace("https://", "")}}

View File

@ -2,7 +2,7 @@ apiVersion: kubeadm.k8s.io/v1beta1
kind: JoinConfiguration
discovery:
bootstrapToken:
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
apiServerEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
apiServerEndpoint: {{ kubeadm_discovery_address | replace("https://", "")}}

View File

@ -1,7 +1,7 @@
apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
api:
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}

View File

@ -1,7 +1,7 @@
apiVersion: kubeadm.k8s.io/v1alpha2
kind: MasterConfiguration
api:
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}

View File

@ -37,7 +37,7 @@ networking:
serviceSubnet: {{ kube_service_addresses }}
podSubnet: {{ kube_pods_subnet }}
kubernetesVersion: {{ kube_version }}
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
controlPlaneEndpoint: {{ ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port }}

View File

@ -38,7 +38,7 @@ networking:
serviceSubnet: {{ kube_service_addresses }}
podSubnet: {{ kube_pods_subnet }}
kubernetesVersion: {{ kube_version }}
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
{% if kubeadm_config_api_fqdn is defined %}
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
controlPlaneEndpoint: {{ ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port }}