Deploy SAP Cloud Connector in Kubernetes

I was wondering if it was possible to run the SAP Cloud Connector in a Kubernetes Cluster to improve its availability. If you have a onPremise Cluster or a connection to a cloud provider like Google, AWS or Azure you can also deploy it there.

Basic Information

Some of you might ask, what the SAP Cloud Connector actually is and what it does. The Cloud Connector sets up a reverse proxy to the SAP Cloud Platform and therefore allows the Cloud Platform to access onPremise resources. It offers an easy way to expose your resources in a controlled manner without opening your firewalls to inbound traffic. It is one of the most important components of a hybrid SAP environment and should not go offline unexpectedly. The Cloud Connector offers a failover which needs about 10-20 seconds to detect and take over if you crank the detection and take over time to a minimum. This is far from ideal, but that is a factor we can and will not change here.
Our goal is to keep the software up and running and if it fails and the failover takes over, we want the, prior master, now failover instance, to come back up and support the new master instance if it fails. Furthermore if an instance fails and/or gets in an unresponsive state and the other instance does not detect this, we simply kill the pod and reschedule it to prevent further downtime. To achieve this we need a tool which allows us to do all this stuff, in one word: Kubernetes

I have worked with Kubernetes before and it was a lot of fun to deploy an application and run in inside of the cluster.

Prepare Deployment

First of all you need a docker repository which includes a cloud connector container. I have used the Dockerfile from Nabi Zamani to build my container and I adjusted the helm chart to match these file. Because he did not pushed his Dockerfile to Docker hub you have to build and push it to your repo first. I have prepared a helm chart which will simplify the deployment for you.

At first you need to add the repository and update your repos:

helm repo add sapcc-helm https://timoschuetz.gitlab.io/scchelm

Now you have to update your repos to ensure that you are able to pull from the recently added repository.

helm repo update

Now you need to prepare a values.yaml which will hold the image name and some other parameter that you will need to adjust before deploying.

# Default values for sapcloudconnector.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
  repository: IMAGE
  tag: 2.12.0.1 
  pullPolicy: IfNotPresent

imagePullSecrets: 
  - name: regcred
nameOverride: ""
fullnameOverride: ""

service:
  type: ClusterIP
  port: 8443

persistence:
  enabled: true
  createpvc: true

ingress:
  enabled: true
  hostname: HOSTNAME
  tls: true
  secret: cert2

  annotations: 
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

resources: {}
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

Deploy it

After you finished the configuration of the values.yaml we are good to go to deploy our application on the cluster. The command to do this is:

helm install --name cloudconnector-1 -f values.yaml sapcc-helm/sapcloudconnector

Now helm will deploy our application on our cluster. And we can setup kubectl to proxy the request to our local machine, so that we can reach it easily.

kubectl port-forward PODNAME 8443

Now connect to it using your preferred browser and skip the ssl error message: And we can log in with the default credentials username Administrator and password manage:

That’s all I have right now. Feel free to play around with it

comments powered by Disqus