#!/bin/bash -e #VERSION="v1.23.10-3" VERSION="latest" SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) . $SCRIPT_DIR/libhelm.sh [ -n "$DEBUG" ] && set -x all_nodes_upgrade() { CMD="$1" echo "Deploy all node upgrade daemonSet(busybox)" cat </dev/null while true; do kubectl logs kubezero-upgrade -n kube-system -f 2>/dev/null && break sleep 3 done kubectl delete pod kubezero-upgrade -n kube-system } argo_used && disable_argo all_nodes_upgrade "mount --make-shared /host/sys/fs/cgroup; mount --make-shared /host/sys;" control_plane_upgrade kubeadm_upgrade #echo "Adjust kubezero-values CM !!" #read kubectl delete ds kube-multus-ds -n kube-system control_plane_upgrade "apply_network, apply_addons" kubectl rollout restart daemonset/calico-node -n kube-system kubectl rollout restart daemonset/cilium -n kube-system kubectl rollout restart daemonset/kube-multus-ds -n kube-system argo_used && enable_argo # Final step is to commit the new argocd kubezero app kubectl get app kubezero -n argocd -o yaml | yq 'del(.status) | del(.metadata) | .metadata.name="kubezero" | .metadata.namespace="argocd"' | yq 'sort_keys(..) | .spec.source.helm.values |= (from_yaml | to_yaml)' > /tmp/new-kubezero-argoapp.yaml echo "Please commit /tmp/new-kubezero-argoapp.yaml as the updated kubezero/application.yaml for your cluster!" echo "Then head over to ArgoCD for this cluster and sync all KubeZero modules to apply remaining upgrades."