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:
parent
7cf8c6f893
commit
b49541f300
@ -17,7 +17,7 @@ if [ "x${ACTION}" == "xgenerate-join-cmd" ]; then
|
|||||||
: ${TTL:="10m"}
|
: ${TTL:="10m"}
|
||||||
DISCOVERY_TOKEN="$(kubeadm token --kubeconfig /etc/kubernetes/admin.conf create --ttl ${TTL} --usages signing,authentication --groups '')"
|
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:/')"
|
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 \
|
exec echo "kubeadm join \
|
||||||
--token ${DISCOVERY_TOKEN} \
|
--token ${DISCOVERY_TOKEN} \
|
||||||
--discovery-token-ca-cert-hash ${DISCOVERY_TOKEN_CA_HASH} \
|
--discovery-token-ca-cert-hash ${DISCOVERY_TOKEN_CA_HASH} \
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
dest: /etc/kubernetes/pki/calico/certs.py
|
dest: /etc/kubernetes/pki/calico/certs.py
|
||||||
|
|
||||||
- name: Create yaml file
|
- name: Create yaml file
|
||||||
shell: python /etc/kubernetes/pki/calico/certs.py
|
shell: python3 /etc/kubernetes/pki/calico/certs.py
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
chdir: /etc/kubernetes/pki/calico
|
chdir: /etc/kubernetes/pki/calico
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
delegate_to: 127.0.0.1
|
delegate_to: 127.0.0.1
|
||||||
block:
|
block:
|
||||||
- name: wait for kube api
|
- name: wait for kube api
|
||||||
shell: python /usr/bin/test-kube-api.py
|
shell: python3 /usr/bin/test-kube-api.py
|
||||||
register: task_result
|
register: task_result
|
||||||
until: task_result.rc == 0
|
until: task_result.rc == 0
|
||||||
retries: 120
|
retries: 120
|
||||||
|
Loading…
Reference in New Issue
Block a user