Accessing Minikube on remote server via server IP

Hello all,

I’m running an instance of JupyterHub on a remote server at my university using Minikube and microk8s on bare metal following the Zero to JupyterHub on Kubernetes tutorial. The application should be accessible via the local school network by simply typing in the server address and port in the browser, in this case ranger00.cs.txstate.edu:443, but it’s not.

The full sequence of commands I’m using is:

minikube start
minikube tunnel (in another terminal)
helm repo update
helm upgrade --cleanup-on-fail --install greencodejhub jupyterhub/jupyterhub --namespace jhub --create-namespace --version=1.1.3 --values config.yaml --timeout=120m

Then I run kubectl get service --namespace jhub, which outputs something like:

NAME           TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE
hub            ClusterIP      10.104.184.64   <none>          8081/TCP                     44m
proxy-api      ClusterIP      10.97.213.73    <none>          8001/TCP                     44m
proxy-http     ClusterIP      10.100.87.27    <none>          8000/TCP                     44m
proxy-public   LoadBalancer   10.98.187.240   10.98.187.240   443:31963/TCP,80:30130/TCP   44m

I’ve been able to access JupyterHub simply by running ngrok http 10.98.187.240, but now need to access it directly via the address on the school network. I believe my problem has something to do with the fact that the external IP assigned doesn’t match the external IP of the server (147.26.100.110) even though when I set up MetalLB I only gave it that address with microk8s enable metallb:147.26.100.110-147.26.100.110. I had previously given it a range of IPs starting with 10, but even after disabling and re-enabling MetalLB it still gives me a different address every time starting with 10. I’m quite new to Kubernetes and Docker though so it’s very possible I’m doing something else wrong, possibly with the ports. Please let me know if I should provide any other info.

System parameters:
Kubernetes 1.22.2
Docker 20.10.8
Minikube 1.23.2
microk8s 1.21.8
Ubuntu 18.04.5

My Dockerfile:

# Base image from https://hub.docker.com/layers/jupyter/tensorflow-notebook/lab-3.1.12/images/sha256-0a5a66d820e203d32f1063fda1219830a3a74bd121876dd2e85a119c36e134ca?context=explore
ARG BASE_CONTAINER=jupyter/tensorflow-notebook:latest
FROM $BASE_CONTAINER

LABEL maintainer="Texas State EECS Group"

# # Install C++ Kernel and fix permissions
RUN conda install --quiet --yes \
       xeus-cling -c conda-forge \
       && \
       conda clean --all -f -y && \
       fix-permissions "${CONDA_DIR}" && \ 
       fix-permissions "/home/${NB_USER}"

WORKDIR /home/jovyan

ENV DISPATCH_SERVER='http://192.168.100.100:9898'

RUN export JUPYTERHUB_SINGLEUSER_APP='jupyter_server.serverapp.ServerApp'

# Install JupyterLab extension
RUN pip install -i https://test.pypi.org/simple/ jlab-ext-example==1.0.11

EXPOSE 443

My config.yaml:

proxy:
        https:
                enabled: true
                hosts:
                        - ranger00.cs.txstate.edu
                letsencrypt:
                        contactEmail: tjv29@txstate.edu
        secretToken: '74cde9677bd0f04f4b7c034e887ac93aac42195f26734e833d721dbb75d55c58'
        service:
                loadBalancerIP: 147.26.100.110
singleuser:
        image:
                name: codestar12/greenhub_user
                tag: latest
        defaultUrl: "/lab"
        extraEnv:
                JUPYTERHUB_SINGLEUSER_APP: "jupyter_server.serverapp.ServerApp"
                DISPATCH_SERVER: "http://192.168.100.100:9898"
hub:
        config:
                Authenticator:
                        admin_users:
                                - TrevorVillwock
                DummyAuthenticator:
                        password: bobcat
                JupyterHub:
                        authenticator_class: dummy                
debug:
        enabled: true

Output of sudo ufw status:

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  
192.168.100.101            ALLOW       Anywhere                  
192.168.100.100            ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
8888                       ALLOW       Anywhere                  
8443                       ALLOW       Anywhere                  
8081                       ALLOW       Anywhere                  
8080                       ALLOW       Anywhere                  
22/tcp (v6)                ALLOW       Anywhere (v6)             
443/tcp (v6)               ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)             
8888 (v6)                  ALLOW       Anywhere (v6)             
8443 (v6)                  ALLOW       Anywhere (v6)             
8081 (v6)                  ALLOW       Anywhere (v6)             
8080 (v6)                  ALLOW       Anywhere (v6)             

Anywhere                   ALLOW OUT   192.168.100.10