会“帮助升级"重新启动PODS,即使它们不受升级影响? [英] WIll "helm upgrade" restart PODS even if they are not affected by upgrade?
问题描述
我的掌舵图有大约12个PODS.当我更改某些值后执行helm upgrade
时,除一个外,所有POD都将重新启动.
My helm chart has some 12 PODS. When I did helm upgrade
after changing some values all the PODs are restarted except for one.
我的问题是:
helm upgrade
即使不受升级影响,也会重新启动PODS吗?
Will helm upgrade
restart the PODS even if they are not affected by upgrade?
以其他方式放置:
helm upgrade
仅在POD受升级影响时重新启动POD吗?
Is it helm upgrade
restart PODs only if they are affected by upgrade?
推荐答案
就我而言,舵只重新启动受升级影响的吊舱
As far as I am concerned helm restart only the pods which are affected by upgrade
如果要重新启动所有Pod,可以使用--recreate-pods标志
If You want to restart ALL pods you can use --recreate-pods flag
-recreate-pods->如果适用,对资源执行Pod重新启动
--recreate-pods -> performs pods restart for the resource if applicable
例如,如果您有仪表盘图,则可以使用此命令重新启动每个吊舱.
For example if You have dashboard chart, You can use this command to restart every pod.
helm upgrade --recreate-pods -i k8s-dashboard stable/k8s-dashboard
存在一个 github问题,它为此提供了另一种解决方法
There is a github issue which provide another workaround for it
每次需要重新启动Pod时,请更改该注释的值.一个很好的注释可能是时间戳记
Every time you need to restart the pods, change the value of that annotation. A good annotation could be timestamp
首先,将注释添加到窗格中.如果您的图表属于Deployment类,则将注释添加到spec.template.metadata.annotations.例如:
First, add an annotation to the pod. If your chart is of kind Deployment, add annotation to spec.template.metadata.annotations. For example:
kind: Deployment
spec:
template:
metadata:
labels:
app: ecf-helm-satellite-qa
annotations:
timestamp: "{{ .Values.timestamp }}"
部署它.现在,每次在helm命令中设置时间戳记时. Kubernetes将在不停机的情况下推出新的更新.
Deploy that. Now, every time you set timestamp in helm command. Kubernetes will rollout a new update without downtime.
helm upgrade ecf-helm-satellite-qa . --set-string timestamp=a_random_value
这篇关于会“帮助升级"重新启动PODS,即使它们不受升级影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!