From b49541f3006d9f1ef10d8221ec492a331ea01270 Mon Sep 17 00:00:00 2001 From: Andrii Ostapenko Date: Wed, 1 Jul 2020 23:49:28 -0500 Subject: [PATCH] Fix developers kubeadm installation Waiting for kube-apiserver is failing with not finding python executable. Change-Id: Ib0ff95088c658fec3180f071269041faa7da2ecf Signed-off-by: Andrii Ostapenko --- tools/images/kubeadm-aio/assets/entrypoint.sh | 2 +- .../playbooks/roles/deploy-kubeadm-master/tasks/helm-cni.yaml | 2 +- .../opt/playbooks/roles/deploy-kubeadm-master/tasks/main.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/images/kubeadm-aio/assets/entrypoint.sh b/tools/images/kubeadm-aio/assets/entrypoint.sh index 7d518bfeb..47f916fbb 100755 --- a/tools/images/kubeadm-aio/assets/entrypoint.sh +++ b/tools/images/kubeadm-aio/assets/entrypoint.sh @@ -17,7 +17,7 @@ if [ "x${ACTION}" == "xgenerate-join-cmd" ]; then : ${TTL:="10m"} DISCOVERY_TOKEN="$(kubeadm token --kubeconfig /etc/kubernetes/admin.conf create --ttl ${TTL} --usages signing,authentication --groups '')" DISCOVERY_TOKEN_CA_HASH="$(openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* /sha256:/')" -API_SERVER=$(cat /etc/kubernetes/admin.conf | python -c "import sys, yaml; print(yaml.safe_load(sys.stdin)['clusters'][0]['cluster']['server'].split(\"//\",1).pop())") +API_SERVER=$(cat /etc/kubernetes/admin.conf | python3 -c "import sys, yaml; print(yaml.safe_load(sys.stdin)['clusters'][0]['cluster']['server'].split(\"//\",1).pop())") exec echo "kubeadm join \ --token ${DISCOVERY_TOKEN} \ --discovery-token-ca-cert-hash ${DISCOVERY_TOKEN_CA_HASH} \ diff --git a/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/helm-cni.yaml b/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/helm-cni.yaml index 872de3b7f..fe101e641 100644 --- a/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/helm-cni.yaml +++ b/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/helm-cni.yaml @@ -90,7 +90,7 @@ dest: /etc/kubernetes/pki/calico/certs.py - name: Create yaml file - shell: python /etc/kubernetes/pki/calico/certs.py + shell: python3 /etc/kubernetes/pki/calico/certs.py args: executable: /bin/bash chdir: /etc/kubernetes/pki/calico diff --git a/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/main.yaml b/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/main.yaml index 2e28cb7a1..e507f7e70 100644 --- a/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/main.yaml +++ b/tools/images/kubeadm-aio/assets/opt/playbooks/roles/deploy-kubeadm-master/tasks/main.yaml @@ -94,7 +94,7 @@ delegate_to: 127.0.0.1 block: - name: wait for kube api - shell: python /usr/bin/test-kube-api.py + shell: python3 /usr/bin/test-kube-api.py register: task_result until: task_result.rc == 0 retries: 120