1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-01-20 18:52:16 +00:00
kyverno/test/best_practices/require_certain_labels.yaml

27 lines
575 B
YAML
Raw Normal View History

---
2020-11-11 20:17:48 -05:00
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-certain-labels
spec:
admission: true
background: true
2020-11-11 20:17:48 -05:00
rules:
- match:
any:
- resources:
kinds:
- Pod
name: validate-certain-labels
2020-11-11 20:17:48 -05:00
validate:
anyPattern:
- metadata:
labels:
app.kubernetes.io/name: ?*
2020-11-11 20:17:48 -05:00
- metadata:
labels:
app.kubernetes.io/component: ?*
message: The label `app.kubernetes.io/name` or `app.kubernetes.io/component`
is required.
validationFailureAction: Audit