This is a simple end-to-end sample to demonstrate building and deploying a multitenant CAP application on Kyma.
-
SAP BTP, Kyma runtime instance
If you're using an SAP BTP trial account, use a subaccount that supports SAP Hana Cloud. At the time of creating the sample (September 2025), SAP Hana Cloud is available in the US, but not in Singapore.
-
kubectl configured to the namespace where you want to deploy the application
-
SAP Hana Cloud instance
If you're using an SAP BTP trial account, make sure your subaccount location supports SAP Hana Cloud.
-
Entitlement for
hdi-sharedplan for SAP Hana Cloud in your SAP BTP subaccount
-
Navigate to the
bookshop-externaldirectory.All subsequent commands should be run from this directory.
cd bookshop-external -
Start a sidecar.
cds watch mtx/sidecar
-
In another terminal, start the CAP application.
cds watch --profile local-multitenancy
-
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:
-
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
-
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
-
Update the following parameter in
bookshop-external/containerize.yaml:- repository: your Docker registry server
-
Build the Docker images and deploy the Helm chart on Kyma.
cds build --production cds up -2 k8s
-
Simulate the subscribe flow by subscribing from a different subaccount in the same global account in SAP BTP cockpit.
-
Access the subscribed application.
-
Unsubscribe the tenant from SAP BTP cockpit.
-
Undeploy the Helm chart.
helm del --wait --timeout=10m bookshop-external
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