Skip to content

Instantly share code, notes, and snippets.

@bharatmicrosystems
Created October 30, 2020 08:23
Show Gist options
  • Save bharatmicrosystems/635dc84688d29ec76226103299f806df to your computer and use it in GitHub Desktop.
Save bharatmicrosystems/635dc84688d29ec76226103299f806df to your computer and use it in GitHub Desktop.
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-app-label
spec:
validationFailureAction: enforce
rules:
- name: check-for-app-label
match:
resources:
kinds:
- Pod
validate:
message: "label `app` is required"
pattern:
metadata:
labels:
app: "?*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment