Skip to Content

Deploy Commerce Mock Application in SAP BTP, Kyma Runtime

Deploy and connect the Commerce mock application to SAP BTP, Kyma runtime.
You will learn
  • How to deploy the Kyma mock application and expose its API to the Internet using an APIRule
  • How to pair the mock application with SAP BTP, Kyma runtime to register the APIs and events from the application
grego952Grzegorz KaraluchMarch 11, 2025
Created by
grego952
May 8, 2024
Contributors
grego952

Prerequisites

  • Git installed

The Kyma mock application contains lightweight substitutes for SAP applications to ease the development and testing of extension and integration scenarios based on Varkes. Together with SAP BTP, Kyma runtime, it allows for efficient implementation of application extensions without the need to access the standard SAP applications during development.

  • Step 1
    1. Go to the kyma-runtime-extension-samples repository.
      Within the repo you can find each of the mock applications and their Deployment files within the respective folder. The process outlined in this tutorial is the same for each, but focuses on configuring the commerce mock.

    2. Use the green Code button to choose one of the options to download the code locally, or simply run the following command using your CLI at your desired folder location:

      Shell/Bash
      Copy
      git clone https://github.com/SAP-samples/kyma-runtime-extension-samples
      
  • Step 2
    1. Open Kyma dashboard using the Console URL link in SAP BTP cockpit.

    2. Choose Modify Modules, and select Add.

    3. In the Add Modules section, check application-connector, and select Add.

      You can find more info in Add and Delete a Kyma Module.

  • Step 3
    1. In your Kyma dashboard, go to Namespaces and choose Create.

    2. Provide the name dev, toogle the Enable Sidecar Injection button, and choose Create.

      Namespaces separate objects inside a Kubernetes cluster. The concept is similar to folders in a file system. Each Kubernetes cluster has a default namespace to begin with. Choosing a different value for the namespace will require adjustments to the provided samples.

      Toggling the Enable Sidecar Injection button allows the Istio service mesh to inject the Envoy sidecar proxy into Pods located in this namespace.

    3. Open the dev Namespace, if it is not already open, and choose Upload YAML.

    4. Either copy the contents of the file kyma-runtime-extension-samples/commerce-mock/deployment/k8s.yaml into the window or use the upload option. Notice that this file contains the resource definitions for the Deployment as well as the Service and the Persistent Volume Claim.

    5. Go to Discovery and Network > API Rules and choose Create.

    6. Enter the following values:

      • Name: commerce-mock
      • Service Name: commerce-mock
      • Host: commerce
      • Access Strategy: No Auth
    7. Mark the GET and POST methods, and choose Create to create the APIRule.

      Even APIRules can be created by describing them within YAML files. You can find the YAML definition of the APIRule at /kyma-runtime-extension-samples/commerce-mock/deployment/kyma.yaml.

  • Step 4
    1. Go to Discovery and Network > API Rules, and open the commerce-mock application.

    2. Paste the value from the Hosts section into your browser. The value should be similar to https://commerce.*******.kyma.ondemand.com. If you receive the error upstream connect..., the application may have not finished starting. Wait for a minute or two and try again.

    3. Leave the mock application open in the browser, you will use it later.

  • Step 5

    In this step, you will create a System in SAP BTP cockpit that will be used to pair the mock application with SAP BTP, Kyma runtime. You will perfrom this step at the Global account level of your SAP BTP account.

    1. Open your global SAP BTP account and choose the System Landscape menu option.

    2. Choose Add System under the Systems tab.

    3. Provide the name commerce-mock, set the type to SAP Commerce Cloud and then choose Add.

    4. Choose the option Get Token, copy the Token value and close the window. This value will expire in five minutes and will be needed in a subsequent step.

      If the token expires before use, you can obtain a new one by choosing the Get Token option shown next to the entry in the Systems list.

    What is the function of a Formation?

  • Step 6

    In this step, you will create a Formation. A Formation is used to connect one or more Systems created in the SAP BTP to a runtime. You will perform this step at the Global account level of your SAP BTP account.

    1. Within your global SAP BTP account, choose the System Landscape menu option. Choose the tab Formations and choose the Create Formation option.

    2. Provide the name mock-formation, choose Side-by-Side Extensibility with Kyma for the Formation Type, and your Subaccount where SAP BTP, Kyma runtime is enabled. Choose Next Step.

    3. Select the commerce-mock system and choose Next Step.

    4. Choose Create.

    What is the purpose of pairing an applicaiton? (Multiple answers are correct)

  • Step 7

    The pairing process will establish trust between the Commerce mock application and, in this case, SAP BTP, Kyma runtime. Once the pairing is complete, the registration of APIs and business events can be performed. This process allows developers to utilize the APIs and business events with the authentication aspects handled automatically.

    1. Navigate back to the mock application browser window and choose Connect.
    2. Paste the copied value in the token text area and then choose Connect. If the token has expired, you may receive an error. Simply return to Step 4 and generate a new token.
    3. Choose Register All to register the APIs and events from the mock application.

  • Step 8
    1. In your Kyma dashboard, go to Cluster Details.

    2. Choose Integration > Applications.

    3. Choose the mp-commerce-mock application by clicking on the name value shown in the list.

      If you don’t see the mp-commerce-mock application, restart your Kyma dashboard.

    You should now see a list of the APIs and events the mock application is exposing.

    Congratulations! You have successfully configured the Commerce mock application.


Back to top