1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00
kyverno/examples/CLI/deployment/policy-deployment.yaml
2019-05-22 20:02:19 -07:00

30 lines
744 B
YAML

apiVersion : kubepolicy.nirmata.io/v1alpha1
kind : Policy
metadata :
name : policy-deployment
spec :
rules:
- name: deployment-policy
resource:
kind : Deployment
selector :
matchLabels :
cli: test
mutate:
patches:
- path: /metadata/labels/isMutated
op: add
value: "true"
- path: /metadata/labels/app
op: replace
value: "nginx_is_mutated"
validate:
message: "The imagePullPolicy must be Always when :latest is used as a tag"
pattern:
spec:
template:
spec:
containers:
- (name): "*:latest"
imagePullPolicy: Always