1

have a 2 node microk8s cluster running on 2 Vagrant VMs (Ubuntu 20.04). trying to forward port forward 443 from host so I can connect to dashboard from the host PC over the private VM network.

sudo microk8s kubectl port-forward -n kube-system service/kubernetes-dashboard 10443:443

receive the following error:

error: error upgrading connection: error dialing backend: dial tcp: lookup node-1: Temporary failure in name resolution

also noticed that the internal IPs for the nodes are not correct:

enter image description here

the master node is provisioned with an IP of 10.0.1.5 and the worker node 10.0.1.10. in the listing from kubectl both nodes have the same IP of 10.0.2.15.

not sure how to resolve this issue.

note I am able to access the dashboard login screen from http and port 8001 connecting to 10.0.1.5. but submitting the token does not do anything as per the K8s security design:

Logging in is only available when accessing Dashboard over HTTPS or when domain is either localhost or 127.0.0.1. It's done this way for security reasons.

50missionCap
  • 75
  • 1
  • 6

1 Answers1

0

was able to get passed this issue by adding the nodes to the /etc/hosts file on each node:

10.1.0.10       node-1
10.1.0.5        k8s-master

then was able to restart and issue the port forward command:

sudo microk8s kubectl port-forward -n kube-system service/kubernetes-dashboard 10443:443 --address 0.0.0.0 
Forwarding from 0.0.0.0:10443 -> 8443

then was able to access the K8s dashboard via the token auth method

50missionCap
  • 75
  • 1
  • 6