Helm workshop: Lifecycle operations

Apply a change, anything. For example we will add a label stage: dev. Edit the file templates/_helpers.tpl

1{{- define "web.labels" -}}
2stage: "dev"
3...

Deploy a new revision with the same command we ran previously

1helm upgrade --install web web

Now we can have a look to the changes we’ve made so far to the release

1$ helm history web
2REVISION        UPDATED                         STATUS          CHART           APP VERSION     DESCRIPTION
31               Mon Feb 15 15:11:09 2021        superseded      web-0.1.0       1.16.0          Install complete
4...
54               Mon Feb 15 21:15:25 2021        superseded      web-0.1.0       1.16.0          Upgrade complete
65               Mon Feb 15 21:21:21 2021        deployed        web-0.1.0       1.16.0          Upgrade complete

We can then check what would be the changes if we rollback to the previous revision

 1helm diff rollback web 4
 2default, web, Deployment (apps) has changed:
 3  # Source: web/templates/deployment.yaml
 4  apiVersion: apps/v1
 5  kind: Deployment
 6  metadata:
 7    name: web
 8    labels:
 9-     stage: "dev"
10      helm.sh/chart: web-0.1.0
11...

Now that we’re sure we can safely rollback to the previous revision

1helm rollback web 4
2Rollback was a success! Happy Helming!

➡️ Next: Helm templating challenge

Posts in this series