Using Helm to Package and Deploy your Application

Objective

After completing this lesson, you will be able to use Helm to package and deploy your application

Use Helm to Deploy and Manage Deployments

Usage Scenario

You've already used different manifests to manually deploy your application with all corresponding Kubernetes objects to a Kubernetes cluster. Now, you want to use Helm to package your Deployment manifest and deploy it to your cluster.

Task Flow

In this exercise, you will create, customize, and deploy a Helm chart for a Deployment.

Prerequisites

Before you begin, ensure that the following prerequisites are met:

Once you have the Helm CLI installed, you can use the command helm create. The command creates a few sample files for you to get started with. However, this exercise shows how to create a Helm chart manually from scratch.

Task 1: Create, Customize, and Deploy a Helm Chart for a Deployment

Steps

  1. Create a new directory for your Helm chart. Call it hello-kyma-chart and change into it.

  2. Create a new file called Chart.yaml and specify information about the chart, such as the name, version, description, and so on. Add the following content to the file:

    Code Snippet
    12345
    apiVersion: v2 name: hello-kyma-chart description: A Helm chart for the Hello Kyma example application type: application version: 0.1.0
  3. Create a new file called values.yaml and specify the default configuration values like replicaCount and image.tag. Add the following content to the file:

    Code Snippet
    123
    replicaCount: 1 image: tag: "1.0.0"
  4. In the hello-kyma-chart dierectory, create a new directory called templates and change into it.

    In this directory, you can add all the templates for your Helm chart. For now, we will only add a template for the Deployment.

  5. Create a new file called deployment.yaml and specify the Kubernetes Deployment's definition and use your configuration values. Add the following content to the file:

    Code Snippet
    123456789101112131415161718192021222324
    apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Release.Name }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: app: {{ .Release.Name }} template: metadata: labels: app: {{ .Release.Name }} spec: containers: - name: hello-kyma image: ghcr.io/sap-samples/kyma-runtime-learning-journey/hello-kyma:{{ .Values.image.tag }} ports: - containerPort: 8080 strategy: type: RollingUpdate rollingUpdate: maxSurge: 25% maxUnavailable: 25%

    Hint

    The Deployment manifest contains the {{ .Release.Name }} and {{ .Values.replicaCount }} placeholders to make use of the configuration values that you specified in the values.yaml file. The {{ Release.Name }} placeholder is replaced with the name of the Helm release. The {{ .Chart.AppVersion }} placeholder is replaced with the version of the application that you specified in the Chart.yaml file.

  6. To perform a dry-run of your Helm chart to see if it is valid, run the following command inside the hello-kyma-chart directory:

    Code Snippet
    1
    helm template hello-kyma .

    You should now see a rendered output of your Helm chart.

  7. Install the Helm chart in your cluster.

    1. Run the following command inside the hello-kyma-chart directory:

      Code Snippet
      1
      helm install hello-kyma-helm .

      You get an output similar to this example:

      Code Snippet
      123456
      NAME: hello-kyma-helm LAST DEPLOYED: Fri Sep 12 14:25:42 2025 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None
    2. To see the Deployment in your cluster, run the following command:

      Code Snippet
      1
      kubectl get deployments

      You get the following output in response:

      Code Snippet
      12
      NAME READY UP-TO-DATE AVAILABLE AGE hello-kyma-helm 1/1 1 1 2m
  8. Update the values.yaml file and change the replicaCount to 2.

  9. Update the Helm chart in your cluster.

    1. Run the following command inside the hello-kyma-chart directory:

      Code Snippet
      1
      helm upgrade hello-kyma-helm .

      You should now see the following output:

      Code Snippet
      1234567
      Release "hello-kyma-helm" has been upgraded. Happy Helming! NAME: hello-kyma-helm LAST DEPLOYED: Fri Sep 12 14:27:05 2025 NAMESPACE: default STATUS: deployed REVISION: 2 TEST SUITE: None
    2. List the Deployments using kubectl:

      Code Snippet
      1
      kubectl get deployments

      If successful, the list includes the hello-kyma-helm Deployment:

      Code Snippet
      12
      NAME READY UP-TO-DATE AVAILABLE AGE hello-kyma-helm 2/2 2 2 4m
  10. View the Helm release in Kyma dashboard.

    1. Open Kyma dashboard in your browser.

    2. In the default namespace, go to Apps → Helm Releases and choose the hello-kyma-helm release.

      The Kyma dashboard with the Helm Releases section selected. It lists a Helm release named hello-kyma-helm with chart hello-kyma-chart, revision 2, version 0.1.0, and status DEPLOYED.

      The following view opens:

      The Kyma dashboard with a Helm release named hello-kyma-helm at revision 2, status DEPLOYED. It includes release data such as chart version 0.1.0 and Deployment times.

Result

You have successfully created a Helm chart for your Deployment and deployed it to your cluster. Once you discover other Kubernetes objects later in this course, you will be able, for example, to extend your helm chart with other manifests for Services, Ingresses, and more.