Skip to Content

Deploy in SAP BTP, Kyma Runtime

This tutorial shows you how to deploy your CAP application in SAP BTP, Kyma runtime.
You will learn
  • How to deploy your CAP application in SAP BTP, Kyma runtime
slavipandeSvetoslav PandelievApril 22, 2025
Created by
slavipande
October 31, 2023
Contributors
grego952
ekaterina-mitova
slavipande

Prerequisites

  • You have configured the respective entitlements, enabled the Kyma runtime in your subaccount, and created an SAP HANA Cloud service instance in the SAP BTP cockpit. Follow the steps in the Prepare for Deployment in the SAP BTP, Kyma Runtime tutorial that is part of the Deploy a Full-Stack CAP Application in SAP BTP, Kyma Runtime Following SAP BTP Developer’s Guide tutorial group.
  • You have an enterprise global account in SAP BTP. To use services for free, you can sign up for an SAP BTPEA (SAP BTP Enterprise Agreement) or a Pay-As-You-Go for SAP BTP global account and make use of the free tier services only. See Using Free Service Plans.
  • You have a platform user. See User and Member Management.
  • You are an administrator of the global account in SAP BTP.
  • You have a subaccount in SAP BTP to deploy the services and applications.
  • You have a tenant of SAP Cloud Identity Services. See Get Your Tenant for details how to get a tenant of SAP Cloud Identity Services if you don’t have one yet.
  • You have established trust between your tenant of SAP Cloud Identity Services and your SAP BTP account. This will allow you to use your SAP Cloud Identity Services tenant as an identity provider or a proxy to your own identity provider hosting your business users. See Establish Trust and Federation Between SAP Authorization and Trust Management Service and SAP Cloud Identity Services.
  • You have one of the following browsers that are supported for working in SAP Business Application Studio:
    • Mozilla Firefox
    • Google Chrome
    • Microsoft Edge
  • For Windows, you’ll need Chocolatey. This is a package manager that will speed up and ease installation of the tools in this tutorial. See how to install Chocolatey in Setup/Install.
  • You have prepared a container registry and you’ve logged in to the container registry through your CLI. A container registry is a repo where you can push your Docker images. SAP BTP doesn’t currently provide a container registry. You can use any container registry offering as long as it can be reached from public Internet.

This tutorial follows the guidance provided in the SAP BTP Developer’s Guide.

  • Step 1

    SAP BTP, Kyma runtime is a cloud-native application runtime that combines the power of Kubernetes with a set of best-in-class tools and open-source components that empower you to develop, run, and operate secure and scalable cloud-native applications. Detailed information is available at Kyma Environment.

    The Kyma runtime for SAP BTP’s files are provided as a container image. In addition, since the containers run on Kubernetes, their configuration is described by Kubernetes resources.

    Hence, you need two kinds of artifacts to run applications on Kubernetes:

    • Container images
    • Kubernetes resources

    You start by building your project as container images and push those images to a container registry of your choice. Then, you add a CAP Helm chart to your project. As a last step, you deploy the Helm chart to your Kyma resources, where service instances of SAP BTP services are created and pods pull the previously created container images from the container registry.

  • Step 2
  • Step 3
  • Step 4
    1. Choose KubeconfigURL under the Kyma Environment tab in your subaccount.

      Kubeconfig URL

      A file kubeconfig.yaml is downloaded.

      Kubeconfig yaml
    2. Copy the kubeconfig.yaml file to the ~/.kube/ directory and rename it to config. Replace or rename any existing file with the same name.

    There are two additional steps for Windows users only:

    1. Go to C:\ProgramData\chocolatey\bin.

    2. Rename kubelogin.exe to kubectl-oidc_login.exe.

  • Step 5
  • Step 6
  • Step 7
  • Step 8
    1. Skip this step if you cloned the application from the Incident Management application GitHub repository without going through the application development steps. Perform this step only in case you have developed the application from scratch following the tutorials in the Develop a Full-Stack CAP Application Following SAP BTP Developer’s Guide group.

      1. In SAP Business Application Studio, choose the icon to download dev space content.

        Download dev space content

        Make sure the IncidentManagement dev space is in status RUNNING.

      2. Extract the incident-management folder from the downloaded archive.

    2. Open a command line window in the folder where your application resides (for example, incident-management if developed from scratch or incidents-app if cloned from GitHub) and run the following command to open the project in VS Code:

      bash
      Copy
      code .
      
  • Step 9
  • Step 10

    CAP provides a configurable Helm chart for Node.js applications.

    1. Run the following command in your project root folder:

      bash
      Copy
      cds add helm --y
      

      As a result, you’ll see a newly-created chart folder in your project. The chart folder holds the helm configuration, including the values.yaml file where you’ll add your container image settings later on.

    2. Add your container image settings to your chart/values.yaml file:

      yaml
      Copy
      global:
        domain: 
        imagePullSecret:
          name: 
        image:
          registry: <your-container-registry>
          tag: <image-version>
      

      Make sure to replace <your-container-registry> with the link to your container registry and keep in mind that <image version> should be a string.

      If you’d like to overwrite the global image version, you can add a tag for each image. Here’s an example:

      yaml
      Copy
      srv:
        image:
          repository: incident-management-srv
          tag: <incident-management-srv-image-version>
      
    3. Run the following command to get the domain name of your Kyma cluster:

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

      Result should look like this:

      bash
      Copy
      *.<xyz123>.kyma.ondemand.com
      

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

    4. Add the result without the leading *. in the domain property to the chart/values.yaml file so that the URL of your CAP service can be generated:

      yaml
      Copy
      global:
          domain: <your-cluster-domain>
      ...
      

    What is the name of the folder that holds the helm configuration?

  • Step 11
Back to top