Skip to content

Instantly share code, notes, and snippets.

@ShubhanjanMedhi-dev
Created July 22, 2021 09:54
Show Gist options
  • Save ShubhanjanMedhi-dev/4c46484c0b4ad7a8524ecd617dfef3b1 to your computer and use it in GitHub Desktop.
Save ShubhanjanMedhi-dev/4c46484c0b4ad7a8524ecd617dfef3b1 to your computer and use it in GitHub Desktop.
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-deployment-label
spec:
validationFailureAction: enforce
rules:
- name: require-deployment-label
match:
resources:
kinds:
- Deployment
validate:
message: "Every Deployment object must contain the `company` label."
pattern:
metadata:
labels:
company: squadcast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment