1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-12 19:06:55 +00:00
kyverno/examples/StatefulSet/policy-StatefulSet.yaml

25 lines
621 B
YAML
Raw Normal View History

apiVersion : policy.nirmata.io/v1alpha1
kind : Policy
metadata :
name : policy-statefulset
spec :
failurePolicy: stopOnError
rules:
- resource:
kind : StatefulSet
selector:
matchLabels:
originalLabel: isHere
patch:
- path: "/spec/template/metadata/labels/isMutated"
op: add
value: "true"
- path: "/metadata/labels/isMutated"
op: add
value: "true"
- path : "/metadata/labels/originalLabel"
op : remove
- path : "/spec/serviceName"
op : replace
value : "not-a-nginx"