mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 08:40:42 +00:00
Wait for service accounts in the kube-system namesapce
This commit is contained in:
parent
a267e04e54
commit
90e105521c
@ -141,16 +141,17 @@ for k,v in yaml.load(sys.stdin).iteritems():
|
||||
''' < "${kube_env_yaml}")
|
||||
fi
|
||||
|
||||
# Wait for the default service account
|
||||
# Create the namespace that will be used to host the cluster-level add-ons.
|
||||
start_addon /etc/kubernetes/addons/namespace.yaml 100 10 "" &
|
||||
|
||||
# Wait for the default service account to be created in the kube-system namespace.
|
||||
token_found=""
|
||||
while [ -z "${token_found}" ]; do
|
||||
sleep .5
|
||||
token_found=$(${KUBECTL} get serviceaccount default -o template -t "{{with index .secrets 0}}{{.name}}{{end}}" || true)
|
||||
token_found=$(${KUBECTL} get --namespace="${SYSTEM_NAMESPACE}" serviceaccount default -o template -t "{{with index .secrets 0}}{{.name}}{{end}}" || true)
|
||||
done
|
||||
|
||||
echo "== default service account has token ${token_found} =="
|
||||
|
||||
start_addon /etc/kubernetes/addons/namespace.yaml 100 10 "" &
|
||||
echo "== default service account in the ${SYSTEM_NAMESPACE} namespace has token ${token_found} =="
|
||||
|
||||
# Generate secrets for "internal service accounts".
|
||||
# TODO(etune): move to a completely yaml/object based
|
||||
|
Loading…
Reference in New Issue
Block a user