dev/scripts, deploy, chart/templates: change imagePullPolicy to IfNotPresent for manager, ui, driver deployer. Also add a bash script to update the image pull policy to be Always
We changed the imagePullPolicy to IfNotPresent so that user can easily install Longhorn in air-gap instalation. Also add a bash script for the developer to quickly change all the imagePullPolicies back to Always so that k8s always pull the lastest images. This will be useful when dev use the tag such as master. Longhorn #1491 Signed-off-by: Phan Le <phan.le@rancher.com>
This commit is contained in:
parent
063db2bc5d
commit
1a58855f0d
@ -17,7 +17,7 @@ spec:
|
||||
containers:
|
||||
- name: longhorn-manager
|
||||
image: "{{ .Values.image.longhorn.manager }}:{{ .Values.image.longhorn.managerTag }}"
|
||||
imagePullPolicy: Always
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
privileged: true
|
||||
command:
|
||||
|
@ -20,7 +20,7 @@ spec:
|
||||
containers:
|
||||
- name: longhorn-driver-deployer
|
||||
image: {{ printf "%s:%s" .Values.image.longhorn.manager .Values.image.longhorn.managerTag | quote }}
|
||||
imagePullPolicy: Always
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- longhorn-manager
|
||||
- -d
|
||||
|
@ -18,7 +18,7 @@ spec:
|
||||
containers:
|
||||
- name: longhorn-ui
|
||||
image: "{{ .Values.image.longhorn.ui }}:{{ .Values.image.longhorn.uiTag }}"
|
||||
imagePullPolicy: Always
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
ports:
|
||||
|
35
dev/scripts/update-image-pull-policy.sh
Executable file
35
dev/scripts/update-image-pull-policy.sh
Executable file
@ -0,0 +1,35 @@
|
||||
echo "Update imagePullPolicy to be Always for manager, UI, driver deployer, engine image"
|
||||
|
||||
# Update imagePullPolicy for Longhorn manager daemonset
|
||||
kubectl patch daemonset longhorn-manager -n longhorn-system -p \
|
||||
'{"spec":{"template":{"spec":{"containers":[{"name":"longhorn-manager", "imagePullPolicy":"Always"}]}}}}'
|
||||
sleep 5
|
||||
|
||||
# Update imagePullPolicy for Longhorn UI deployment
|
||||
kubectl patch deployment longhorn-ui -n longhorn-system -p \
|
||||
'{"spec":{"template":{"spec":{"containers":[{"name":"longhorn-ui", "imagePullPolicy":"Always"}]}}}}'
|
||||
sleep 5
|
||||
|
||||
# Update imagePullPolicy for Longhorn Driver Deployer deployment
|
||||
kubectl patch deployment longhorn-driver-deployer -n longhorn-system -p \
|
||||
'{"spec":{"template":{"spec":{"containers":[{"name":"longhorn-driver-deployer", "imagePullPolicy":"Always"}]}}}}'
|
||||
sleep 1
|
||||
echo "wait 15s to make sure that the updated longhorn manager pods come up ..."
|
||||
sleep 15
|
||||
|
||||
# Update all imagePullPolicy for Longhorn Engine Image Daemonsets
|
||||
temp_file='./.engine-image-daemon-list'
|
||||
kubectl get daemonsets -n longhorn-system | grep -oE "engine-image-ei-.{8}" > ${temp_file}
|
||||
|
||||
while IFS= read -r line
|
||||
do
|
||||
kubectl patch daemonset ${line} -n longhorn-system -p \
|
||||
"{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"${line}\", \"imagePullPolicy\":\"Always\"}]}}}}"
|
||||
sleep 5
|
||||
done < ${temp_file}
|
||||
|
||||
rm ${temp_file}
|
||||
|
||||
echo "Warning: Make sure check and wait for all pods running again!"
|
||||
echo "Current status: (Ctl+c to exit)"
|
||||
kubectl get pods -w -n longhorn-system
|
Loading…
Reference in New Issue
Block a user