mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-17 03:00:07 -03:30
Add kubeadm controlplaneEndpoint
Nginx LB(default) Other LB by kubeadm controlplane
This commit is contained in:
@@ -91,6 +91,12 @@
|
||||
kubeadmConfig_api_version: v1alpha2
|
||||
when: kubeadm_output.stdout|version_compare('v1.11.0', '>=')
|
||||
|
||||
# Nginx LB(default), If kubeadm_config_api_fqdn is defined, use other LB by kubeadm controlPlaneEndpoint.
|
||||
- name: set kubeadm_config_api_fqdn define
|
||||
set_fact:
|
||||
kubeadm_config_api_fqdn: "{{ apiserver_loadbalancer_domain_name|default('lb-apiserver.kubernetes.local') }}"
|
||||
when: loadbalancer_apiserver is defined
|
||||
|
||||
- name: kubeadm | Create kubeadm config
|
||||
template:
|
||||
src: "kubeadm-config.{{ kubeadmConfig_api_version }}.yaml.j2"
|
||||
|
||||
@@ -3,6 +3,9 @@ kind: MasterConfiguration
|
||||
api:
|
||||
advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }}
|
||||
bindPort: {{ kube_apiserver_port }}
|
||||
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
|
||||
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
|
||||
{% endif %}
|
||||
etcd:
|
||||
endpoints:
|
||||
{% for endpoint in etcd_access_addresses.split(',') %}
|
||||
|
||||
@@ -3,6 +3,9 @@ kind: MasterConfiguration
|
||||
api:
|
||||
advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }}
|
||||
bindPort: {{ kube_apiserver_port }}
|
||||
{% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
|
||||
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}
|
||||
{% endif %}
|
||||
etcd:
|
||||
external:
|
||||
endpoints:
|
||||
|
||||
Reference in New Issue
Block a user