Deep MNIST Webapp

This documentation will show you how to setup the Deep MNIST webapp on your Kubernetes cluster. The webapp is a flask application with a javascript front-end. It takes as input a drawing from the user and outputs predictions that it gets from the seldon deep MNIST microservice.

Prerequisites

Getting the client key and secret

The webapp will communicate with the client via a REST API. It needs to authenticate using a client key and secret. We will use the seldon cli to obtain the key and secret.

seldon-cli keys  --client-name deep_mnist_client --scope all

More detail on how to use the seldon cli can be found in our seldon-cli documentation.

Getting the IP address of seldon-server

To find out the internal IP address of the seldon-server container in your cluster use the following command:

kubectl get services seldon-server

You will need to give this IP address to your webapp in the next step so that it knows where to query for predictions.

Start the webapp

The webapp is available prepackaged in a docker container seldonio/deep_mnist_webapp on dockerhub. The source code can be found here. We are going to start the webapp from the docker image using the following command:

kubectl run deep-mnist-webapp --image=seldonio/deep_mnist_webapp:1.2 --port=80 --command -- "/run_webapp.sh" "<seldon-server-ip>" "<key>" "<secret>"

Now we need to expose port 80 so that the webapp can be accessed outside your cluster:

kubectl expose deployment/deep-mnist-webapp --type="LoadBalancer"

Try it out!

This is it, you should now be able to access the webapp on your browser. First, find out the external IP address of the webapp by running:

kubectl get services deep-mnist-webapp

Now you can just go to http://<external-ip>:80 in your favorite browser.