mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
32 lines
757 B
YAML
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"
|