Skip to Content
Technical Articles

Deploy K8s Web UI to SAP Data Hub trial on AWS

If you followed my previous post Connect kubectl to SAP Data Hub trial on AWS then you get installation of kubectl command-line tool to run commands against Kubernetes clusters, like the one used by SAP Data Hub, trial edition.

But if you are as lazy as I am, then you would like to have nicer app to click through some of the most common commands i/o typing them. Web UI (Dashboard) is a web-based Kubernetes user interface.

1. Setup tools on Windows laptop

In previous post I setup Cloud9 instance – as one of AWS solution engineers recommended me. But I would like to have all them locally. Especially that I found it is not all that straightforward and safe to use Cloud9 instance as a proxy to K8s Dashboard.

Really, the only two tools I needed are aws CLI and kubectl. I had Python3 already on my laptop, so aws installation was simple.

The tricky part was kubectl, because “You must use a kubectl version that is within one minor version difference of your cluster.” And because my cluster K8s version on AWS is 1.11 (for current SAP Data Hub 2.5), it was quite a few minutes to find corresponding client version.

Gotcha: Finally I found it at https://v1-12.docs.kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl. And yes, I am using one minor version higher, so that I do not need to reinstall it for Data Hub 2.6, which is based on 1.12.

2. Setup Kubernetes context

It was not much different comparing to previous post, so basically following commands. caltdc-58597878-I076835 is the name of my cluster, as returned by aws eks list-clusters.

aws configure
aws sts get-caller-identity
aws eks list-clusters
aws eks update-kubeconfig --name=caltdc-58597878-I076835
kubectl config current-context

3. Deploy K8s Dashboard

Deploying K8s Dashboard, which by itself is a containerized application, is simple.

Gotcha: you need to be careful what version you are deploying, as different documentation pages have deployment commands for different versions. I checked the page https://github.com/kubernetes/dashboard/releases and found there is no version fully compatible with K8s version 1.11 :-O

So, I picked https://github.com/kubernetes/dashboard/releases/latest, which was 1.10.1 at the time of writing the post.

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

4. Enable kubectl proxy

That’s the tricky part, as to access it you need to create a proxy and to know the API URL. And it was even more tricky on Cloud9 instance, so I decided to have it on my local laptop.

kubectl proxy

By default the proxy is using port 8001, but it is configurable with the --port option.

5. Open the K8s Web UI

The deployed version of Dashboard is available via /api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ API, so accessible from following URL:

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

6. Log into the Dashboard

The default login method for the current version is a security token.

The method to obtain it described in the documentation is to get a token from a secret of a service user of a cluster. But I could not find the one in the current cluster with authorizations to get information for all resources that can be shown in the Dashboard.

So, I ended up using a token generated from aws eks command. Unfortunately it is time-restricted, meaning every now and then you need to logout the Web UI, regenerate a token, and login again.

aws eks get-token --cluster-name caltdc-58597878-I076835

Make sure you copy only token value part. Now go back to the login screen of the Web UI and paste the token value.

If the token was correct, then you should be logged into the dashboard.

7. Basic steps in the Web UI

Switch the namespace to datahub. You can see workload statuses, and monitor and troubleshoot different K8s resources, like deployments, pods, services etc, which make up SAP Data Hub installation.

Just make sure you know what you are doing. Remember: with great power comes great responsibility!


Happy datahubing,

-Vitaliy (aka @Sygyzmundovych)

Be the first to leave a comment
You must be Logged on to comment or reply to a post.