简体   繁体   English

禁用特定 statefulset 模板的 helm 升级

[英]disable helm upgrade for particular statefulset template

i have a helm chart having multiple StatefulSet templates.我有一个包含多个 StatefulSet 模板的掌舵图。
i want one of the template to be deployed only during helm install我希望仅在helm install期间部署模板之一
and it should not teminate when doing helm upgrade .并且在进行helm upgrade时不应终止。

{{- if .Release.IsInstall -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
.....
.....
{{- end -}}  

as you can see i want this sts to be deployed only during installation and also如您所见,我希望仅在安装期间部署此sts ,并且
i want it to be unaffected(not terminated) when during helm upgrade我希望它在helm upgrade期间不受影响(不终止)

after doing through helm documentation, it provides solution using helm hooks在完成 helm 文档后,它提供了使用 helm hooks 的解决方案

"helm.sh/hook": pre-install
"helm.sh/hook-weight": "-10"  

https://helm.sh/docs/topics/charts_hooks/#:~:text=Description-,pre%2Dinstall,-Executes%20after%20templates https://helm.sh/docs/topics/charts_hooks/#:~:text=Description-,pre%2Dinstall,-Executes%20after%20templates

You can use the following native object function可以使用以下原生 object function

Release.IsUpgrade: This is set to true if the current operation is an upgrade or rollback.

You can read more about helm native objects here您可以在此处阅读有关 helm 原生对象的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM