Skip to content

Commit 4ee48e2

Browse files
committed
Only pull images unless they are available locally
Avoid excessive downloads and only pull images if needed. This makes the rollout faster and also helps to reduce traffic when cronjobs are used.
1 parent 5f4a708 commit 4ee48e2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/cuber/templates/deployment.yml.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ spec:
100100
containers:
101101
- name: migration
102102
image: <%= @options[:image] %>:<%= @options[:release] %>
103-
imagePullPolicy: Always
103+
imagePullPolicy: IfNotPresent
104104
<%- if @options[:buildpacks] -%>
105105
command: ["launcher"]
106106
args: <%= @options[:migrate][:cmd].shellsplit %>
@@ -152,7 +152,7 @@ spec:
152152
containers:
153153
- name: <%= procname %>-proc
154154
image: <%= @options[:image] %>:<%= @options[:release] %>
155-
imagePullPolicy: Always
155+
imagePullPolicy: IfNotPresent
156156
<%- if @options[:buildpacks] -%>
157157
command: ["launcher"]
158158
args: <%= proc[:cmd].shellsplit %>
@@ -202,7 +202,7 @@ spec:
202202
initContainers:
203203
- name: migration-check
204204
image: <%= @options[:image] %>:<%= @options[:release] %>
205-
imagePullPolicy: Always
205+
imagePullPolicy: IfNotPresent
206206
<%- if @options[:buildpacks] -%>
207207
command: ["launcher"]
208208
args: <%= @options[:migrate][:check].shellsplit %>
@@ -257,7 +257,7 @@ spec:
257257
containers:
258258
- name: task
259259
image: <%= @options[:image] %>:<%= @options[:release] %>
260-
imagePullPolicy: Always
260+
imagePullPolicy: IfNotPresent
261261
<%- if @options[:buildpacks] -%>
262262
command: ["launcher"]
263263
args: <%= cron[:cmd].shellsplit %>

lib/cuber/templates/pod.yml.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
containers:
1212
- name: pod-proc
1313
image: <%= @options[:image] %>:<%= @options[:release] %>
14-
imagePullPolicy: Always
14+
imagePullPolicy: IfNotPresent
1515
command: ["sleep", "infinity"]
1616
envFrom:
1717
- configMapRef:

0 commit comments

Comments
 (0)