Fix etcd race condition issue
Currently, Magnum is using k8s API /version to check the API availibility which is not a good way because /version only reflects if the basic k8s api is working on not. And it will return response even the etcd service is down. This patch fixes it by using /healthz to replace /version. Task: 22566 Story: 1775759 Change-Id: I45a1bd48a22842a251dafa6c349f0022fd319e3f
This commit is contained in:
parent
9375dc2ae5
commit
f6d1c0de46
@ -456,7 +456,7 @@ if [ "$MASTER_INDEX" != "0" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
until curl -sf "http://127.0.0.1:8080/healthz"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -255,7 +255,7 @@ if [ "$MASTER_INDEX" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
until curl --silent "http://127.0.0.1:8080/version"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
@ -121,7 +121,7 @@ fi
|
|||||||
|
|
||||||
# Binary for ingress traefik
|
# Binary for ingress traefik
|
||||||
INGRESS_TRAEFIK_BIN_CONTENT='''#!/bin/sh
|
INGRESS_TRAEFIK_BIN_CONTENT='''#!/bin/sh
|
||||||
until curl -sf "http://127.0.0.1:8080/healthz"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -369,7 +369,7 @@ GRAFANA_DEF_DASHBOARD_FILE=$GRAFANA_DEF_DASHBOARDS"/default.json"
|
|||||||
|
|
||||||
# Write the binary for enable-monitoring
|
# Write the binary for enable-monitoring
|
||||||
KUBE_MON_BIN_CONTENT='''#!/bin/sh
|
KUBE_MON_BIN_CONTENT='''#!/bin/sh
|
||||||
until curl -sf "http://127.0.0.1:8080/healthz"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -12,7 +12,7 @@ if [ "$MASTER_INDEX" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
until curl --silent "http://127.0.0.1:8080/version"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
@ -335,8 +335,14 @@ spec:
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "$MASTER_INDEX" != "0" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
until curl --silent "http://127.0.0.1:8080/version"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
@ -459,7 +465,7 @@ if [ "$MASTER_INDEX" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
until curl --silent "http://127.0.0.1:8080/version"
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
do
|
do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
@ -13,7 +13,8 @@ WC_NOTIFY_SERVICE=/etc/systemd/system/wc-notify.service
|
|||||||
|
|
||||||
cat > $WC_NOTIFY_BIN <<EOF
|
cat > $WC_NOTIFY_BIN <<EOF
|
||||||
#!/bin/bash -v
|
#!/bin/bash -v
|
||||||
until curl -sf "http://127.0.0.1:8080/healthz"; do
|
until [ "ok" = "$(curl --silent http://127.0.0.1:8080/healthz)" ]
|
||||||
|
do
|
||||||
echo "Waiting for Kubernetes API..."
|
echo "Waiting for Kubernetes API..."
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
@ -23,8 +24,8 @@ EOF
|
|||||||
cat > $WC_NOTIFY_SERVICE <<EOF
|
cat > $WC_NOTIFY_SERVICE <<EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Notify Heat
|
Description=Notify Heat
|
||||||
After=docker.service etcd.service
|
After=docker.service
|
||||||
Requires=docker.service etcd.service
|
Requires=docker.service
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=$WC_NOTIFY_BIN
|
ExecStart=$WC_NOTIFY_BIN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user