A namespace exemption keeps selected Kubernetes resources out of Gatekeeper policy processing. It is useful when a cluster-wide constraint would block legitimate system Pods: a privileged-container policy, for example, could prevent kube-proxy or a networking agent from starting. section 13.4.1
Choose the narrowest exemption that permits the workload:
- For Gatekeeper-wide processing, use a Config object to name excluded namespaces. Set processes to * to exclude them from all processing, or select audit, webhook, or sync individually. section 13.4.1
- To exclude namespaces from a particular constraint, place excludedNamespaces in that constraint’s match configuration. section 13.4.1
Table 13.2 Namespace exemption options (view table figure)
Compare the process options before configuring an exemption: excluding audit results does not also exclude admission-webhook or sync processing. section 13.4.1
apiVersion: config.gatekeeper.sh/v1alpha1
kind: Config
metadata:
name: config
namespace: "gatekeeper-system"
spec:
match:
- excludedNamespaces: ["kube-system", "gatekeeper-system"]
processes: ["*"]
This Config exempts kube-system and gatekeeper-system from every Gatekeeper process with processes: ["*"]. section 13.4.1
