diff --git a/bootstrap/argocd-offline/README.md b/bootstrap/argocd-offline/README.md index 6f46102..2f72a4a 100644 --- a/bootstrap/argocd-offline/README.md +++ b/bootstrap/argocd-offline/README.md @@ -36,7 +36,13 @@ The script is idempotent. Before applying anything, it: 3. Verifies all three exact Harbor image references are in the local k3s image cache. 4. Records the existing Argo CD Applications. -It then applies the render, waits up to 300 seconds per workload, verifies the live pull policies, rejects image-pull failures, and confirms that pre-existing Applications remain present. +It then applies the render with Kubernetes Server-Side Apply and conflict resolution, waits up to 300 seconds per workload, verifies the live pull policies, rejects image-pull failures, and confirms that pre-existing Applications remain present. + +Server-Side Apply is required for Argo CD 3.3 and later because the ApplicationSet CRD exceeds Kubernetes' 262144-byte annotation limit for client-side apply. The flags match the official Argo CD install and upgrade procedure: + +```text +--server-side --force-conflicts +``` The script never pulls, retags, deletes, or garbage-collects images. If an image is missing, restore Harbor or deliberately import that exact image before retrying. diff --git a/bootstrap/argocd-offline/apply.sh b/bootstrap/argocd-offline/apply.sh index 232eff2..25019e8 100755 --- a/bootstrap/argocd-offline/apply.sh +++ b/bootstrap/argocd-offline/apply.sh @@ -61,7 +61,7 @@ else fi echo "Applying the verified manifest..." -k3s kubectl apply -f "$rendered_manifest" +k3s kubectl apply --server-side --force-conflicts -f "$rendered_manifest" while read -r resource _containers; do [[ -n "$resource" ]] || continue diff --git a/bootstrap/argocd-offline/verify-render.sh b/bootstrap/argocd-offline/verify-render.sh index 368dd3b..619da2c 100755 --- a/bootstrap/argocd-offline/verify-render.sh +++ b/bootstrap/argocd-offline/verify-render.sh @@ -32,7 +32,7 @@ while IFS= read -r actual_image; do "${expected_images[0]}"|"${expected_images[1]}"|"${expected_images[2]}") ;; *) fail "unexpected workload image in render: $actual_image" ;; esac -done < <(awk '$1 == "image:" {gsub(/\"/, "", $2); print $2}' "$rendered_manifest" | sort -u) +done < <(awk '$1 == "image:" {gsub(/"/, "", $2); print $2}' "$rendered_manifest" | sort -u) if grep -Eq 'image:[[:space:]]+(quay\.io|ghcr\.io|public\.ecr\.aws)/' "$rendered_manifest"; then fail "upstream image reference remains in render"