Build and Deploy a Multitenant CAP Application on Kyma

February 16, 2026 ยท View on GitHub

This is a simple end-to-end sample to demonstrate building and deploying a multitenant CAP application on Kyma.

mt-bookshop

Prerequisites

Procedure

Run the Application Locally

  1. Navigate to the bookshop-external directory.

    Note

    All subsequent commands should be run from this directory.

    cd bookshop-external
    
  2. Start a sidecar.

    cds watch mtx/sidecar
    
  3. In another terminal, start the CAP application.

    cds watch --profile local-multitenancy
    
  4. Add tenants. Run the following commands in a new terminal or use test.rest.

    cds subscribe t1 --to http://localhost:4005 -u yves:
    cds subscribe t2 --to http://localhost:4005 -u yves:
    
  5. Get data for both users.

    curl -u alice: http://localhost:4004/odata/v4/catalog/Books
    curl -u erin: http://localhost:4004/odata/v4/catalog/Books
    

Deploy on Kyma

  1. Update the following parameters in bookshop-external/chart/values.yaml:

    • global.domain: your Kyma domain
    • global.imagePullSecret.name: your Docker pull secret name if images are pulled from a private registry
    • global.image.registry: your Docker registry server
  2. Update the following parameter in bookshop-external/containerize.yaml:

    • repository: your Docker registry server
  3. Build the Docker images and deploy the Helm chart on Kyma.

    cds build --production
    cds up -2 k8s
    

Verify

  1. Simulate the subscribe flow by subscribing from a different subaccount in the same global account in SAP BTP cockpit.

  2. Access the subscribed application.

Clean Up

  1. Unsubscribe the tenant from SAP BTP cockpit.

  2. Undeploy the Helm chart.

    helm del --wait --timeout=10m bookshop-external
    

Troubleshooting

Use Helm commands to upgrade/install/reinstall the chart. For example:

helm upgrade --install bookshop-external ./gen/chart  --wait --wait-for-jobs --timeout=10m --set-file xsuaa.jsonParameters=xs-security.json