How to install Kubernetes security dashboard for secure authentication?

I recently installed Kubernetes using the Kubernetes Operations tool, but when I installed the Kubernetes Dashboard using this script, the dashboard endpoints were in a private cluster.

Is there a way to publish this dashboard on a public network using something like a service type LoadBalancerand put it behind a password or secure authentication?

There are many possibilities that can be done with such a control panel, so I would like to get it behind a secure endpoint.

+4
source share
1 answer

Ingress (http://kubernetes.io/docs/user-guide/ingress/) NginX IngressController (https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx)

- :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dashboard.mydomain.tld
  namespace: kube-system
  annotations:
    kubernetes.io/ingress.class: "nginx"
    ingress.kubernetes.io/auth-type: basic
    ingress.kubernetes.io/auth-realm: "Auth required"
    ingress.kubernetes.io/auth-secret: htpasswd
spec:
  rules:
  - host: dashboard.mydomain.tld
    http:
      paths:
      - path: /
        backend:
          serviceName: <dashsvc>
          servicePort: <dashport>

htpasswd ,

apiVersion: v1
kind: Secret
metadata:
  name: htpasswd
  namespace: kube-system
type: Opaque
data:
  auth: <your htpasswd base64>

: , . kube-lego https,

+5

Source: https://habr.com/ru/post/1660788/


All Articles