1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/cmd/cli/kubectl-kyverno/_testdata/exceptions/exception-and-policy.yaml

43 lines
855 B
YAML
Raw Normal View History

apiVersion: kyverno.io/v2
kind: PolicyException
metadata:
name: delta-exception
namespace: delta
spec:
exceptions:
- policyName: disallow-host-namespaces
ruleNames:
- host-namespaces
- autogen-host-namespaces
match:
any:
- resources:
kinds:
- Pod
- Deployment
namespaces:
- delta
names:
- important-tool*
---
apiVersion: kyverno.io/v1
kind: Policy
metadata:
name: require-ns-purpose-label
namespace: test
spec:
validationFailureAction: Enforce
rules:
- name: require-ns-purpose-label
match:
any:
- resources:
kinds:
- Namespace
validate:
message: "You must have label 'purpose' with value 'production' set on all new namespaces."
pattern:
metadata:
labels:
purpose: production