Manage Helm charts using Container Registry
Learn how to store and deploy Helm charts using Container Registry.
- Estimated time: 30 minutes
- User environment:
- Recommended OS: MacOS
- Region: kr-central-2
- Prerequisites:
About this scenario
This scenario explains how to manage and deploy Helm charts in a Kubernetes cluster using Container Registry. Helm is a Kubernetes package manager that simplifies the deployment and management of complex applications.
Key topics include:
- Create a repository in Container Registry and upload Helm charts
- Create a basic Helm chart for an Nginx web server
- Deploy Helm charts in a Kubernetes cluster
- Manage and upgrade Helm chart versions
Before you start
To proceed smoothly, create a Container Registry and Kubernetes cluster, and install the required tools.
1. Create Container Registry
Container Registry is a cloud service for centrally storing and managing application packages (e.g., Docker images or Helm charts). This step involves creating a repository to store Helm charts.
-
Go to the KakaoCloud console > Container Registry menu and create a repository with the following settings:
Item Repository setting Visibility Private Repository name tutorial-helm-cr Tag overwrite Enabled Image scan Automatic -
Verify that the repository is successfully created in the Container Registry.
2. Create Kubernetes cluster
Create a Kubernetes cluster for the practice session. Refer to the Set up Kubernetes cluster with Kubernetes Engine guide and complete Step 2. Call Kubernetes API with kubectl.
3. Install required tools
For MacOS, install the following tools:
-
Install
Helm
, the Kubernetes package manager for easy application deployment and management.brew install helm
-
Install
Docker Desktop
, a tool for container execution and image management.brew install --cask docker
-
Install the
Tree
utility, which visually displays directory structures, useful for exploring Helm chart structures.brew install tree
Getting started
This practice session guides you through creating a Helm chart, configuring namespaces, deploying the chart, and managing it with Container Registry.
Step 1. Create Helm chart
Helm charts package Kubernetes resources into reusable templates. This step creates a basic Helm chart for an Nginx web server.
-
Create a basic Helm chart.
helm create my-nginx
-
Check the directory structure.
tree my-nginx
The following directory structure should appear:
my-nginx/
├── Chart.yaml
├── charts
├── templates
│ ├── NOTES.txt
│ ├── _helpers.tpl
│ ├── deployment.yaml
│ ├── hpa.yaml
│ ├── ingress.yaml
│ ├── service.yaml
│ ├── serviceaccount.yaml
│ └── tests
│ └── test-connection.yaml
└── values.yaml -
Modify the
values.yaml
file by settingserviceAccount.create
tofalse
. This tutorial does not require a dedicated service account.
Step 2. Create namespace and deploy chart
In this step, create a namespace to logically separate resources and deploy the Helm chart created earlier.
-
Create a new namespace.
kubectl create ns helm-space
-
Deploy the Helm chart.
cd ~/my-nginx
helm install my-nginx-release ../my-nginx/ --debug --namespace helm-space -
Verify the deployment status.
kubectl get all -n helm-space ## Verify deployed resources
helm list --all --namespace helm-space ## Check chart statusExample outputNAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-nginx-release helm-space 1 2025-01-03 16:53:29.378136 +0900 KST deployed my-nginx-0.1.0 1.16.0
Step 3. Authenticate Container Registry
Authenticate the Helm registry to access the Container Registry.
helm registry login $(PROJECT_NAME:: KakaoCloud project name).kr-central-2.kcr.dev \
--username $(ACCESS_KEY_ID::Access Key ID) \
--password $(SECRET_KEY::Secret access key)
Step 4. Package and upload chart
Package and upload the Helm chart to the Container Registry.
-
Package the chart.
helm package my-nginx
-
Upload the packaged chart to the Container Registry.
helm push my-nginx-0.1.0.tgz oci://${PROJECT_NAME}.kr-central-2.kcr.dev/tutorial-helm-cr
Environment variables Description PROJECT_NAME🖌︎ KakaoCloud project name -
Verify the uploaded chart and version (0.1.0) in KakaoCloud console > Container Registry > tutorial-helm-cr > my-nginx.
Step 5. Upgrade chart version
Modify the Helm chart settings and deploy a new version.
-
In
values.yaml
, setreplicaCount
to2
to increase the number of Pod replicas. -
Update the version in
Chart.yaml
to0.1.1
and package the chart.helm package my-nginx
-
Upload the new version to the Container Registry.
helm push my-nginx-0.1.1.tgz oci://${PROJECT_NAME}.kr-central-2.kcr.dev/tutorial-helm-cr
Environment variables Description PROJECT_NAME🖌︎ KakaoCloud project name -
Verify the uploaded chart and version (0.1.1) in KakaoCloud console > Container Registry > tutorial-helm-cr > my-nginx.
-
Upgrade the deployed chart to the new version.
helm upgrade my-nginx-release oci://${PROJECT_NAME}.kr-central-2.kcr.dev/tutorial-helm-cr/my-nginx --version 0.1.1 --namespace helm-space
Environment variables Description PROJECT_NAME🖌︎ KakaoCloud project name -
Verify the upgrade.
kubectl get all -n helm-space ## Check that Pod count is 2
helm history my-nginx-release --namespace helm-space ## View chart upgrade historyExample output
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
1 Fri Jan 3 16:53:29 2025 superseded my-nginx-0.1.0 1.16.0 Install complete
2 Fri Jan 3 17:28:32 2025 deployed my-nginx-0.1.1 1.16.0 Upgrade complete
Cleanup
Run the following commands to clean up the resources created during this session.
helm uninstall my-nginx-release --namespace helm-space
kubectl delete namespace helm-space