Skip to Content

Add Helm Chart

Learn how to add a Helm chart to your project and configure container image, pull secret, cluster domain, and SAP HANA secret in the Helm chart.
You will learn
  • How to add a Helm chart to your project
  • How to configure container image
  • How to configure pull secret
  • How to configure cluster domain
  • How to configure SAP HANA secret
iwonahahnIwona HahnOctober 17, 2022
Created by
iwonahahn
July 5, 2022
Contributors
iwonahahn
manjuX
  • Step 1
    1. In the root directory of your project, run:
      cds add helm
      

      This creates a directory chart with the CAP Helm chart in your project directory.

  • Step 2
    1. Open the file chart/values.yaml.

    2. Replace the placeholder <your-container-registry> with your docker server URL.

      YAML
      Copy
      srv:
          image:
              repository: <your-container-registry>/cpapp-srv
              tag: latest
      ...
      hana_deployer:
          image:
              repository: <your-container-registry>/cpapp-hana-deployer
              tag: latest
      

      Looking for your docker server URL?

      The docker server URL is the same as provided in Step 6: Create container registry secret of Prepare Your Kyma Development Environment. It’s also the path used for docker login, so you can quickly check it by running the following command in your terminal:

      json
      Copy
      cat ~/.docker/config.json
      
  • Step 3
    1. In the chart/values.yaml file, make sure that the pull secret is defined:
      YAML
      Copy
      global:
          domain: null
          imagePullSecret:
              name: container-registry
      srv:
          ...
          bindings:
              ...
          image:
              repository: <your-container-registry>/cpapp-srv
              ...
      

      The name of the secret created in Step 6: Create container registry secret of Prepare Your Kyma Development Environment and the entry for imagePullSecret should match.

  • Step 4

    The HTML5 applications need the Internet-accessible URL of the CAP service. For that the Helm chart needs to know the domain name to access the cluster.

    1. Get the host name pattern of the cluster with the following command:

      YAML
      Copy
      kubectl get gateway -n kyma-system kyma-gateway -o jsonpath='{.spec.servers[0].hosts[0]}'
      

      Result should look like:

      *.c-<xyz123>.sap.kyma.ondemand.com
      

      <xyz123> is a placeholder for a string of characters that’s unique for your cluster.

    2. Add the result without the leading *. in the domain property of your chart/values.yaml file. For example:

      YAML
      Copy
      global:
          domain: c-<xyz123>.sap.kyma.ondemand.com
      
  • Step 5
    1. In the chart/values.yaml file, add the binding db pointing to the SAP HANA HDI container secret:

      YAML
      Copy
      srv:
          bindings:
              auth:
                ...
              db:
                fromSecret: cpapp-db
      
    2. Point the binding hana of the SAP HANA deployer to the SAP HANA HDI container secret:

      YAML
      Copy
      hana_deployer:
          ...
          bindings:
              hana:
                  fromSecret: cpapp-db
      

    The result of this tutorial can be found in the kyma-add-helm-chart branch.

    What's the correct command for adding a Helm chart to your CAP project?

Back to top