Deploy a Jupyter Environment on a Kubernetes Cluster#

In this tutorial we will go through the required steps to deploy a Jupyter environment as a Job on a Kubernetes cluster. We will use the MAIA/mkg Helm Chart to deploy the PyTorch Application. For correctly deploying the application from the Helm Chart, we first need to install Helm:

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

We will also need to install the MAIA Helm Chart Repository:

helm repo add maia https://github.com/kthcloud/MAIA
helm repo update

We need also to set the KUBECONFIG environment variable to the path of the kubeconfig file of the cluster we want to deploy the application on.

Generate Configuration#

Next, we need to create the configuration dictionary, containing the required information for the deployment of the application.

We will use the custom Jupyter Image generated in the previous tutorial, requesting a deployment for 10 minutes, exposing the Jupyter port 888 to test-jupyter.app.cloud.cbh.kth.se

[ ]:
%%writefile jupyter.json
{
  "namespace": "<NAMESPACE>",
  "chart_name": "demo-jupyter-v1",
  "docker_image": "registry.cloud.cbh.kth.se/maia/jupyter-demo",
  "tag": "1.2",
  "allocationTime": "10m",
    "env_variables": {
    "PW": "MAIA"
  },
    "ports": {
    "jupyter": [
      8888
    ]
  },
      "ingress": {
    "host": "test-jupyter.app.cloud.cbh.kth.se",
    "port": "8888",
    "path": "",
    "nginx_issuer": "<ISSUER>"
  },
    "image_pull_secret": "<SECRET>"
}

[ ]:
%%bash
export KUBECONFIG=<KUBECONFIG>
MAIA_deploy_helm_chart --config-file jupyter.json

Check Application#

After completing the Chart deployment, the app should be available at: test-jupyter.app.cloud.cbh.kth.se.

Use the password set on the configuration (PW) to authenticate.