Working with Helm charts
TOC
1. Understanding Helm
Helm is a package manager that simplifies the deployment of applications and services on Alauda Container Platform clusters. Helm uses a packaging format called charts. A Helm chart is a collection of files that describe Kubernetes resources. Creating a chart in a cluster generates a chart running instance called a release. Each time a chart is created, or a release is upgraded or rolled back, an incremental revision is created.
1.1. Key features
Helm provides the ability to:
- Search for a large collection of charts in chart repositories
- Modify existing charts
- Create your own charts using Kubernetes resources
- Package applications and share them as charts
1.2. Catalog
The Catalog is built on Helm and provides a comprehensive Chart distribution management platform, extending the limitations of the Helm CLI tool. The platform enables developers to more conveniently manage, deploy, and use charts through a user-friendly interface.
Terminology Definitions
1.3 Understanding HelmRequest
In Alauda Container Platform, Helm deployments are primarily managed through a custom resource called HelmRequest. This approach extends standard Helm functionality and integrates it seamlessly into the Kubernetes native resource model.
Differences Between HelmRequest and Helm
Standard Helm uses CLI commands to manage releases, while Alauda Container Platform uses HelmRequest resources to define, deploy, and manage Helm charts. Key differences include:
- Declarative vs Imperative: HelmRequest provides a declarative approach to Helm deployments, while traditional Helm CLI is imperative.
- Kubernetes Native: HelmRequest is a custom resource directly integrated with the Kubernetes API.
- Continuous Reconciliation: Captain continuously monitors and reconciles HelmRequest resources with their desired state.
- Multi-cluster Support: HelmRequest supports deployments across multiple clusters through the platform.
- Platform Feature Integration: HelmRequest can be integrated with other platform features, such as Application resources.
HelmRequest and Application Integration
HelmRequest and Application resources have conceptual similarities, and users may want to view them uniformly. The platform provides a mechanism to synchronize HelmRequest as Application resources.
Users can mark a HelmRequest to be deployed as an Application by adding the following annotation:
When this feature is enabled, the platform UI displays additional fields and links to the corresponding Application page.
Deployment Workflow
The workflow for deploying charts via HelmRequest includes:
- User creates or updates a HelmRequest resource
- HelmRequest contains chart references and values to apply
- Captain processes the HelmRequest and creates a Helm Release
- Release contains the deployed resources
- Metis monitors HelmRequests with application annotations and synchronizes them to Applications
- Application provides a unified view of deployed resources
Component Definitions
- HelmRequest: Custom resource definition that describes the desired Helm chart deployment
- Captain: Controller that processes HelmRequest resources and manages Helm releases (source code available at https://github.com/alauda/captain)
- Release: Deployed instance of a Helm chart
- Charon: Component that monitors HelmRequests and creates corresponding Application resources
- Application: Unified representation of deployed resources, providing additional management capabilities
- Archon-api: Component responsible for specific advanced API functions within the platform
2 Deploying Helm Charts as Applications via CLI
2.1 Workflow Overview
Prepare chart → Package chart → Obtain API token → Create chart repository → Upload chart → Upload related images → Deploy application → Update application → Uninstall application → Delete chart repository
2.2 Preparing the Chart
Helm uses a packaging format called charts. A chart is a collection of files that describe Kubernetes resources. A single chart can be used to deploy anything from a simple pod to a complex application stack.
Refer to the official documentation: Helm Charts Documentation
Example chart directory structure:
Key file descriptions:
values.descriptor.yaml(optional): Works with ACP UI to display user-friendly formsvalues.schema.json(optional): Validates values.yaml content and renders a simple UIvalues.yaml(required): Defines chart deployment parameters
2.3 Packaging the Chart
Use the helm package command to package the chart:
2.4 Obtaining an API Token
- In Alauda Container Platform, click the avatar in the top-right corner => Profile
- Click Add Api Token
- Enter appropriate Description & Remaining Validity
- Save the displayed token information (only shown once)
2.5 Creating a Chart Repository
Create a local chart repository via API:
2.6 Uploading the Chart
Upload the packaged chart to the repository:
2.7 Uploading Related Images
-
Pull the image:
podman pull nginx -
Save as tar package:
podman save nginx > nginx.latest.tar -
Load and push to private registry:
2.8 Deploying the Application
Create Application resource via API:
2.9 Updating the Application
Update the application using PATCH request:
2.10 Uninstalling the Application
Delete the Application resource:
2.11 Deleting the Chart Repository
3. Deploying Helm Charts as Applications via UI
3.1 Workflow Overview
Add templates to manageable repositories → Upload templates → Manage template versions
3.2 Prerequisites
Template repositories are added by platform administrators. Please contact the platform administrator to obtain the available Chart or OCI Chart type template repository names with Management permissions.
3.3 Adding Templates to Manageable Repositories
-
Go to Catalog.
-
In the left navigation bar, click Helm Charts.
-
Click Add Template in the upper right corner of the page, and select the template repository based on the parameters below.
-
Click Upload Template and upload the local template to the repository.
-
Click Confirm. The template upload process may take a few minutes, please be patient.
Note: When the template status changes from
UploadingtoUpload Successful, it indicates that the template has been uploaded successfully. -
If the upload fails, please troubleshoot according to the following prompts.
Note: An illegal file format means there is an issue with the files in the uploaded compressed package, such as missing content or incorrect formatting.
3.4 Deleting Specific Versions of Templates
If a version of a template is no longer applicable, it can be deleted.
Steps to Operate
-
Go to Catalog.
-
In the left navigation bar, click Helm Charts.
-
Click on the Chart card to view details.
-
Click Manage Versions.
-
Find the template that is no longer applicable, click Delete, and confirm.
After deleting the version, the corresponding application will not be able to be updated.