helm update selectif template file (specific service & deployment yaml file)

11/28/2019

In my Microservices architecture i have a helm chart by microservice used to deploy it in Kubernetes, every microservice/chart has 3 pods

-helm
  - chart.yaml
  - values.yaml
  - templates
    - nginx-deployment.yaml
    - nginx-service.yaml
    - php-deployment.yaml
    - php-service.yaml
    - varnish-deployment.yaml
    - varnish-service.yaml

when i execute

helm upgrade --install my-analyzer ./helm/

the three pod are updated (So far it's fine) My question : how can i do with Helm to upgrade only one or two pods a time and not touch the others exemple : upgrade nginx and varnish but keep php without changes

-- Inforedaster
kubernetes
kubernetes-helm
microservices

1 Answer

11/29/2019

I've missunderstood your question. I have edited my answer.

Unfortunately it is impossible to achieve that in Helm.

Each time you are upgrading Helm its creating new Release. Its going throught all YAMLs in Chart and deploying everything what have inside based on this order.

You can use IF statement in YAML if you want to execlude something from deploying. Example can be found on Github.

In this service, on the beginning of the YAML you can see if statement in 1st line:

{{- if .Values.replication.enabled }}

However if 1st Release will contain specific deployments in templates and 2nd will not, Helm will delete objects from 1st release which were not included in 2nd.

Only thing what you could change is use helm upgrade with --set flag which can overwrite some default values.

You can also consider advse from Alireza Davoodi or VAS about change pipeline logic.

-- PjoterS
Source: StackOverflow