Skip to content

Commit

Permalink
review feedback - remove unused kube-proxy and cni logic from kind-up…
Browse files Browse the repository at this point in the history
…grade.sh script
  • Loading branch information
aaron-prindle committed Feb 10, 2025
1 parent 636c64d commit 2b7631f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ run_tests() {
}

upgrade_cluster_components() {
# upgrade cluster components excluding kube-proxy and kubelet
# upgrade cluster components excluding the kubelet

# Get the retry attempts, defaulting to 5 if not set
RETRY_ATTEMPTS="${RETRY_ATTEMPTS:-5}"
Expand All @@ -292,8 +292,8 @@ upgrade_cluster_components() {
local success=false

echo "Attempt $attempt of $RETRY_ATTEMPTS to upgrade cluster..."
bash -x "${UPGRADE_SCRIPT}" --no-kproxy --no-kubelet | tee "${ARTIFACTS}/upgrade-output-1.txt"
bash -x "${UPGRADE_SCRIPT}" --no-kproxy --no-kubelet | tee "${ARTIFACTS}/upgrade-output-2.txt"
bash -x "${UPGRADE_SCRIPT}" --no-kubelet | tee "${ARTIFACTS}/upgrade-output-1.txt"
bash -x "${UPGRADE_SCRIPT}" --no-kubelet | tee "${ARTIFACTS}/upgrade-output-2.txt"
# Run the script twice, is necessary for fully updating the binaries

while [ "$attempt" -le "$RETRY_ATTEMPTS" ]; do
Expand Down
38 changes: 2 additions & 36 deletions experiment/compatibility-versions/kind-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,6 @@ update_kubelet() {
done
}

update_kube_proxy() {
for n in $NODES; do
kind load image-archive ${IMAGES_PATH}/kube-proxy.tar --name ${CLUSTER_NAME}
done
# RollingUpdate
kubectl set image ds/kube-proxy kube-proxy=${DOCKER_REGISTRY}/kube-proxy-amd64:${DOCKER_TAG} -n kube-system
kubectl rollout status ds/kube-proxy -n kube-system -w
echo "Updated kube-proxy"
}

update_cni() {
for n in $NODES; do
kind load image-archive ${CNI_IMAGE} --name ${CLUSTER_NAME}
done
# RollingUpdate
kubectl set image ds/kindnet kindnet-cni=${CNI_IMAGE} -n kube-system
kubectl rollout status ds/kindnet -n kube-system -w
echo "Updated kindnet"
}

update_control_plane(){
# TODO allow to configure node and control plane components
for n in $CONTROL_PLANE_NODES; do
Expand All @@ -68,8 +48,8 @@ update_control_plane(){

usage()
{
echo "usage: kind_upgrade.sh [-n|--name <cluster_name>] [--cni <cni_image>]"
echo " [--no-kproxy] [--no-control-plane] [--no-kubelet]"
echo "usage: kind_upgrade.sh [-n|--name <cluster_name>]"
echo " [--no-control-plane] [--no-kubelet]"
echo ""
}

Expand All @@ -80,11 +60,6 @@ parse_args()
-n | --name ) shift
CLUSTER_NAME=$1
;;
--cni-image ) shift
CNI_IMAGE=$1
;;
--no-kproxy ) UPDATE_KUBE_PROXY=false
;;
--no-kubelet ) UPDATE_KUBELET=false
;;
--no-control-plane ) UPDATE_CONTROL_PLANE=false
Expand Down Expand Up @@ -139,15 +114,6 @@ if [[ "$UPDATE_KUBELET" == "true" ]]; then
update_kubelet
fi

if [[ "$UPDATE_KUBE_PROXY" == "true" ]]; then
update_kube_proxy
fi

# If CNI_IMAGE set update the CNI
if [[ ! -z ${CNI_IMAGE} ]]; then
update_cni
fi

if kubectl get nodes | grep NoReady; then
echo "Error: KIND cluster $CLUSTER_NAME NOT READY"
exit 1
Expand Down

0 comments on commit 2b7631f

Please sign in to comment.