Helm 升级不会拉新容器 [英] Helm upgrade doesn't pull new container
问题描述
我构建了一个简单的 NodeJS API,将 Docker 镜像推送到存储库,并使用 Helm 安装将其部署到我的 k8s(工作正常).
I Build a simple NodeJS API, pushed the Docker Image to a repo and deployed it to my k8s with Helm install (works perfectly fine).
pullPolicy 是 Always
.
The pullPolicy is Always
.
现在我想更新源代码并部署我的应用程序的更新版本.我修改了所有文件中的版本,构建并推送了新的 Docker 映像并尝试了 helm upgrade
但似乎什么也没发生.使用 helm list
我可以看到已部署修订版,但未部署对源代码的更改.watch kubectl get pods
还显示没有使用 kubectl --apply...
Now I want to update the source code and deploy the updated version of my app. I bumped the version in all files, built and pushed the new Docker image und tried helm upgrade
but it seems like nothing happened.
With helm list
I can see that revision was deployed but the changes to source code were not deployed.
watch kubectl get pods
also shows that no new pods were created the way you expect it with kubectl --apply...
我做错了什么?
推荐答案
Helm 仅在有更改要推出时才会推出对 kubernetes 对象的更改.如果您使用 :latest
则不会对部署文件应用任何更改,因此没有 Pod 将滚动更新.要继续使用 latest
,您需要添加一些内容(即带有 sha/version 的标签),这些内容会发生变化并导致部署由 helm 更新.还要记住,您通常还需要 ImagePullPolicy: Always
.
Helm will roll out changes to kubernetes objects only if there are changes to roll out. If you use :latest
there is no change to be applied to the deployment file, ergo no pods will rolling update. To keep using latest
, you need to add something (ie. label with sha / version) that will change and cause deployment to get updated by helm. Also keep in mind that you will usualy need ImagePullPolicy: Always
as well.
这篇关于Helm 升级不会拉新容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!