Fix developers kubeadm installation

Waiting for kube-apiserver is failing with not finding python
executable.

Change-Id: Ib0ff95088c658fec3180f071269041faa7da2ecf
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
This commit is contained in:
Andrii Ostapenko 2020-07-01 23:49:28 -05:00
parent 7cf8c6f893
commit b49541f300
No known key found for this signature in database
GPG Key ID: F3E83668DBB223B3
3 changed files with 3 additions and 3 deletions

View File

@ -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} \

View File

@ -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

View File

@ -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