1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/Ingress/policy-ingress.yaml
2019-07-25 14:57:44 -04:00

32 lines
757 B
YAML

apiVersion: kyverno.io/v1alpha1
kind: Policy
metadata :
name : policy-ingress
spec :
rules:
- name: ingress1
match:
resources:
kinds :
- Ingress
selector:
matchLabels:
originalLabel: isHere
mutate:
patches:
- path: "/metadata/labels/isMutated"
op: add
value: "true"
- path : "/spec/rules/0/http/paths/0/path"
op : replace
value: "/mutatedpath"
validate:
message: "Ingress allowed only for prod services"
pattern:
spec:
rules:
- http:
paths:
- path: "*"
backend:
serviceName: "*prod"