Skip to content

Commit

Permalink
Fix: check kube-proxy's 10256 port healthz
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyanker committed Jan 30, 2021
1 parent 0ccca06 commit 74fa772
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
10 changes: 9 additions & 1 deletion dist/images/install-pre-1.16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ diagnose(){
kubectl ko nbctl list acl
kubectl ko sbctl show
checkDaemonSet kube-proxy
checkKubeProxy
checkDeployment ovn-central
checkDeployment kube-ovn-controller
checkDaemonSet kube-ovn-cni
Expand Down Expand Up @@ -2083,6 +2083,14 @@ checkDaemonSet(){
fi
}
checkKubeProxy(){
healthResult=`kubectl get node -o wide | grep -v "INTERNAL-IP" | awk '{printf "curl -sL -w %{http_code} http://%s:10256/healthz -o /dev/null | grep -v 200 \n", $6}' | bash` || true
if [ -n "$healthResult" ]; then
echo "kube-proxy's health check failed"
exit 1
fi
}
checkDeployment(){
name="$1"
ready=$(kubectl get deployment -n $KUBE_OVN_NS "$name" -o jsonpath={.status.readyReplicas})
Expand Down
10 changes: 9 additions & 1 deletion dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ diagnose(){
kubectl ko nbctl list acl
kubectl ko sbctl show
checkDaemonSet kube-proxy
checkKubeProxy
checkDeployment ovn-central
checkDeployment kube-ovn-controller
checkDaemonSet kube-ovn-cni
Expand Down Expand Up @@ -2135,6 +2135,14 @@ checkDeployment(){
fi
}
checkKubeProxy(){
healthResult=`kubectl get node -o wide | grep -v "INTERNAL-IP" | awk '{printf "curl -sL -w %{http_code} http://%s:10256/healthz -o /dev/null | grep -v 200 \n", $6}' | bash` || true
if [ -n "$healthResult" ]; then
echo "kube-proxy's health check failed"
exit 1
fi
}
if [ $# -lt 1 ]; then
showHelp
exit 0
Expand Down
10 changes: 9 additions & 1 deletion dist/images/kubectl-ko
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ diagnose(){
kubectl ko nbctl list acl
kubectl ko sbctl show

checkDaemonSet kube-proxy
checkKubeProxy
checkDeployment ovn-central
checkDeployment kube-ovn-controller
checkDaemonSet kube-ovn-cni
Expand Down Expand Up @@ -263,6 +263,14 @@ checkDeployment(){
fi
}

checkKubeProxy(){
healthResult=`kubectl get node -o wide | grep -v "INTERNAL-IP" | awk '{printf "curl -sL -w %{http_code} http://%s:10256/healthz -o /dev/null | grep -v 200 \n", $6}' | bash` || true
if [ -n "$healthResult" ]; then
echo "kube-proxy's health check failed"
exit 1
fi
}

if [ $# -lt 1 ]; then
showHelp
exit 0
Expand Down

0 comments on commit 74fa772

Please sign in to comment.