0

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
  • 55
  • 1
  • 7
  • Follow the below link https://stackoverflow.com/questions/54856450/kubeadm-init-fails-at-control-plane-setup-timed-out-waiting-for-the-condition – P Ekambaram Mar 04 '19 at 18:23
  • I have tested this command and got : _root@dk8s-m1:~# kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.244.0.0/16 [init] Using Kubernetes version: v1.13.4 [preflight] Running pre-flight checks error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR FileContent--proc-sys-net-ipv6-conf-default-forwarding]: /proc/sys/net/ipv6/conf/default/forwarding contents are not set to 1 [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`_ – Seb HO Mar 04 '19 at 18:42
  • What does --apiserver-advertise-address $(hostname -i) do? – Seb HO Mar 04 '19 at 18:44
  • $(hostname -i) command would populate the IP address of the machine – P Ekambaram Mar 06 '19 at 07:37
  • Hi @SebHO did you try solution offered by: P Ekambaram? Please comment or provide any feedback. Could you run those commands and collect more information? `systemctl status kubelet` and `journalctl -u kubelet` – PjoterS Apr 18 '19 at 12:52

1 Answers1

0

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.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Mark
  • 3,644
  • 6
  • 23