Skip to content

Commit

Permalink
Fix upgrade install fails after partial install
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Sep 16, 2022
1 parent d8de811 commit 4d279d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions addons/ekco/template/base/reboot/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ fi
export KUBECONFIG=/etc/kubernetes/kubelet.conf

# wait for Kubernetes API
master=$(cat /etc/kubernetes/kubelet.conf | grep ' server:' | awk '{ print $2 }')
master=$(grep ' server: ' /etc/kubernetes/kubelet.conf | awk '{ print $2 }' | sed 's/"//g')
while [ "$(curl --noproxy "*" -sk $master/healthz)" != "ok" ]; do
sleep 1
done

kubectl uncordon $(hostname | tr '[:upper:]' '[:lower:]')
kubectl uncordon "$(hostname | tr '[:upper:]' '[:lower:]')"
6 changes: 3 additions & 3 deletions scripts/common/kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ function kubernetes_has_remotes() {
return 1
}

# Fetch the load balancer endpoint from the cluster.
# Fetch the load balancer endpoint from the kubelet.conf.
function existing_kubernetes_api_address() {
kubectl get cm -n kube-system kurl-config -o jsonpath='{ .data.kubernetes_api_address }'
grep ' server: ' /etc/kubernetes/kubelet.conf | awk '{ print $2 }' | sed 's/"//g'
}

# During the upgrade user might change the load balancer endpoint or want to use EKCO internal load balancer. So, we
Expand All @@ -281,7 +281,7 @@ function kubernetes_api_address() {

addr=$(${DIR}/bin/kurl format-address ${addr})

echo "${addr}:${port}"
echo "https://${addr}:${port}"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/distro/kubeadm/distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,6 @@ EOF
}

function kubeadm_api_is_healthy() {
curl --globoff --noproxy "*" --fail --silent --insecure "https://$(kubernetes_api_address)/healthz" >/dev/null
curl --globoff --noproxy "*" --fail --silent --insecure "$(kubernetes_api_address)/healthz" >/dev/null
}

0 comments on commit 4d279d2

Please sign in to comment.