In this section, we'll do a walk-through to access the recently installed Kubernetes dashboard.
- First, check if the internal DNS server is accessible and resolves the hostname IP address:
$ kubectl exec -it busybox -- cat /etc/resolv.conf
nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local servicemesh.local
options ndots:5
- Check the internal service name resolution:
$ kubectl exec -it busybox -- nslookup kube-dns.kube-system.svc.cluster.local
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: kube-dns.kube-system.svc.cluster.local
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
$ kubectl exec -it busybox -- nslookup hostnames.default.svc.cluster.local
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: hostnames.default.svc.cluster.local
Address 1: 10.98.229.90 hostnames.default.svc.cluster.local
- Edit the VM's /etc/resolv.conf file to add the Kubernetes DNS server:
$ sudo vi /etc/resolv.conf
- Add the following two lines for name resolution of the Kubernetes services and the save file:
search cluster.local
nameserver 10.96.0.10
Next, let's see how we can gain access to our Kubernetes environment.