fix: another argo migration fix

This commit is contained in:
Stefan Reimer 2025-03-24 22:10:29 +01:00
parent 68997b535d
commit bca7f5fd45
3 changed files with 8 additions and 12 deletions

View File

@ -1,7 +0,0 @@
spec:
syncWindows:
- kind: deny
schedule: '0 * * * *'
duration: 24h
namespaces:
- '*'

View File

@ -16,7 +16,10 @@ pre_control_plane_upgrade_cluster() {
post_control_plane_upgrade_cluster() {
# delete previous root app controlled by kubezero module
kubectl delete application kubezero-git-sync -n argocd || true
kubectl delete appproject kubezero -n argocd || true
# Patch appproject to keep SyncWindow in place
kubectl patch appproject kubezero -n argocd --type json -p='[{"op": "remove", "path": "/metadata/labels"}]' || true
kubectl patch appproject kubezero -n argocd --type json -p='[{"op": "remove", "path": "/metadata/annotations"}]' || true
}

View File

@ -20,13 +20,13 @@ echo "Checking that all pods in kube-system are running ..."
[ "$ARGOCD" == "true" ] && disable_argo
# Check if we already have all controllers on the current version
OLD_CONTROLLERS=$(kubectl get nodes -l "node-role.kubernetes.io/control-plane=" --no-headers=true | grep -cv $KUBE_VERSION || true)
#OLD_CONTROLLERS=$(kubectl get nodes -l "node-role.kubernetes.io/control-plane=" --no-headers=true | grep -cv $KUBE_VERSION || true)
# All controllers already on current version
if [ "$OLD_CONTROLLERS" == "0" ]; then
# All controllers already on current version
control_plane_upgrade finalize_cluster_upgrade
# Otherwise run control plane upgrade
else
# Otherwise run control plane upgrade
control_plane_upgrade kubeadm_upgrade
fi
@ -38,7 +38,7 @@ read -r
#[ "$ARGOCD" == "true" ] && kubectl edit app kubezero -n argocd || kubectl edit cm kubezero-values -n kubezero
# upgrade modules
control_plane_upgrade "apply_kubezero apply_network, apply_addons, apply_storage, apply_operators"
control_plane_upgrade "apply_kubezero, apply_network, apply_addons, apply_storage, apply_operators"
echo "Checking that all pods in kube-system are running ..."
waitSystemPodsRunning