Add kube_override_hostname to kubeadm certs. (#4903)

This commit is contained in:
andreyshestakov 2019-06-24 09:19:56 +03:00 committed by Kubernetes Prow Robot
parent 6025981ceb
commit b5406b752d
2 changed files with 3 additions and 2 deletions

View file

@ -55,7 +55,7 @@
- name: kubeadm | aggregate all SANs
set_fact:
apiserver_sans: "{{ (sans_base + groups['kube-master'] + sans_lb + sans_lb_ip + sans_supp + sans_access_ip + sans_ip + sans_address) | unique }}"
apiserver_sans: "{{ (sans_base + groups['kube-master'] + sans_lb + sans_lb_ip + sans_supp + sans_access_ip + sans_ip + sans_address + sans_override) | unique }}"
vars:
sans_base:
- "kubernetes"
@ -71,6 +71,7 @@
sans_access_ip: "{{ groups['kube-master'] | map('extract', hostvars, 'access_ip') | list | select('defined') | list }}"
sans_ip: "{{ groups['kube-master'] | map('extract', hostvars, 'ip') | list | select('defined') | list }}"
sans_address: "{{ groups['kube-master'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | list | select('defined') | list }}"
sans_override: "{{ [kube_override_hostname] if kube_override_hostname is defined else [] }}"
tags: facts
- name: Create audit-policy directory

View file

@ -16,7 +16,7 @@ controlPlane:
advertiseAddress: {{ kube_apiserver_address }}
bindPort: {{ kube_apiserver_port }}
nodeRegistration:
name: {{ inventory_hostname }}
name: {{ kube_override_hostname|default(inventory_hostname) }}
{% if container_manager == 'crio' %}
criSocket: /var/run/crio/crio.sock
{% else %}