Skip to main content

Ξ 🛣️ Ingress

KubernetesService

Ingress ensures that the external request are secured and routed to the correct target.

It implements the needed authentication and authorisation controls defined by Datalayer IAM.

  • HTTP requests are redirected the target service.
  • SSH requests are handled to ensure access to the Git repositories as for the SSHFS mounting support.

You will need to choose one of the following options to implement the Ingress:

  • Ingress Traefik.
  • Ingress Nginx - This is deprecated as suffering from IP availability latency.

Deploy Ingress Traefik

helm repo add traefik https://traefik.github.io/charts
helm repo update
plane up datalayer-traefik
plane ls

Check the availability of the Ingress Traefik Pods.

kubectl get pods -n datalayer-traefik

Ensure the datalayer-traefik Ingress Class is available.

kubectl get ingressclass
# NAME CONTROLLER PARAMETERS AGE
# datalayer-traefik traefik.io/ingress-controller <none> 116m

[DEPRECATED] Deploy Ingress Nginx

Instead of Traefik, you may deploy Nginx (watch out for potential latency for the creation of the Ingress Kubernetes objects, impacting the Datalayer Jupyter service).

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
plane up datalayer-nginx
plane ls
kubectl get pods -n datalayer-nginx

Ensure the nginx Ingress Class is available.

kubectl get ingressclass
# NAME CONTROLLER PARAMETERS AGE
# nginx nginx.org/ingress-controller <none> 116m

Update DNS

Take note of the IP address (or in the EKS case, the hostname), you will need that to update your DNS. In the below example, the IP address is 10.100.113.174.

For Ingress Traefik.

POD_NAME=$(kubectl get pods -l app.kubernetes.io/name=traefik -n datalayer-traefik -o jsonpath='{.items[0].metadata.name}')
kubectl describe pod $POD_NAME -n datalayer-traefik
kubectl get svc datalayer-traefik -n datalayer-traefik -w
# datalayer-traefik LoadBalancer 10.100.113.174 <A.B.C.D> 80:32664/TCP,443:32671/TCP 11m

[DEPRECATED] For Ingress Nginx.

POD_NAME=$(kubectl get pods -l app.kubernetes.io/name=ingress-nginx -n datalayer-nginx -o jsonpath='{.items[0].metadata.name}')
kubectl describe pod $POD_NAME -n datalayer-nginx
kubectl exec -it $POD_NAME -n datalayer-nginx -- /nginx-ingress-controller --version
kubectl get svc datalayer-nginx-ingress-nginx-controller -n datalayer-nginx -w
# datalayer-nginx-ingress-nginx-controller LoadBalancer 10.100.113.174 <A.B.C.D> 80:32664/TCP,443:32671/TCP 11m

Create a A DNS record (or CNAME if the Load Balancer gave you a hostname) to resolve the DATALAYER_RUN_HOST hostname to the Load Balancer IP address.

In the previous example, DATALAYER_RUN_HOST should be resolved to 10.100.113.174.

# 10.100.113.174 $DATALAYER_RUN_HOST
nslookup $DATALAYER_RUN_HOST

Tear Down Ingress

If needed, tear down the Ingress.

Tear down Ingress Traefik.

plane down datalayer-traefik

[DEPRECATED] Tear down Ingress Nginx.

plane down datalayer-nginx