Kubeadm init HA cluster keep failing

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version:1.17.2
Cloud being used: bare-metal
Installation method: kubeadm
Host OS: Centos 7
CNI and version: n/a
CRI and version: n/a

Trying to create an HA k8s cluster following the blog

Keeps failing. Here is what I have done:

  1. created an HAPROXY server and LB to master node 0
  2. change docker to run under systemd
  3. swapoff -a
  4. setenforce 0
  5. modprobe br_netfilter
  6. echo ‘1’ > /proc/sys/net/bridge/bridge-nf-call-iptables
  7. turn off firewalld
  8. yum install kubelet kubeadm kubectl

cat < /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
vm.swappiness = 0
EOF

sysctl --system

  1. prepare the kubeadm.yaml

  2. kubeadm init --config kubeadm.yml --upload-certs
    keeps failing at
    [wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory “/etc/kubernetes/manifests”. This can take up to 4m0s
    [kubelet-check] Initial timeout of 40s passed.

    Unfortunately, an error has occurred:
    timed out waiting for the condition

    This error is likely caused by:
    - The kubelet is not running
    - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

    If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
    - ‘systemctl status kubelet’
    - ‘journalctl -xeu kubelet’

Systemd log shows:
Jan 30 20:03:32 kaizhang4c.mylabserver.com kubelet[16465]: E0130 20:03:32.627412 16465 kubelet.go:2263] node “kaizhang4c.mylabserver.com” not found

why it can’t find local node? Thank you so much for your help!

kubeadm.yaml
apiVersion: kubeadm.k8s.io/v1beta2
bootstrapTokens:
- token: “co4zhu.timmt8nyl29udq96”
#certificateKey: “d29a57954a7d92a3941cea3c9a9625df68d2cbdc0d10c4a7f42b354c1c27f2ca”
- groups:
- system:bootstrappers:kubeadm:default-node-token
token: co4zhu.timmt8nyl29udq96
ttl: 24h0m0s
usages:
- signing
- authentication
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 172.31.20.199
bindPort: 6443
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: kaizhang4c.mylabserver.com
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master

apiServer:
timeoutForControlPlane: 4m0s
apiVersion: kubeadm.k8s.io/v1beta2
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controlPlaneEndpoint: “172.31.24.180:8443”
controllerManager: {}
dns:
type: CoreDNS
etcd:
local:
dataDir: /var/lib/etcd
imageRepository: k8s.gcr.io
kind: ClusterConfiguration
kubernetesVersion: v1.17.0
networking:
dnsDomain: cluster.local
serviceSubnet: 10.244.0.0/16
scheduler: {}

Hi,
have find out whats wrong with the cluster