Interview Prep/GitOps & Argo CD/The Application CRD & Sync Policies

What does `CreateNamespace=true` do, and what does `managedNamespaceMetadata` add?

BeginnerConceptThe Application CRD & Sync Policies
Answer

CreateNamespace=true makes Argo CD create the destination namespace if it does not exist. managedNamespaceMetadata lets you set labels and annotations on that namespace (for example Pod Security Admission labels or a team label):

syncPolicy:
  syncOptions: [CreateNamespace=true]
  managedNamespaceMetadata:
    labels:
      pod-security.kubernetes.io/enforce: restricted

The project must allow the Namespace kind in clusterResourceWhitelist.

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

More on The Application CRD & Sync Policies