Kubernetes installation in 3 node setup

6/13/2018

I am trying to install kubernetes using kubeadm in 3 node VM setup based on Ubuntu 16.04 VMs where 1 VM acts as Master while 2 VMs acts as Slave nodes running in pods.

I am following the steps mentioned in

https://gist.github.com/ruanbekker/38a38aea5f325f7fa4a19e795ef4f0d0

https://www.mirantis.com/blog/how-install-kubernetes-kubeadm/

So on master node the moment I run Kubeadm init command it gets stuck saying pulling the control images. Am I missing any steps to properly start kubernetes ? If there is any link or document which explains how to successfully install atleast a 3 node cluster would be great.

ipi@mm202:~$ sudo apt-get install -y kubelet kubeadm kubectl kubernetes-cni
[sudo] password for ipi: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
kubeadm is already the newest version (1.10.4-00).
kubectl is already the newest version (1.10.4-00).
kubelet is already the newest version (1.10.4-00).
kubernetes-cni is already the newest version (0.6.0-00).
The following packages were automatically installed and are no longer required:
  bridge-utils containerd linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic linux-image-4.13.0-36-generic
  linux-image-4.4.0-127-generic linux-image-extra-4.13.0-36-generic linux-image-extra-4.4.0-127-generic pigz
  runc ubuntu-fan
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
ipi@mm202:~$ sudo kubeadm init
[init] Using Kubernetes version: v1.10.4
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks.
    [WARNING FileExisting-crictl]: crictl not found in system path
Suggestion: go get github.com/kubernetes-incubator/cri-tools/cmd/crictl
[certificates] Generated ca certificate and key.
[certificates] Generated apiserver certificate and key.
[certificates] apiserver serving cert is signed for DNS names [mm202 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.10.26.148]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] Generated sa key and public key.
[certificates] Generated front-proxy-ca certificate and key.
[certificates] Generated front-proxy-client certificate and key.
[certificates] Generated etcd/ca certificate and key.
[certificates] Generated etcd/server certificate and key.
[certificates] etcd/server serving cert is signed for DNS names [localhost] and IPs [127.0.0.1]
[certificates] Generated etcd/peer certificate and key.
[certificates] etcd/peer serving cert is signed for DNS names [mm202] and IPs [10.10.26.148]
[certificates] Generated etcd/healthcheck-client certificate and key.
[certificates] Generated apiserver-etcd-client certificate and key.
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[controlplane] Wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[controlplane] Wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[controlplane] Wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/manifests/kube-scheduler.yaml"
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests".
[init] This might take a minute or longer if the control plane images have to be pulled.

If i execute below kubectl command I can see that client is not reachable

ipi@mm202:~$ sudo kubectl version 
[sudo] password for ipi: 
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.4", GitCommit:"5ca598b4ba5abb89bb773071ce452e33fb66339d", GitTreeState:"clean", BuildDate:"2018-06-06T08:13:03Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server 10.10.26.148:6443 was refused - did you specify the right host or port?
ipi@mm202:~$ 

*Updated

ipi@mm202:~$ sudo docker ps -a
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                        PORTS               NAMES
5e3826260751        52920ad46f5b                 "etcd --client-cer..."   26 seconds ago      Exited (1) 25 seconds ago                         k8s_etcd_etcd-mm202_kube-system_cf966237db9a791ace9f5788e9f4fd9a_2
0366ea0ef627        afdd56622af3                 "kube-apiserver --..."   30 seconds ago      Exited (255) 17 seconds ago                       k8s_kube-apiserver_kube-apiserver-mm202_kube-system_980acadbdc97171782e300778c16008b_1
57afc9d65f97        1a24f5586598                 "kube-controller-m..."   43 seconds ago      Up 42 seconds                                     k8s_kube-controller-manager_kube-controller-manager-mm202_kube-system_84183acd85a9e65994a24ce3c23c9533_0
5cda05f323c3        6fffbea311f0                 "kube-scheduler --..."   43 seconds ago      Up 42 seconds                                     k8s_kube-scheduler_kube-scheduler-mm202_kube-system_a45cd09c7a02c8a7e64580248df4b50d_0
63f974dbea93        k8s.gcr.io/pause-amd64:3.1   "/pause"                 43 seconds ago      Up 42 seconds                                     k8s_POD_kube-controller-manager-mm202_kube-system_84183acd85a9e65994a24ce3c23c9533_0
dec4a2a3c6ca        k8s.gcr.io/pause-amd64:3.1   "/pause"                 43 seconds ago      Up 42 seconds                                     k8s_POD_kube-apiserver-mm202_kube-system_980acadbdc97171782e300778c16008b_0
882cb2b1011e        k8s.gcr.io/pause-amd64:3.1   "/pause"                 43 seconds ago      Up 42 seconds                                     k8s_POD_etcd-mm202_kube-system_cf966237db9a791ace9f5788e9f4fd9a_0
583fb3bbae8d        k8s.gcr.io/pause-amd64:3.1   "/pause"                 43 seconds ago      Up 42 seconds                                     k8s_POD_kube-scheduler-mm202_kube-system_a45cd09c7a02c8a7e64580248df4b50d_0
28ba22a1f54e        hello-world                  "/hello"                 12 days ago         Exited (0) 12 days ago                            modest_kilby
ipi@mm202:~$ 
-- codingfreak
kubernetes

0 Answers