Fix kubeadm lb

This commit is contained in:
rongzhang 2018-08-29 18:29:24 +08:00
parent f765ed8f1c
commit 9eade647e6
2 changed files with 8 additions and 6 deletions

View file

@ -1,10 +1,11 @@
apiVersion: kubeadm.k8s.io/v1alpha1 apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration kind: MasterConfiguration
api: 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 %} {% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }} controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ kube_apiserver_port }}
{% else %}
advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }}
bindPort: {{ kube_apiserver_port }}
{% endif %} {% endif %}
etcd: etcd:
endpoints: endpoints:

View file

@ -1,10 +1,11 @@
apiVersion: kubeadm.k8s.io/v1alpha2 apiVersion: kubeadm.k8s.io/v1alpha2
kind: MasterConfiguration kind: MasterConfiguration
api: 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 %} {% if groups['kube-master'] | length > 1 and kubeadm_config_api_fqdn is defined %}
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }} controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ kube_apiserver_port }}
{% else %}
advertiseAddress: {{ ip | default(ansible_default_ipv4.address) }}
bindPort: {{ kube_apiserver_port }}
{% endif %} {% endif %}
etcd: etcd:
external: external: