2019-05-21 18:38:52 -07:00
|
|
|
apiVersion : kyverno.io/v1alpha1
|
2019-05-21 17:56:59 +03:00
|
|
|
kind : Policy
|
|
|
|
metadata :
|
|
|
|
name : policy-endpoints
|
|
|
|
spec :
|
|
|
|
rules:
|
2019-05-21 18:38:52 -07:00
|
|
|
- name: pEP
|
2019-05-21 17:56:59 +03:00
|
|
|
resource:
|
|
|
|
kind : Endpoints
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
label : test
|
|
|
|
mutate:
|
|
|
|
patches:
|
|
|
|
- path : "/subsets/0/ports/0/port"
|
|
|
|
op : replace
|
|
|
|
value: 9663
|
|
|
|
- path : "/subsets/0"
|
|
|
|
op: add
|
|
|
|
value:
|
|
|
|
addresses:
|
2019-05-21 18:38:52 -07:00
|
|
|
- ip: "192.168.10.172"
|
2019-05-21 17:56:59 +03:00
|
|
|
ports:
|
|
|
|
- name: load-balancer-connection
|
|
|
|
port: 80
|
|
|
|
protocol: UDP
|
|
|
|
validate:
|
|
|
|
message: "This resource has wrong IP"
|
|
|
|
pattern:
|
|
|
|
subsets:
|
|
|
|
- addresses:
|
|
|
|
- ip: "192.168.10.171|192.168.10.172"
|