mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 17:37:12 +00:00
33 lines
782 B
YAML
33 lines
782 B
YAML
|
apiVersion : kubepolicy.nirmata.io/v1alpha1
|
||
|
kind : Policy
|
||
|
metadata :
|
||
|
name : policy-endpoints
|
||
|
spec :
|
||
|
rules:
|
||
|
- name:
|
||
|
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:
|
||
|
- ip: "192.168.10.171"
|
||
|
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"
|