From 02ec72fa408b2f4e09480fe7e8c8226a6451d386 Mon Sep 17 00:00:00 2001 From: Remous-Aris Koutsiamanis <1357969+ariskou@users.noreply.github.com> Date: Mon, 5 Aug 2019 16:31:50 +0200 Subject: [PATCH] Fix commands for using experimental kubeadm control plane (#5006) --- roles/kubernetes/kubeadm/tasks/kubeadm_etcd_node.yml | 9 +++++++-- roles/kubernetes/master/tasks/kubeadm-setup.yml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) 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 %}