Access Kubernetes Web Interfaces from the Outside

- devops kubernetes traefik

Here is a simple yet useful trick to access web interface within your cluster.

As stated in the Kubernetes documentation you can use kubectl proxy.

I’ve seen a lot of people using the proxy to access the dashboard but you can use it to access any web interfaces, without the need to create an ingress and protect it, especially useful in dev environment.

http://kubernetes_master_address/api/v1/namespaces/namespace_name/services/service_name[:port_name]/proxy

For example here is how to access the Traefik dashboard described as follow:

apiVersion: v1
kind: Service
metadata:
  name: traefik-dashboard
spec:
  type: ClusterIP
  selector:
    app: traefik
    release: traefik
  ports:
  - name: dashboard-http
    port: 80
    targetPort: 8080

http://localhost:8001/api/v1/namespaces/default/services/http:traefik-dashboard:dashboard-http/proxy/dashboard/#!/service?namespace=default