Skip to Content
Personal Insights
Author's profile photo Piotr Tesny

Taming SAP HANA Express database Docker edition with k8s – Gardener

Gardener1.52.2

Universal Kubernetes at Scale

2.00.061.00.20220519.1

SAP BTP – an enterprise-grade Business Technology Platform and their eponymous SAP HANA database are now both accessible to indie developers and IT professionals.

And SAP is turning 50 this year:)

This brief is to demonstrate how one could create a technology playground and upscale her or his SAP HANA, linux and cloud native skills with SAP HANA Express database deployed on a kubernetes cluster.

Why so? According to a recent survey by UKISUG,  there is a growing uptake of S/4HANA and at the same time there is a shortage SAP HANA (and linux) skills on the market.

With the Innovation Commitment for SAP S/4HANA set until 2040…And with a very strong appeal of cloud native technologies, with kubernetes leading that appeal…

So what about learning …. two birds with one …..?


Pre-requisites:

  • For SAP internal audience only – have access to a trial service plan on SAP Gardener account.
  • For all audiences – have access to SAP BTP free-tier global account with access to a Kyma runtime cluster in a sub-account of this global account.
  • Alternatively, set up your own open source Gardener Project k8s cluster (on any infrastructure of your choice. see https://gardener.cloud/docs/gardener/#setting-up-your-own-gardener-landscape-in-the-cloud for more information).
  • Access to a docker hub account. We shall be using a public SAP HANA express database edition docker image from docker hub and deploy it “as is” on our kubernetes (k8s) gardener trial cluster (or BTP free-tier kyma cluster).
  • A tablet or a laptop browser with internet access (either mobile or broadband).

Disclaimer:

  • The ideas presented in this blog are personal insights thus not necessarily endorsed by SAP.

  • This is a playground only. All k8s deployment examples, code snippets, gists, etc are provided “as is”.
  • Images/data in this blog post is from a Gardener sandbox and/or demo systems. Any resemblance to real data is purely coincidental.
  • Access to some resources referenced in this blog may be subject to a contractual relationship with SAP and a S-user login may be required. Always refer to T&C.

Good to know:

  • if your focus were rather on SAP HANA Cloud I would encourage you take the following free learning module instead.
  • As announced at TechEd 2021, SAP is offering free access to its https://learning.sap.com/ learning hub and learning journeys https://learning.sap.com/learning-journey. Make sure you take advantage of these journeys to get training and up-skill yourself.

Putting it all together

In a way this instalment is a follow-up to the previously published Taming SAP HANA Express database Docker edition with MacOS – prepare blog. (I had been even planning to write up a configure part to it but eventually dropped the idea as I got frustrated with the prospect of having to maintain a local docker image on my laptop forever.)

So why kubernetes (k8s)? Well, with k8s one can describe a desired state management as text – a sequence of yaml declarative instructions – and have a k8s cluster fulfil these instructions.

Get your k8s cluster ready.

The rationale.

How to prepare a k8s cluster?

  • have a k8s cluster deploy a public hana express docker image on your behalf using a single deployment text (yaml) file and not spend time on installing it.
  • rather spend time on exploring SAP HANA features like its built-in multi-tenancy model, its linux tooling, its data modelling and analytics, its connectivity via Cloud Connector, etc.
  • Detailed transcripts of all operations are enclosed in gists.
  • Gardener setup. As aforementioned, this is accessible to SAP internal audience only.
  • Alternatively, set up your own open source Gardener Project k8s cluster (on any infrastructure of your choice.)
  • In lieu, and for all, a SAP BTP free-tier kyma cluster can be used as well. Please refer to public SAP Help pages for guidance.

SAP HANA Express Deployment

In order to deploy a public hana express database docker image on your k8s cluster follow the steps below and detailed gist instructions accordingly.

Steps1,2 and 3 relate to k8s cluster; Steps 4 and 5 relate to hxe database

Step1 (k8s) — Create a dedicated namespace hxe to manage the hana express workload…

Step2 (k8s) — Create docker secret in that namespace…

This is a mandatory step. Please make sure you create the secret in the namespace(s) that will be used for the deployment.

$ kubectl create secret docker-registry mydockerregsecret -n hxe --docker-server https://index.docker.io/v1/ --docker-password <Password> --docker-username <username> --docker-email <email_address>
secret/mydockerregsecret created

Step3 (k8s) — Deployment process on k8s cluster

Assuming you have created the docker hub secret you can proceed with the deployment activities.

What? — Activities

How? — Instructions (gists)

Here goes a single deployment file with a persistent volume claim declaration for /hana/mounts volume mapping.

The deployment should not take more than five minutes. While it is in progress you may:

The last step is to create an API rule to get HTTP access to the webdispatcher service on port 80xx (8090 in this case)




Step4 (hxe) — Post deployment activities – prepare and configure hana database

https://help.sap.com/viewer/product/SAP_HANA_PLATFORM/latest/en-US?task=discover_task

After successful deployment you may need to:

  • check your deployment
  • download and populate some content and then reconfigure the webdispatcher,
  • create an admin user on the tenant database with a never expiring password and assign it selected admin roles.

Last but not least, pretty much everything can be done in-place, from within the hana express container itself, using a terminal pod in a browser.






Disclaimer.

  • All the above steps were rehearsed on Gardener k8s trial cluster with Kyma 2.0. (They may not work “as is” on a BTP free-tier managed kyma cluster.)
  • Please note that a BTP free-tier managed kyma cluster has one single node and the gardener trial cluster is a two-node cluster thus deploying hxe on a single node cluster may slightly vary.

Step5 (hxe) — Probes

Probe type

Probe details

HANA Workbench

 

<API Rule>/sap/hana/ide/

HANA XS Admin

<API Rule>/sap/hana/xs/admin/

Webdispatcher Admin

<API Rule>/sap/hana/xs/wdisp/admin/public/default.html

GetServerInfo
  • <API_Rule>/sap/bc/ina/service/v2/GetServerInfo
Cubes
  • <API_Rule>/sap/bc/ina/service/v2/GetResponse?Request={%22Metadata%22:{%22Expand%22:[%22Cubes%22]}}
SHINE (SAP HANA Interactive Education)

 

<API_Rule>/sap/hana/democontent/epm/ui/NewLaunchpad.html


  • <API_Rule>/sap/hana/democontent/epm/ui/salesDashboard/index.html

SAP Analytics Cloud: create a tunnel connection via SAP Cloud Connector

 

The above story is embedded in an iframe and can be securely accessed from anywhere by authorised business users.

A business user identity propagation and resources access has been implemented with the OAuth2SAMLBearerAssertion flow as explained in SAP Analytics Cloud App Integration with OAuth2SAMLBearerAssertion flow. 

  • 2597946 – How to enable iframe embedding with SAP Analytics Cloud?

Conclusion

Last but not least, I hope you enjoyed reading this blog. Please provide your feedback in the comments section below.

SAP is about to celebrate its 50th anniversary. Impressive isn’t it!

A birthday card. I started writing this blog roughly half a year ago. In the meantime we got kyma 2.0 and hana express 2.57, so I had to revisit and retest everything.

So be it my birthday card…

Best wishes and Happy Birthday to SAP.

 


 

Troubleshooting

Please refer to this gist for details on:

  • Port forwarding and
  • Managing Persistent volume claim

 

Additional resources

 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Really cooool blog Piotr! 😎👍

      I tried to deploy on BTP Free Tier Account Kyma Landscape - unfortunately, it didn't work 😟

      I first had to turn down memory consumption - however, this didn't help a lot.

      I would be very grateful for any kind of hints to make it work on BTP free tier, since I don't want to install HXE locally on my Laptop 🙏

      br

      Thorsten

      Author's profile photo Piotr Tesny
      Piotr Tesny
      Blog Post Author

      Thank you Former Member,

      I just checked and it does work. Actually it does work very well...

      Yes of course you need to set the requested memory in the deployment to either 8000Mi or 8Gi. Then, the deployment should go ahead and succeed.

      As this is a single node SKR (==SAP BTP, Kyma Runtime) you need to make sure there is enough CPU requests headroom. For instance in my case there is plenty of CPU headroom to go through all the configuration steps:

      kubectl describe  nodes --kubeconfig ~/.kube/kubeconfig--shoot--kyma--<your shoot id>.yaml
      
      
      Allocated resources:
        (Total limits may be over 100 percent, i.e., overcommitted.)
        Resource           Requests          Limits
        --------           --------          ------
        cpu                2226m (56%)       1012800m (25836%)
        memory             6317423088 (41%)  47308352Ki (316%)
      
      ```
      
      
      and after the hxe deployment:
      
      ```
      Allocated resources:
        (Total limits may be over 100 percent, i.e., overcommitted.)
        Resource           Requests           Limits
        --------           --------           ------
        cpu                2236m (57%)        1013050m (25843%)
        memory             14739585520 (96%)  59856448Ki (400%)
      

       

        Namespace                   Name                                                          CPU Requests  CPU Limits   Memory Requests  Memory Limits     AGE
        ---------                   ----                                                          ------------  ----------   ---------------  -------------     ---
        default                     hxe-c796665d4-zzzzzzz                                           10m (0%)      250m (6%)    8032Mi (55%)     12254Mi (83%)     19h
      

       

      Please send across the stats from your SKR node describe command before and after the attempted hxe deployment.

      I hope that helps; kind regards;Piotr

      Author's profile photo Former Member
      Former Member

      Thanks a lot for the instant reply, Piotr!

      I adjusted memory request to 8000M - however, it still immediately chrashes 🙁

      Here are my node describe results:

      before:

      Allocated resources:
        (Total limits may be over 100 percent, i.e., overcommitted.)
        Resource           Requests          Limits
        --------           --------          ------
        cpu                2011m (51%)       11300m (288%)
        memory             5925008630 (39%)  24633Mi (170%)
        ephemeral-storage  0 (0%)            0 (0%)
        hugepages-1Gi      0 (0%)            0 (0%)
        hugepages-2Mi      0 (0%)            0 (0%)

      after:

      Allocated resources:
        (Total limits may be over 100 percent, i.e., overcommitted.)
        Resource           Requests           Limits
        --------           --------           ------
        cpu                3021m (77%)        13550m (345%)
        memory             14347171062 (94%)  44887Mi (311%)
        ephemeral-storage  0 (0%)             0 (0%)
        hugepages-1Gi      0 (0%)             0 (0%)
        hugepages-2Mi      0 (0%)             0 (0%)

       

      Piotr, can you maybe append your deployment yaml? 

       

      Author's profile photo Piotr Tesny
      Piotr Tesny
      Blog Post Author

      Hi Thorsten, here you go; I used the kyma dashboard to deploy it; kind regards; Piotr; 

      PS. just delete your hxe deployment first;  (no need to remove other resources like pvc or virtual service which will be updated...); 

      Author's profile photo Former Member
      Former Member

      Thanks a lot Piotr! I'll compare it to my configuration.

      Author's profile photo Former Member
      Former Member

      Hurrrrray - It's running! (after adjusting to your yamls) 🥳🥳🥳

      Many thanks, Piotr!