Interview Prep/DevSecOps/Kubernetes admission control and Pod Security

A namespace label `pod-security.kubernetes.io/enforce=baseline` is silently removed after every Argo CD sync

IntermediateTroubleshootingKubernetes admission control and Pod Security
Answer

Likely causes → The Namespace is managed in Git without the label (or created via CreateNamespace=true without managedNamespaceMetadata), so sync reverts manual labels.

Diagnose → argocd app diff <app> shows the label removal.

Fix → Put PSA labels in the Namespace manifest in Git, or in syncPolicy.managedNamespaceMetadata.labels.

Prevent → No manual security labels; enforce namespace labels with a policy that requires them.

All DevSecOps questions Roadmap: Policy as code

More on Kubernetes admission control and Pod Security