头盔升级不会拉动新的容器 [英] Helm upgrade doesn't pull new container

查看:74
本文介绍了头盔升级不会拉动新的容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个简单的NodeJS API,将Docker Image推送到一个仓库中,并通过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的标签),这些内容将发生变化并导致部署通过头盔进行更新.另外请记住,您通常也需要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.

这篇关于头盔升级不会拉动新的容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆