Home > Software engineering >  disable helm upgrade for particular statefulset template
disable helm upgrade for particular statefulset template

Time:09-09

i have a helm chart having multiple StatefulSet templates.
i want one of the template to be deployed only during helm install
and it should not teminate when doing 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
i want it to be unaffected(not terminated) when during helm upgrade

CodePudding user response:

after doing through helm documentation, it provides solution using helm hooks

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

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

CodePudding user response:

You can use the following native 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

  • Related