KubeAdm fails to configure - Unable to connect to the server: EOF

3/4/2019

I am getting issue to configure K8S running kubeadm on ubuntu 18.06.

After performing kubeadm-init on master 1 node all goes well :

To start using your cluster, you need to run the following as a regular user:

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

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of machines by running the following on each node
as root:

  kubeadm join 172.40.0.10:6443 --token oormjp.gf43botx19purn13 --discovery-token-ca-cert-hash sha256:5e9c917221233fdae445640415fac123204f41d31d072cd06545055187c860e2

So I execute after following commands :

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

When I test kubeclt version, I get :

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-02-28T13:37:52Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Unable to connect to the server: EOF

When I want to install a CNI such as weave or Flannel I get :

Unable to connect to the server: EOF

Here is my yaml config file use by kubeadm :

apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: stable
apiServer:
  certSANs:
  - "172.40.0.10"
controlPlaneEndpoint: "172.40.0.10:6443"
networking:
  podSubnet: 10.244.0.0/16

172.40.0.10 : is a HAProxy server.

Can anyone help me to debug it?

-- Seb HO
kubeadm
kubernetes

1 Answer

4/18/2019

using "flannel" pod network take a look for requirements and please run:

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

You can find more information here.

-- Hanx
Source: StackOverflow