Manage Helm deployments from the Codefresh user interface
Codefresh has a built-in integration for Helm that provides a single view of your production Kubernetes cluster. In Helm Releases, you can view the current status of your cluster, including currently deployed versions, your previous revisions, including change tracking, and even roll back to a previous version.
Codefresh also offers an environment view for Helm versions, as well as a promotion panel.
View Helm versions and version information
View
all versions of Helm in your cluster and
drill down into a specific version to see its services, deployed versions, manifests, and more
.
Ensure that you have connected your Kubernetes cluster to
Codefresh.
- In the Codefresh user interface, under DevOps Insights in the sidebar, select Helm Releases.
Helm Releases
- To view the details for a specific version, click the version name.
<img src="https://codefresh.io/docs/images/deployments/helm/services.png" alt="Kubernetes Services
Services The History tab displays all previous versions.
Helm History
You can further expand a version revision to see exactly which files were changed in this release.
<img src="https://codefresh.io/docs/images/deployments/helm/diff.png" alt="Helm diff
There are other tabs that show the chart used, the values, and the final manifests that were actually implemented.
Add tags to Kubernetes services For
better visibility into services, add recommended tags to your Kubernetes service. To
use the instance tag for
something different, you can also use a version label instead:
Adding an update message
Codefresh allows you to display a meaningful description for each version in the version history.
This message can
help show the main reason behind each version, or any other message that is convenient for you.
<img src="https://codefresh.io/docs/images/deployments/helm/helm-commit-message.png" alt="Helm release message
message You can configure this message for your version of Helm in
three ways:
- When you manually install a version of Helm from the Helm graphics screen, there is a field for this message
- Set the commit_message property within your chart’.txt notes file.
- By providing an environment variable named COMMIT_MESSAGE within the Helm pipeline step.
.
Revert a version of Helm You can revert to a previous revision of a version on the History tab. Click the version
- of Helm for which you want to rollback, and then click the History tab. To revert to a specific version
- , click Revert in the row.
to a previous version
It takes time to complete the rollback of a version, and the change to the cluster is not instantly updated in the Codefresh user interface. If you also use a custom rollback pipeline, the delay between the cluster upgrade and the UI upgrade is even longer.
Helm UI
Actions
From the main version screen, you have some additional actions
.
Select the row with the desired chart and:
Issue a Helm test by clicking the ‘
- Run Test’ button. Delete
- a version by clicking the
- Delete’ button. For removal options, see the Helm removal documentation. For example, purging removes the version history review.
‘
Helm deployment badge Similar to a build badge, you can also get a deployment
badge
for a version of Helm. In the Codefresh user interface, in the
- DevOps Insights section of the sidebar, select Helm Releases. In
- row with the version of Helm for which you want to add a deployment badge, click the Settings (gear) icon.
the
=”https://codefresh.io/docs/images/deployments/helm/helm-badge.png” alt=”Helm Deployment Badge” /> Helm Deployment Badge
- For deployment information, click Badge. Codefresh provides the Markdown/HTML/Link segment that you can embed in README or other documents to display deployment information.
Override
default Helm actions for versions
By default, when an action is performed in the UI, Codefresh executes the native Helm command corresponding to that action:
- rudder test to test a Helm chart
- rollback for reverts
- keep-history for
- delete -purge or helm uninstall to purge a version
Helm delete or Helm uninstall –
delete Helm
You can override these actions for a specific version of Helm by defining custom pipelines for each action. This way, you can add your additional logic in addition to these actions. For example, your own Helm uninstall pipeline might also have a notification step that posts a message to a Slack channel after a version is removed.
Only Codefresh admin users can override default pipelines defined for a version of Helm.
In the
- Codefresh user interface, in the DevOps Insights section of the sidebar, select Helm Releases. In
- row with the version of Helm for which you want to override the default actions, click the Settings (gear) icon.
the
<img src="https://codefresh.io/docs/images/deployments/helm/override-helm-actions.png" alt="Changing Helm Default Actions
- Select the pipeline you want to use for the respective actions.
Environment variables for custom Helm
commands
If you override any of these actions, the following environment variables are available in the appropriate pipeline, so that you can use your own custom Helm command.
Helm Test Pipeline CF_HELM_RELEASE
: Version Name
- CF_HELM_KUBE_CONTEXT: Kubectl context Target cluster name (dashboard cluster name)
- CF_HELM_NAMESPACE: Namespace where version is stored
- Time in seconds to wait for any individual Kubernetes operation
- CF_HELM_CLEANUP: Delete test pods at the end of
CF_HELM_TIMEOUT:
Helm
Rollback pipeline
CF_HELM_VERSION: Helm version, e.g.
- 3.0.1, 2.7.0
- CF_HELM_RELEASE: Name of the version in the cluster
- CF_HELM_REVISION: Hotfix to use for rollback
- CF_HELM_KUBE_CONTEXT: Kubectl context name of the target cluster (dashboard cluster name)
- CF_HELM_NAMESPACE: Namespace where
the Helm version is stored
Delete pipeline
- CF_HELM_PURGE: Boolean, delete
- Version
- name CF_HELM_TIMEOUT: Time in seconds to wait for any individual Kubernetes operation
- CF_HELM_HOOKS: Prevent bindings from running during installation
- CF_HELM_KUBE_CONTEXT: Kubectl context name of the target cluster (dashboard cluster name)
- for example: 3.0.1, 2.7.0
- CF_HELM_NAMESPACE: Namespace where the version is stored
store version CF_HELM_RELEASE:
CF_HELM_VERSION: Helm version,
Related Articles
Using Helm
in a Codefresh pipelineHelm charts and repositoriesUsing a managed Helm repositoryPromoting Helm environments