Skip to content

h-best-sap/sap-cap-on-kyma-kt-202306

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This sample provides a Node.js CAP Service application service to demonstrate how to:

  • Create a development Namespace in the Kyma runtime.
  • Configure and build an CAP Service Docker image.
  • Deploy the CAP Service in the Kyma runtime which includes:
    • A Deployment of the CAP Service.
    • An API to expose the service externally.

Prerequisites

Optionals:

Getting Started

It contains these folders and files, following our recommended project layout:

File or Folder Purpose
app/ content for UI frontends goes here
db/ your domain models and data go here
docker/ Dockerfile
k8s/ kubernetes deployment files
srv/ your service models and code go here
package.json project metadata and configuration
README.md this getting started guide

Next Steps

Steps

Run the frontend locally

  1. Clone the project.

    git clone https://github.com/h-best-sap/sap-cap-on-kyma-kt-202306.git
  2. Inside the directory, run:

    cd sap-cap-on-kyma-kt-202306
    npm i
  3. Verify the CAP tools install by running

    ## npm i -g @sap/cds-dk
    cds
  4. Deploy the DB schemas to you local sqlite database

    cds deploy --to sqlite
  5. Run the app using the command

    cds watch

The application loads at http://localhost:4004. admin service endpoints use alice as default username, not need password.

Build the Docker image

  1. Build

    ## docker build -t huahouye/sap-cap-on-kyma-kt-202306 -f docker/Dockerfile .
    docker build -t <your-docker-id>/sap-cap-on-kyma-kt-202306 -f docker/Dockerfile .
  2. Run the image locally:

    ## docker run -p 4004:4004 huahouye/sap-cap-on-kyma-kt-202306:latest --name sap-cap-on-kyma-kt-202306
    docker run -p 4004:4004 <your-docker-id>/sap-cap-on-kyma-kt-202306:latest --name sap-cap-on-kyma-kt-202306
  3. Push the image to your Docker repository:

    docker login
    ## docker push huahouye/sap-cap-on-kyma-kt-202306
    docker push <your-docker-id>/sap-cap-on-kyma-kt-202306

Deploy the application

  1. Create a new dev Namespace:

    kubectl create namespace dev
    kubectl label namespaces dev istio-injection=enabled
  2. Apply the Resources:

    kubectl -n dev apply -f ./k8s/deployment.yaml
    kubectl -n dev apply -f ./k8s/apirule.yaml
  3. Use the APIRule to open the application:

    https://sap-cap-on-kyma-kt-202306.{cluster-domain}

Refers

About

SAP CAP on Kyma knowledge transfer 2023/06

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published