Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

+3 votes

Trying to follow the tutorial on the official kubernetes: https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/

I manage to install the following on Ubuntu 16.04.6 LTS (Xenial Xerus):

  1. sudo apt install docker.io -y
  2. sudo apt install -y apt-transport-https
  3. sudo apt install -y kubeadm kubelet kubectl

But when trying this command "kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml" to create a dashboard on the main server, it is giving me the following error message.

Error message: unable to recognize "https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml": Get http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080: connect: connection refused

          I have referred to this link [Installing kube-state-metrics into an existing cluster on GCE
https://stackoverflow.com/questions/55503297/installing-kube-state-metrics-into-an-existing-cluster-on-gce] but did not understand. Could you help?

Apr 9 in Kubernetes by nmentityvibes
• 340 points
260 views
You don't know the solution and simply you are redirecting me to go here and there. Your answer is wrong. You don't even know the basics of networking. Don't misguide if you don't know the answer just be quite so that someone else could answer.

You can refer the Kubernetes Official Docs. It clearly mentions the usage of flannel.

For flannel to work correctly, you must pass --pod-network-cidr=10.244.0.0/16 to kubeadm init.

Set /proc/sys/net/bridge/bridge-nf-call-iptables to 1 by running sysctl net.bridge.bridge-nf-call-iptables=1 to pass bridged IPv4 traffic to iptables’ chains. This is a requirement for some CNI plugins to work, for more information please see here.

Note that flannel works on amd64, arm, arm64, ppc64le and s390x under Linux. Windows (amd64) is claimed as supported in v0.11.0 but the usage is undocumented.

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml

Ok. I will follow you on what you say. I just got this....

~$ sudo kubeadm init --apiserver-advertise-address=192.168.31.137 --pod-network-cidr=10.244.0.0/1
[sudo] password for ev:
podSubnet: Invalid value: "10.244.0.0/1": subnet is too small

          Let me know what needs to be done. I want the Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server. Till then I cannot mark your answer as correct.

The command you've used:

sudo kubeadm init --apiserver-advertise-address=192.168.31.137 --pod-network-cidr=10.244.0.0/1

You missed out a digit at the end. --pod-networ-cidr=10.244.0.0/16

Use the following command

$ kubeadm init --apiserver-advertise-address=<ip-address-of-kmaster-vm> --pod-network-cidr=10.244.0.0/16

I am still getting the same after doing this sudo kubeadm init --apiserver-advertise-address=192.168.31.137 --pod-network-cidr=10.244.0.0/16. I don't see any flannel nodes running.

~$ kubectl get pods -o wide --all-namespaces
NAMESPACE     NAME                                    READY   STATUS    RESTARTS   AGE   IP                NODE         NOMINATED NODE   READINESS GATES
kube-system   coredns-fb8b8dccf-6c6nr                 0/1     Pending   0          45m   <none>            <none>       <none>           <none>
kube-system   coredns-fb8b8dccf-96d9l                 0/1     Pending   0          45m   <none>            <none>       <none>           <none>
kube-system   etcd-nmentityvibes                         1/1     Running   0          44m   192.168.31.137    nmentityvibes   <none>           <none>
kube-system   kube-apiserver-nmentityvibes               1/1     Running   0          44m   192.168.31.137    nmentityvibes   <none>           <none>
kube-system   kube-controller-manager-nmentityvibes      1/1     Running   2          44m   192.168.31.137    nmentityvibes   <none>           <none>
kube-system   kube-proxy-dlnzq                        1/1     Running   0          39m   192.168.122.127   worker01     <none>           <none>
kube-system   kube-proxy-mswdz                        0/1     Evicted   0          19m   <none>            nmentityvibes   <none>           <none>
kube-system   kube-scheduler-nmentityvibes               1/1     Running   1          44m   192.168.31.137    nmentityvibes   <none>           <none>
kube-system   kubernetes-dashboard-5f7b999d65-5fw4w   0/1     Pending   0          28m   <none>            <none>       <none>           <none>

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
–2 votes

Follow these steps:

$ kubeadm reset

$ kubeadm init --apiserver-advertise-address=<ip-address-of-kmaster-vm> --pod-network-cidr=10.244.0.0/16

Open another terminal and execute the following command as a non root user

$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config

and then use flannel as your CNI

$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/a70459be0084506e4ec919aa1c114638878db11b/Documentation/kube-flannel.yml
answered Apr 11 by Kalgi
• 36,920 points

reshown Apr 12 by Kalgi

Related Questions In Kubernetes

0 votes
1 answer

Install Kubernetes Dashboard on extrenal IP

You can expose services and pods in ...READ MORE

answered Sep 25, 2018 in Kubernetes by Kalgi
• 36,920 points
38 views
0 votes
1 answer

Installing Kubernetes on aws gives an error

seems like you are missing region. Try ...READ MORE

answered Oct 4, 2018 in Kubernetes by Kalgi
• 36,920 points
19 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
829 views
+13 votes
2 answers
0 votes
2 answers

Accessing Kubernetes Web UI (Dashboard)

To access Kubernetes dashboard, you need to ...READ MORE

answered Apr 15 in Kubernetes by Ray
198 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.