mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-10 20:29:18 +03:00
Fix control plane setup without a hardcoded key (#4610)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
228b244c84
commit
d6d7458d68
@@ -25,6 +25,24 @@
|
||||
port: "{{kubeadm_discovery_address.split(':')[1]}}"
|
||||
timeout: 180
|
||||
|
||||
|
||||
- name: Upload certificates so they are fresh and not expired
|
||||
command: >-
|
||||
{{ bin_dir }}/kubeadm init phase
|
||||
--config {{ kube_config_dir}}/kubeadm-config.yaml
|
||||
upload-certs --experimental-upload-certs
|
||||
{% if kubeadm_certificate_key is defined %}
|
||||
--certificate-key={{ kubeadm_certificate_key }}
|
||||
{% endif %}
|
||||
run_once: yes
|
||||
register: kubeadm_upload_cert
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
|
||||
- name: Parse certificate key if not set
|
||||
set_fact:
|
||||
kubeadm_certificate_key: "{{ hostvars[groups['kube-master'][0]]['kubeadm_upload_cert'].stdout_lines[-1] | trim }}"
|
||||
when: kubeadm_certificate_key is undefined
|
||||
|
||||
- name: Joining control plane node to the cluster.
|
||||
command: >-
|
||||
{{ bin_dir }}/kubeadm join
|
||||
|
||||
Reference in New Issue
Block a user