diff --git a/roles/kubernetes/kubeadm/tasks/kubeadm_etcd_node.yml b/roles/kubernetes/kubeadm/tasks/kubeadm_etcd_node.yml index f43d20165..ff959274d 100644 --- a/roles/kubernetes/kubeadm/tasks/kubeadm_etcd_node.yml +++ b/roles/kubernetes/kubeadm/tasks/kubeadm_etcd_node.yml @@ -3,8 +3,13 @@ command: >- {{ bin_dir }}/kubeadm init phase --config {{ kube_config_dir }}/kubeadm-config.yaml - upload-certs --experimental-upload-certs - {% if kubeadm_certificate_key is defined %} + upload-certs + {% if kubeadm_version is version('v1.15.0', '<') %} + --experimental-upload-certs + {% else %} + --upload-certs + {% endif %} + {% if kubeadm_certificate_key is defined and kubeadm_version is version('v1.15.0', '<') %} --certificate-key={{ kubeadm_certificate_key }} {% endif %} register: kubeadm_upload_cert diff --git a/roles/kubernetes/master/tasks/kubeadm-setup.yml b/roles/kubernetes/master/tasks/kubeadm-setup.yml index a932fa4c8..a6baac2a6 100644 --- a/roles/kubernetes/master/tasks/kubeadm-setup.yml +++ b/roles/kubernetes/master/tasks/kubeadm-setup.yml @@ -113,7 +113,7 @@ {% if kubeadm_version is version('v1.14.0', '>=') %} {% if kubeadm_version is version('v1.15.0', '<') %} --experimental-upload-certs - {% if kubeadm_certificate_key is defined %} + {% if kubeadm_certificate_key is defined and kubeadm_version is version('v1.15.0', '<') %} --certificate-key={{ kubeadm_certificate_key }} {% endif %} {% else %}