0

I am trying to rollback the helm chart to the previous build using the below command.

helm rollback service_name --debug -n namespace

In helm history, it showing rollback updated.

helm history service_name -n namespace

62 Fri Sep 10 14:11:07 2021 deployed service_name-0.1.0 1.16.0 Rollback to 60

But POD is not updating, Still it showing the old build id, Even after manual restarts.

David Maze
  • 130,717
  • 29
  • 175
  • 215
karthik
  • 193
  • 1
  • 1
  • 13
  • Are there any more details you can provide about this setup? For example, how does the build ID get passed through from running `helm upgrade` down into the pod manifest? – David Maze Sep 11 '21 at 00:19
  • @DavidMaze - As of now I am not passing any build ID details to the helm command, I thought helm maintains all the build details in the form of a configmap so it will pick build details from that? – karthik Sep 11 '21 at 17:09
  • I am using the CI/CD pipeline to build the docker image and using artifacts i am passing the build ID. – karthik Sep 11 '21 at 17:39
  • In your Deployment spec, what is the `image:`? Can you provide a [mcve], in particular noting the complete Helm command and values you use both on the initial install and the upgrade? – David Maze Sep 11 '21 at 21:20
  • @DavidMaze 1)Building the docker image and pushing it to the container registry. 2)In helm deployment configuration i am specifying: gcr.io/project_name/folder_name/service_name:latest 3)Then deploying helm charts using helm upgrade --install service_name service_name -f ./service_name/values.yaml -f ./service_name/values-dev.yaml --set image.tag=latest 4)Once it's deployed, I am trying to roll back the service using the below command. helm rollback service_name --debug -n namespace – karthik Sep 12 '21 at 02:17
  • Avoid using a `latest` tag in Kubernetes. As far as Helm can tell, the old and new Deployment objects are identical, so nothing gets submitted to the cluster; at the cluster level, the Deployment already has _n_ Pods that are running `image: ...:latest` so nothing needs to change. `--set image.tag=...` something unique per build, maybe the source control commit ID. – David Maze Sep 12 '21 at 12:18
  • (This applies on `helm rollback` too: version 62 wanted `image: ...:latest` and so did version 60, so nothing gets sent to the cluster. Beyond that `--set` value Helm has no idea what `latest` might correspond to.) – David Maze Sep 12 '21 at 12:20
  • @DavidMaze Thank you for your help. It's working after adding build ID instead of the latest. – karthik Sep 13 '21 at 07:21

0 Answers0