Ingress controllers

Lenses exposes a web interface and Rest endpoints. To access outside of the Kubernetes cluster Lenses can be deployed with an ingress controller. A loadbalancer is required.

# Install NGINX Ingress controller
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
helm install stable/nginx-ingress --name <RELEASE-NAME>
# Install Traefik Ingress controller
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
helm install stable/traefik --name <RELEASE-NAME>

Check the status of the deployment.

# Traefik's load balancer state
kubectl get svc <RELEASE-NAME>-traefik -w

Get the external IP of the loadbalancer.

# Once 'EXTERNAL-IP' is no longer '<pending>':
kubectl describe svc <RELEASE-NAME>-traefik | grep Ingress | awk '{print $3}'

Instead of an IP address you can use a DNS. This different dependent on your kubernetes provider.

#!/bin/bash

# Public IP address of your ingress controller
IP="<EXTERNAL-PUBLIC-IP-ADDRESS>"

# Name to associate with a public IP address
DNSNAME="<YOUR-DNS-NAME>"

# Get the resource-id of the public ip
PUBLICIPID=$(az network public-ip \
  list \
  --query "[?ipAddress!=null]|[?contains(ipAddress, '$IP')].[id]" \
  --output tsv)

# Update public ip address with DNS name
az network public-ip update --ids $PUBLICIPID --dns-name $DNSNAME

Once you have the external-ip or DNS enable ingress on the Lenses Helm chart and set the host accordingly.

helm install lensesio/lenses \
  --name lenses \
  --namespace lenses \
  --set ingress.enabled=true, ingress.host=<MY_EXTERNAL_ID>