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
manjuXManju ShankarMarch 27, 2023
  • Step 1
    1. In the root directory of your project, run:
      Shell/Bash
      Copy
      cds add helm
      

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

    Log in to complete tutorial
  • 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
      

      In case you’re using Docker Hub as your container registry, replace the placeholder <your-container-registry> with your Docker Hub user ID.

    Log in to complete tutorial
  • 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.

    Log in to complete tutorial
  • 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:

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

      Result should look like:

      Shell/Bash
      Copy
      *.<xyz123>.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: <xyz123>.kyma.ondemand.com
      
    Log in to complete tutorial
  • Step 5
    1. Open the chart/values.yaml file.

    2. In the db section of the srv module bindings, replace serviceInstanceName: hana with fromSecret: cpapp-db so that it points to the SAP HANA HDI container secret:

      YAML
      Copy
      srv:
          bindings:
              auth:
                ...
              db:
                fromSecret: cpapp-db
      
    3. In the hana section of the hana-deployer module bindings, replace serviceInstanceName: hana with fromSecret: cpapp-db so that it also points 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?

    Log in to complete tutorial
Back to top