Skip to content

Nov05/sap-btp-hyperscaler-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REUSE status

Consuming SAP BTP Services From Any Hyperscaler

Description:

Deploy an SAP Fiori Application in any a hyperscaler, such as Google Cloud Platform (GCP), Amazon Web Services (AWS), Alibaba Cloud or Azure and use services from SAP BTP.

This application showcases:

  • How to consume Services running on SAP BTP from other environments e.g K8S clusters managed by hyperscalers
  • How to make use of SAP BTP API’s , Service Manager and Service Operator to consume services from different environment

Business Scenario

Business Scenario to showcase how to deploy and simple fiori Master detail application in a hyperscaler, such as Google Cloud Platform (GCP), Amazon Web Services (AWS), Alibaba Cloud or Azure, and still take advantage of the services provided by SAP Business Technology Platform (SAP BTP).

In this tutorial, we use the simple fioriapp(Master Detail) application to learn some best practices when setting up your Kubernetes cluster to communicate with SAP BTP so you can use the Destination and the SAP Authorization & Trust Management services.

Build an application on hyperscaler using SAP BTP services. As an employee of Business Partner Validation Firm , which is a third party vendor of Corporation, John would like to know the recently added business partner in SAP Backend system to review.

  • Application Build on Hyperscaler as an Employee of Corporation, sees Newly added business partner in application

Architecture

solution diagram

SAP Business Technology Platform (SAP BTP) Service Operator for Kubernetes

With the SAP BTP service operator, you can consume SAP BTP services from your Kubernetes cluster using Kubernetes-native tools. SAP BTP service operator allows you to provision and manage service instances and service bindings of SAP BTP services so that your Kubernetes-native applications can access and use needed services from the cluster.
The SAP BTP service operator is based on the Kubernetes Operator pattern.

Prerequisites

Login to SAP Service Manager to Verify Cross consumable services from SAP Business Technology Platform (SAP BTP)

  1. Assign Subaccount Service Administrator Role Collection to your user

    Assign the Subaccount Service Administrator Collection, see the step 2 of the Setup section of The procedure shows how to assign new service administrator role collections to a user of your choice

  2. Execute the following command from your Service Manager Control (SMCTL) command-line interface:

    smctl login -a https://service-manager.cfapps.<region domain> --param subdomain=<subdomain name> -u <user.email> -p <password>

    To find the region domain for the SAP Service Manager, see Regions and API Endpoints Available for the Cloud Foundry Environment The subdomain is the subaccount subdomain, in which you would like to register the broker. You can find it in the cloud cockpit Overview tab of your subaccount.

    To find the region domain for the SAP Service Manager, see Regions and API Endpoints Available for the Cloud Foundry Environment

  3. Check the cross consumable services by entering the following command:

    smctl marketplace

    crossconsumableservices

    Note: Above image is subject to the entitlements assigned to your subaccount.

Create a service instance and service binding

  1. In the fioriapp application, you use the Destination and the SAP Authorization & Trust Management services and consume them using the SAP BTP service operator. To use these SAP BTP services you have to create the respective service instances and service bindings. Use the createservice.yaml which will create the destination service instance with plan lite and the xsuaa service instance with plan application.

  2. The hyperscaler applications can be found in the [btp-hyperscaler-extension] (https://github.com/SAP-samples/btp-hyperscaler-extension) repository. Within the repo you can find each of their Deployment files within the respective folder.

  3. Download the code by choosing the green Code button and then choosing one of the options to download the code locally.

    You can instead run the following command within your CLI at your desired folder location:

    git clone https://github.com/SAP-samples/btp-hyperscaler-extension
    
    
  4. Create your own namespace.

    kubectl create namespace sapfiori
    
  5. Apply the resource file in your cluster to create the instance.

    kubectl apply -f https://raw.githubusercontent.com/SAP-samples/btp-hyperscaler-extension/master/k8s/createservice.yaml -n sapfiori
  6. Check that the status of the service in your cluster is Created.

    kubectl get serviceinstances -n sapfiori
    
    |NAME|OFFERING|PLAN|STATUS|READY|AGE|
    |-------|----|-------|--------|---------|---------|
    |`destination-instance-fiori`| `destination`|`lite`|`Created`|`True`|`##`|
    |`xsuaa-instance-fiori`| `xsuaa`|`application`|`Created`|`True`|`##`|
    
    

    To know more see SAP BTP Service Operator

Build and Deploy the application into Kubernetes Cluster

  1. Build the docker image of the fioriapp.

    • cd btp-hyperscaler-extension/basicfioriapp

    • docker build . -t <docker-username>/fioriapp -f Dockerfile

    Note: Replace <docker-username> with your username

  2. Push the docker image of the fioriapp to your Container Image Library.

    • docker push <docker-username>/fioriapp

    Note: Replace <docker-username> with your username

  3. Update the docker image in the ./btp-hyperscaler-extension/k8s/deployment.yaml file. Line no 21

    • Replace <docker-username> with your username
  4. To deploy the fioriapp application in your cluster, you have to create a pod, which encapsulates the container and ensures that a specified quorum of running instances is fulfilled. To do that, use the deployment.yaml.

  5. Apply the resource file in your cluster to deploy the application.

    kubectl apply -f https://raw.githubusercontent.com/SAP-samples/btp-hyperscaler-extension/master/k8s/deployment.yaml -n sapfiori
  6. Check that the status of the deployed application in your cluster is Running.

    kubectl get pods -n sapfiori
    
    |NAME|READY|STATUS|RESTART|AGE|
    |-------|----|-------|--------|---------|
    |`fioriapp-##-##`| `1/1`|`Running`|`##`|`##`|
    
    

Run the deployed application using load balancer

  1. Kubernetes provides a convenient way to expose applications. With --type=LoadBalancer you request to provision a public IP address. It will also automatically assign a cluster-IP and a Node Port in the current setup of the cluster.

  2. Apply the resource file in your cluster to deploy the application.

    kubectl apply -f https://github.com/SAP-samples/FioriApp-Hyperscaler/blob/master/k8s/loadbalancer.yaml -n sapfiori
  3. To find the deployed load balancer IP, use the following command:

    kubectl get services -n sapfiori
    
  4. Copy the load balancer IP from the output and run in a browser with port 5000

    finalimage

How to obtain support

Create an issue in this repository if you find a bug or have questions about the content.

For additional support, ask a question in SAP Community.

License

Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published