1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 01:16:55 +00:00
kyverno/test/Service/policy-service.yaml
Anton Kostenko 2997a5139b updated policies
updated policies according to new policy structure for testing
2019-05-21 17:56:59 +03:00

31 lines
766 B
YAML

apiVersion : kubepolicy.nirmata.io/v1alpha1
kind : Policy
metadata :
name : policy-service
spec :
rules:
- name: ps1
resource:
kind: Service
name: "game-service*"
mutate:
patches:
- path: "/metadata/labels/isMutated"
op: add
value: "true"
- path : "/metadata/labels/secretLabel"
op : replace
value : "weKnow"
- path : "/metadata/labels/originalLabel"
op : remove
- path: "/spec/selector/app"
op: replace
value: "mutedApp"
validate:
message: "This service has wrong port"
pattern:
spec:
ports:
- name: "http"
protocol: TCP
port: 80|8080