Add a user to the Kubernetes Dashboard

For security reasons, the access to the Kubernetes Dashboard requires basic authentication. The file /opt/bitnami/kubernetes/auth stores all the access credentials. If you want to add a new credential, do the following:

  • Create a new credential using OpenSSL. Substitute the USER and PASSWORD credentials.

      $ export NEW_CREDENTIAL=USER:$(echo PASSWORD | openssl passwd -apr1 -noverify -stdin)
  • Append the previously created credential to /opt/bitnami/kubernetes/auth.

      $ echo $NEW_CREDENTIAL | sudo tee -a /opt/bitnami/kubernetes/auth
  • Replace the cluster basic-auth secret.

      $ kubectl delete secret basic-auth -n kube-system
      $ kubectl create secret generic basic-auth --from-file=/opt/bitnami/kubernetes/auth -n kube-system
  • Replace the ingress rule dashboard-rule so the new secret is applied.

      $ kubectl delete -f /opt/bitnami/kubernetes/manifests/kubernetes-dashboard-ingress.yaml
      $ kubectl create -f /opt/bitnami/kubernetes/manifests/kubernetes-dashboard-ingress.yaml
Last modification September 4, 2018