Skip to content

Commit

Permalink
Only pull images unless they are available locally
Browse files Browse the repository at this point in the history
Avoid excessive downloads and only pull images if needed. This makes the
rollout faster and also helps to reduce traffic when cronjobs are used.
  • Loading branch information
zonque committed Mar 29, 2024
1 parent 5f4a708 commit 4ee48e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/cuber/templates/deployment.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
containers:
- name: migration
image: <%= @options[:image] %>:<%= @options[:release] %>
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
<%- if @options[:buildpacks] -%>
command: ["launcher"]
args: <%= @options[:migrate][:cmd].shellsplit %>
Expand Down Expand Up @@ -152,7 +152,7 @@ spec:
containers:
- name: <%= procname %>-proc
image: <%= @options[:image] %>:<%= @options[:release] %>
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
<%- if @options[:buildpacks] -%>
command: ["launcher"]
args: <%= proc[:cmd].shellsplit %>
Expand Down Expand Up @@ -202,7 +202,7 @@ spec:
initContainers:
- name: migration-check
image: <%= @options[:image] %>:<%= @options[:release] %>
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
<%- if @options[:buildpacks] -%>
command: ["launcher"]
args: <%= @options[:migrate][:check].shellsplit %>
Expand Down Expand Up @@ -257,7 +257,7 @@ spec:
containers:
- name: task
image: <%= @options[:image] %>:<%= @options[:release] %>
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
<%- if @options[:buildpacks] -%>
command: ["launcher"]
args: <%= cron[:cmd].shellsplit %>
Expand Down
2 changes: 1 addition & 1 deletion lib/cuber/templates/pod.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
containers:
- name: pod-proc
image: <%= @options[:image] %>:<%= @options[:release] %>
imagePullPolicy: Always
imagePullPolicy: IfNotPresent
command: ["sleep", "infinity"]
envFrom:
- configMapRef:
Expand Down

0 comments on commit 4ee48e2

Please sign in to comment.