1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/examples/policy_mutate_imagePullPolicy.yaml
2019-08-21 16:34:17 -07:00

28 lines
635 B
YAML

apiVersion : kyverno.io/v1alpha1
kind: Policy
metadata:
name: image-pull-policy
spec:
rules:
- name: image-pull-policy
match:
resources:
kinds:
- Deployment
selector:
matchLabels:
app : nginxlatest
exclude:
resources:
kinds:
- DaemonSet
mutate:
overlay:
spec:
template:
spec:
containers:
# select images which end with :latest
- (image): "*latest"
# require that the imagePullPolicy is "IfNotPresent"
imagePullPolicy: IfNotPresent