qlik-py-tools icon indicating copy to clipboard operation
qlik-py-tools copied to clipboard

Running the extension in kibertnetes cluster

Open hammamr opened this issue 4 years ago • 6 comments

Hello Nabeel,

The POC on the local machine with QlikSense dektop and docker desktop for Windows was conclusive. The next step is to run the extension into the enterprise kibernetes cluster.

So we created three .yaml files (deployment, service and ingress), see the attached file (yaml.zip). Then we created the deployment, service and ingress with kubectl commands using the .yam files.

And finally we configured the Analytics connection in QMC.

However we are not able to get the extension working in QlikSense, it seems that the service is not exposed correctly.

When we expose the deployment using this kubectl command, the extension is exposed correctly and we can use it in QlikSesnse using the external IP in the analytics connection configuration in QMC. kubectl expose deployment qliksense-qqsens-datascience --type=LoadBalancer --name=qliksense-qqsens-datascience-test-load-balancer2 Do you have an idea on how to expose the service correctly using . YAML file with a configured DNS ? Have you already run the extension in kibernetes ? Does the service support type: NodePort in the service YAML file ?

What is the protocol used in the communication between the extension and Qlik ? Is there a simple way to check if the extension is working from commande line? for example from the kibernetes linux client machine.

Best regards. Sidi

yaml.zip

hammamr avatar Jun 29 '20 08:06 hammamr

Hi Sidi,

The communication between the SSE and Qlik is using the gRPC protocol. Last time I checked this needed some extra config for load balancing.

I don't have much experience with Kubernetes. The repository below might help. It includes PyTools and a couple of other SSE's deployed for use with Qlik Sense Enterprise on Kubernetes.

https://github.com/AnalyticsEarth/qlik-k8s-demo-resources

Cheers, Nabeel

nabeel-oz avatar Jul 01 '20 23:07 nabeel-oz

Hello Nabeel,

Finally we deployed the extension on kibernetes and it's working fine. We had to expose the service in LoadBalancer mode, and we don't need ingress because it is not of type http/https.

However, we need to setup readinessProbe and livenessProbe for kibernetes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).

To do so, we need to execute a command to check if the extension is ready and another command to check if the extension is working.

Do you have an idea of what commands we can excute to check the readiness and liveness of the extension ?

Best Regards Sidi

hammamr avatar Sep 14 '20 08:09 hammamr

Hi Sidi,

Glad you have the extension running on Kubernetes.

I think you may be able to set the probes using a gRPC CLI (e.g. https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md).

You could check that the gRPC service is exposed at the given port and call the GetCapabilities function to check that the service is live.

nabeel-oz avatar Sep 15 '20 05:09 nabeel-oz

Hi Nabeel,

Thanks for the answer. I would like to know if the docker image of the extension already contains a gRPC CLI ? Because the commands of liveness and readiness are executed inside the conatiner (POD in K8S).

Best Regards. Sidi

hammamr avatar Sep 17 '20 11:09 hammamr

Hi Sidi,

The docker image I publish doesn't contain a gRPC CLI, so you'd have to build a new image. You can refer to the docker files here.

You could build a new image starting with PyTools v.8.1 as the parent image.

# Use the previous version of qlik-py-tools as a parent image
FROM nabeeloz/qlik-py-tools:8.1

# Set the working directory to /qlik-py-tools/core
WORKDIR /qlik-py-tools/core

...

# Make ports 80 and 50055 available to the world outside this container
EXPOSE 80 50055

# Run __main__.py when the container launches
CMD ["python", "__main__.py"]

nabeel-oz avatar Sep 18 '20 05:09 nabeel-oz

Hello,

Ok thanks, I will see to do that. If you integrate a gRPC CLI in the next version of the image that will be great, so that we could implement liveness and readiness probes natively in kubernetes.

Best Regards. Sidi

hammamr avatar Oct 12 '20 07:10 hammamr