<< Back to Getting Started with IBM UrbanCode Deploy and Containers
Introduction
With the Kubernetes plug-in for UrbanCode Deploy, users may change the tag (version) of containers used in a deployment without editing YAML files. UrbanCode Deploy tracks and displays which container image versions are deployed where and when, providing auditing and ease of use.
The Kubernetes plug-in now features similar functionality for deployments using Helm charts. The container images used in Helm charts may be managed as components inside UrbanCode Deploy, eliminating the need for users to update Helm charts or values.yaml files in order to change which container version is deployed in environments.
The Create Image Components From Helm Release Step
Easily create container image components with the The Create Image Components from Helm Release step. Users provide a Helm release name. When run, the step will examine the Helm release, find all container images used by the release, then create UrbanCode Deploy components to mange those container images. The Docker Registry source configuration plug-in may then connect to your Docker registry and discover all available image tags, adding them to the component as versions.

In this example, I’ve created a generic process which contains only the Create Image Components from Helm Release step. I’ve provided my Helm release name mra-derby. Once executed, the process created a component for the container image used in my release and added a kubernetes.image tag to the component. I updated the configuration settings for my component so the Docker Registry plug-in could then connected to my Docker Registry (in this case, Artifactory). I then imported versions for the component. The Docker Registry plug-in connected to Artifactory, discovered the container image tags, and created them as versions in UrbanCode Deploy.

Add a Process to the Container Image Components
A process must be added to the container image component in order for these components to perform a Helm upgrade. The Helm upgrade will be used to change which version (tag) of the container image is used by the release. In my simple example, my process only uses one step (Helm Upgrade), however you may want to add steps to configure Helm for reliability.

In this example. I’m providing my Helm release (as a property), my Helm chart (as a property), and two flags. Let’s take a look at the first flag:
--set image.tag=${p:version.name}
The –set flag is used to override a value found in your charts values.yaml file. I determined that image.tag was the property to override by looking at my chart’s values.yaml file:

I saw that image.tag was the property in values.yaml I wanted to override. This value may be different for you. You may also want to use an UrbanCode Deploy property for this value for ease of use going forward (this would make the process generic and would allow you to use a component template).
Finally, ${p:version.name} means we are going to set this property to the version name of our component, which will be an image tag.
The next flag is:
--reuse-values
This tells Helm to leave all other values as is.
Setting up the Application in UrbanCode Deploy
In UrbanCode Deploy, create an application. Add the component that represents your Helm chart and the container image components to the application.
Build an application process.

Above is an example of an application process. The first step installs the Helm chart component. My component process for the Helm chart component downloads the chart from the component version artifact into a specific directory. The process then checks to see if the Helm release already exists. If the release does not exist, the chart is installed. If the release does exist, an upgrade is performed. See this page for an example process.
Next, my process installs the container image component. In my example, I only have one container image, so I install it directly. If you have multiple container image components, you may use the Install Multiple Components step to install all components with the kubernetes.image tag, for example. This step runs the process we created earlier for the container image component. The end result is a helm upgrade command is run to ensure the Helm release uses the image tag specified in the UrbanCode Deploy user interface.
Conclusion
UrbanCode Deploy is now setup to allow users to change which tag (version) of their container image is used in a Helm deployment without requiring the user to update YAML files or manually run Helm commands.

In the example above, version 2.0.0 of my Helm chart is deployed. The release includes a container named ucds, and the tag for that container image is 7.0.0.0.981343c-x86_64. If I want to change the tag of the container image used in my release, I could simply run another deployment, choosing which image tag to use in the UrbanCode Deploy user interface.

Good luck with your Helm deployments!