我一直在尝试创建自定义头盔图表,但是无论我将什么图像添加到图表中,我都会得到ErrImagePull,我可以非常轻松地重新创建它:
# This works on all POSIX-family shells, and also some non-POSIX shells like zsh
if [ -n "$FOO" ]; then
(使用默认的nginx docker映像):
helm create my-chart
更改其他图片(nginx-> ubuntu)的values.yaml:
helm install my-chart .
NAME: my-chart
LAST DEPLOYED: Fri Jan 17 12:26:13 2020
NAMESPACE: example
STATUS: deployed
REVISION: 1
NOTES:
更新头盔部署:
7 image:
8 repository: ubuntu
9 pullPolicy: IfNotPresent
Pod状态:
helm upgrade my-chart .
Release "my-chart" has been upgraded. Happy Helming!
NAME: my-chart
LAST DEPLOYED: Fri Jan 17 12:30:13 2020
NAMESPACE: example
STATUS: deployed
REVISION: 2
NOTES:
描述豆荚:
kubectl get pods
NAME READY STATUS RESTARTS AGE
my-chart-54fb9969dd-gnpt9 0/1 ImagePullBackOff 0 32s
my-chart-56485d7b7-hc25q 1/1 Running 0 4m32s
答案 0 :(得分:0)
此问题是由于头盔模板默认使用chart.appversion
造成的。image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
当您helm create my-chart
进入Deployments.yaml并更改image:部分以使用tag变量,然后从values.yaml中添加以下内容:
8 repository: ubuntu
9 tag: latest
10 pullPolicy: IfNotPresent