1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/test/PersistentVolumeClaim/policy-PVC.yaml

25 lines
565 B
YAML
Raw Normal View History

apiVersion: kubepolicy.nirmata.io/v1alpha1
kind: Policy
metadata:
name: policy-pvc
spec:
rules:
- name: pvc1
resource:
kind : PersistentVolumeClaim
matchLabels:
originalLabel: isHere
mutate:
patches:
- path: "/metadata/labels/originalLabel"
op: remove
- path : "/spec/resources/requests/storage"
op : replace
value: "6Gi"
validate:
message: "I don't like this pvc"
pattern:
spec:
accessModes:
- ReadWrite