Commit d73a75b4 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #47879 from madhusudancs/kubefed-rbac-discovery-script

Automatic merge from submit-queue Add a spin-loop that waits for RBAC API's availability. The very first thing that kubefed does when it comes up is run RBAC API discovery. We believe this sometimes fail on new clusters and as a result causes kubefed to assume that the RBAC API doesn't exist. Therefore, we are applying this workaround for now to ensure that the RBAC API is available before running kubefed. Issue: #47737 **Release note**: ```release-note NONE ``` /assign @csbell /cc @dchen1107 /sig federation
parents 83de1a01 0bf61789
...@@ -81,6 +81,18 @@ function init() { ...@@ -81,6 +81,18 @@ function init() {
kube::log::status "DNS_ZONE_NAME: \"${DNS_ZONE_NAME}\", DNS_PROVIDER: \"${DNS_PROVIDER}\"" kube::log::status "DNS_ZONE_NAME: \"${DNS_ZONE_NAME}\", DNS_PROVIDER: \"${DNS_PROVIDER}\""
kube::log::status "Image: \"${kube_registry}/hyperkube-amd64:${kube_version}\"" kube::log::status "Image: \"${kube_registry}/hyperkube-amd64:${kube_version}\""
# The very first thing that kubefed does when it comes up is run RBAC
# API discovery. We believe this sometimes fail on new clusters and as
# a result causes kubefed to assume that the RBAC API doesn't exist.
# Therefore, we are applying this workaround for now to ensure that the
# RBAC API is available before running kubefed.
timeout 1m bash <<EOF
while [[ ! "$(${KUBE_ROOT}/cluster/kubectl.sh api-versions)" =~ "rbac.authorization.k8s.io/" ]]; do
kube::log::status "Waiting for rbac.authorization.k8s.io API group to appear"
sleep 2
done
EOF
# Send INT after 20m and KILL 1m after that if process is still alive. # Send INT after 20m and KILL 1m after that if process is still alive.
timeout --signal=INT --kill-after=1m 20m \ timeout --signal=INT --kill-after=1m 20m \
"${KUBE_ROOT}/federation/develop/kubefed.sh" init \ "${KUBE_ROOT}/federation/develop/kubefed.sh" init \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment