Interview Prep/GitOps & Argo CD/Sync Operations, Hooks & Health

Sync of a large CRD fails with `metadata.annotations: Too long: must have at most 262144 bytes`.

BeginnerTroubleshootingSync Operations, Hooks & Health
Answer

Likely causes → Client-side apply stores the full object in the kubectl.kubernetes.io/last-applied-configuration annotation, which exceeds 256 KiB for big CRDs (Prometheus Operator, Crossplane, Argo's own).

Diagnose → The failing resource is almost always a CRD or a large ConfigMap.

Fix → Enable server-side apply for the app or that resource:

syncPolicy:
  syncOptions:
    - ServerSideApply=true

Replace=true also works but recreates the object.

Prevent → Default to ServerSideApply=true for apps that ship CRDs.

All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on Sync Operations, Hooks & Health