In Helm, what is the difference between a release and a revision?

Viewed 28

Both terms appear in the official documentation in very similar contexts. What is the difference, if any?

1 Answers

A release in Helm is an instance of a chart running in a K8 cluster. A revision is linked to a release to track the number of updates/changes that release encounters. Let's say we have a chart named minio and we want to install 2 instances of this chart into our K8 cluster, we run:

helm install myrelease minio
helm install myrelease2 minio

where myrelease and myrelease2 are the release names that I give to each release. So now we have 2 running instances of minio in our cluster. Let's look at the pods created via kubectl get pods, we see:

NAME                                   READY   STATUS    RESTARTS   AGE
pod/myrelease-minio-6b7bc5dfdf-5lfgq   1/1     Running   0          3m10s
pod/myrelease2-minio-b8987d769-xtlgl   1/1     Running   0          37s

where each pod has its release name as its prefix. In addition, we can run helm list to show the charts we've installed:

NAME        NAMESPACE   REVISION    UPDATED                                 STATUS      CHART       APP VERSION
myrelease   default     1           2022-09-14 15:50:42.625388 -0400 EDT    deployed    minio-0.1.0 2020.10.28 
myrelease2  default     1           2022-09-14 15:53:15.478714 -0400 EDT    deployed    minio-0.1.0 2020.10.28 

notice that each of the release has its own revision variable, this tracks any changes to a release and REVISION=1 means this this chart/release has not been changed/updated. If I update myrelease by upgrading version or changing pod replicas, REVISION would increment and in this case, change to 2.

helm upgrade myrelease minio --set replicas=2
helm list
NAME        NAMESPACE   REVISION    UPDATED                                 STATUS      CHART       APP VERSION
myrelease   default     2           2022-09-14 15:58:12.220863 -0400 EDT    deployed    minio-0.1.0 2020.10.28 
myrelease2  default     1           2022-09-14 15:53:15.478714 -0400 EDT    deployed    minio-0.1.0 2020.10.28 

See how after updating the desired replicas for myrelase, the revision number is updated. Say there's an issue with this upgrade, I can simply rollback and this will also increase the REVISION count as it tracks the number of updates to our chat:

helm rollback myrelease
helm list
NAME        NAMESPACE   REVISION    UPDATED                                 STATUS      CHART       APP VERSION
myrelease   default     3           2022-09-14 16:00:39.942524 -0400 EDT    deployed    minio-0.1.0 2020.10.28 
myrelease2  default     1           2022-09-14 15:53:15.478714 -0400 EDT    deployed    minio-0.1.0 2020.10.28 

RELEASE is a running instance of our chart in a K8 cluster. REVISION tracks the number of changes on a release. Hope that helps!

Related