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'
This commit is contained in:
parent
cd42e649a7
commit
6ebcaab2bb
8 changed files with 8 additions and 8 deletions
|
@ -3,7 +3,7 @@ kind: NodeConfiguration
|
||||||
caCertPath: {{ kube_cert_dir }}/ca.crt
|
caCertPath: {{ kube_cert_dir }}/ca.crt
|
||||||
token: {{ kubeadm_token }}
|
token: {{ kubeadm_token }}
|
||||||
discoveryTokenAPIServers:
|
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) }}
|
- {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
- {{ kubeadm_discovery_address | replace("https://", "")}}
|
- {{ kubeadm_discovery_address | replace("https://", "")}}
|
||||||
|
|
|
@ -8,7 +8,7 @@ discoveryToken: {{ kubeadm_token }}
|
||||||
tlsBootstrapToken: {{ kubeadm_token }}
|
tlsBootstrapToken: {{ kubeadm_token }}
|
||||||
token: {{ kubeadm_token }}
|
token: {{ kubeadm_token }}
|
||||||
discoveryTokenAPIServers:
|
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) }}
|
- {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
- {{ kubeadm_discovery_address | replace("https://", "")}}
|
- {{ kubeadm_discovery_address | replace("https://", "")}}
|
||||||
|
|
|
@ -8,7 +8,7 @@ discoveryToken: {{ kubeadm_token }}
|
||||||
tlsBootstrapToken: {{ kubeadm_token }}
|
tlsBootstrapToken: {{ kubeadm_token }}
|
||||||
token: {{ kubeadm_token }}
|
token: {{ kubeadm_token }}
|
||||||
discoveryTokenAPIServers:
|
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) }}
|
- {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
- {{ kubeadm_discovery_address | replace("https://", "")}}
|
- {{ kubeadm_discovery_address | replace("https://", "")}}
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: kubeadm.k8s.io/v1beta1
|
||||||
kind: JoinConfiguration
|
kind: JoinConfiguration
|
||||||
discovery:
|
discovery:
|
||||||
bootstrapToken:
|
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) }}
|
apiServerEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
apiServerEndpoint: {{ kubeadm_discovery_address | replace("https://", "")}}
|
apiServerEndpoint: {{ kubeadm_discovery_address | replace("https://", "")}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: kubeadm.k8s.io/v1alpha1
|
apiVersion: kubeadm.k8s.io/v1alpha1
|
||||||
kind: MasterConfiguration
|
kind: MasterConfiguration
|
||||||
api:
|
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 }}
|
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
|
||||||
bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: kubeadm.k8s.io/v1alpha2
|
apiVersion: kubeadm.k8s.io/v1alpha2
|
||||||
kind: MasterConfiguration
|
kind: MasterConfiguration
|
||||||
api:
|
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 }}
|
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
|
||||||
bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
bindPort: {{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -37,7 +37,7 @@ networking:
|
||||||
serviceSubnet: {{ kube_service_addresses }}
|
serviceSubnet: {{ kube_service_addresses }}
|
||||||
podSubnet: {{ kube_pods_subnet }}
|
podSubnet: {{ kube_pods_subnet }}
|
||||||
kubernetesVersion: {{ kube_version }}
|
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) }}
|
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
controlPlaneEndpoint: {{ ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port }}
|
controlPlaneEndpoint: {{ ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port }}
|
||||||
|
|
|
@ -38,7 +38,7 @@ networking:
|
||||||
serviceSubnet: {{ kube_service_addresses }}
|
serviceSubnet: {{ kube_service_addresses }}
|
||||||
podSubnet: {{ kube_pods_subnet }}
|
podSubnet: {{ kube_pods_subnet }}
|
||||||
kubernetesVersion: {{ kube_version }}
|
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) }}
|
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
controlPlaneEndpoint: {{ ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port }}
|
controlPlaneEndpoint: {{ ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port }}
|
||||||
|
|
Loading…
Reference in a new issue