`TASK [kubernetes/master : kubeadm | Initialize first master] *****************************************************************************************************************
Wednesday 27 May 2020 14:54:50 +0800 (0:00:00.122) 0:02:57.235 *********
FAILED - RETRYING: kubeadm | Initialize first master (3 retries left).
FAILED - RETRYING: kubeadm | Initialize first master (2 retries left).
FAILED - RETRYING: kubeadm | Initialize first master (1 retries left).
fatal: [ks-allinone]: FAILED! => {
“attempts”: 3,
“changed”: true,
“cmd”: [
“timeout”,
“-k”,
“300s”,
“300s”,
“/usr/local/bin/kubeadm”,
“init”,
“–config=/etc/kubernetes/kubeadm-config.yaml”,
“–ignore-preflight-errors=all”,
“–skip-phases=addon/coredns”,
“–upload-certs”
],
“delta”: “0:01:56.963799″,
“end”: “2020-05-27 15:03:02.875922″,
“failed_when_result”: true,
“rc”: 1,
“start”: “2020-05-27 15:01:05.912123″
}
STDOUT:
[init] Using Kubernetes version: v1.16.7
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using ‘kubeadm config images pull’
[kubelet-start] Writing kubelet environment file with flags to file “/var/lib/kubelet/kubeadm-flags.env”
[kubelet-start] Writing kubelet configuration to file “/var/lib/kubelet/config.yaml”
[kubelet-start] Activating the kubelet service
[certs] Using certificateDir folder “/etc/kubernetes/ssl”
[certs] Using existing ca certificate authority
[certs] Using existing apiserver certificate and key on disk
[certs] Using existing apiserver-kubelet-client certificate and key on disk
[certs] Using existing front-proxy-ca certificate authority
[certs] Using existing front-proxy-client certificate and key on disk
[certs] External etcd mode: Skipping etcd/ca certificate authority generation
[certs] External etcd mode: Skipping etcd/server certificate generation
[certs] External etcd mode: Skipping etcd/peer certificate generation
[certs] External etcd mode: Skipping etcd/healthcheck-client certificate generation
[certs] External etcd mode: Skipping apiserver-etcd-client certificate generation
[certs] Using the existing “sa” key
[kubeconfig] Using kubeconfig folder “/etc/kubernetes”
[kubeconfig] Using existing kubeconfig file: “/etc/kubernetes/admin.conf”
[kubeconfig] Using existing kubeconfig file: “/etc/kubernetes/kubelet.conf”
[kubeconfig] Using existing kubeconfig file: “/etc/kubernetes/controller-manager.conf”
[kubeconfig] Using existing kubeconfig file: “/etc/kubernetes/scheduler.conf”
[control-plane] Using manifest folder “/etc/kubernetes/manifests”
[control-plane] Creating static Pod manifest for “kube-apiserver”
[controlplane] Adding extra host path mount “etc-pki-tls” to “kube-apiserver”
[controlplane] Adding extra host path mount “etc-pki-ca-trust” to “kube-apiserver”
[control-plane] Creating static Pod manifest for “kube-controller-manager”
[controlplane] Adding extra host path mount “etc-pki-tls” to “kube-apiserver”
[controlplane] Adding extra host path mount “etc-pki-ca-trust” to “kube-apiserver”
[control-plane] Creating static Pod manifest for “kube-scheduler”
[controlplane] Adding extra host path mount “etc-pki-tls” to “kube-apiserver”
[controlplane] Adding extra host path mount “etc-pki-ca-trust” to “kube-apiserver”
[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 5m0s
[kubelet-check] Initial timeout of 40s passed.
[kubelet-check] It seems like the kubelet isn’t running or healthy.
[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn’t running or healthy.
[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn’t running or healthy.
[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn’t running or healthy.
[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused.
[kubelet-check] It seems like the kubelet isn’t running or healthy.
[kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused.
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’
Additionally, a control plane component may have crashed or exited when started by the container runtime.
To troubleshoot, list all containers using your preferred container runtimes CLI, e.g. docker.
Here is one example how you may list all Kubernetes containers running in docker:
- ‘docker ps -a | grep kube | grep -v pause’
Once you have found the failing container, you can inspect its logs with:
- ‘docker logs CONTAINERID’
STDERR:
[WARNING FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
[WARNING FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
[WARNING FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
error execution phase wait-control-plane: couldn’t initialize a Kubernetes cluster
To see the stack trace of this error execute with –v=5 or higher
MSG:
non-zero return code
NO MORE HOSTS LEFT ***********************************************************************************************************************************************************
PLAY RECAP *******************************************************************************************************************************************************************
ks-allinone : ok=469 changed=48 unreachable=0 failed=1
localhost : ok=1 changed=0 unreachable=0 failed=0
Wednesday 27 May 2020 15:03:02 +0800 (0:08:12.459) 0:11:09.695 *********
kubernetes/master : kubeadm | Initialize first master ————————————————————————————————————— 492.46s
container-engine/docker : check if container-selinux is available —————————————————————————————————- 20.50s
etcd : Configure | Check if etcd cluster is healthy ——————————————————————————————————————- 7.49s
kubernetes/preinstall : Install packages requirements —————————————————————————————————————– 7.46s
etcd : wait for etcd up ———————————————————————————————————————————————– 6.55s
container-engine/docker : Docker | reload docker ———————————————————————————————————————- 2.10s
download : download | Download files / images ————————————————————————————————————————- 1.85s
etcd : reload etcd —————————————————————————————————————————————————- 1.53s
container-engine/docker : ensure docker packages are installed ——————————————————————————————————– 1.29s
download : download | Sync files / images from ansible host to nodes ————————————————————————————————– 1.22s
container-engine/docker : Ensure old versions of Docker are not installed. | RedHat ———————————————————————————– 1.12s
download : download_file | Download item —————————————————————————————————————————— 0.92s
download : download | Sync files / images from ansible host to nodes ————————————————————————————————– 0.86s
download : download | Sync files / images from ansible host to nodes ————————————————————————————————– 0.85s
download : download | Download files / images ————————————————————————————————————————- 0.85s
download : download | Download files / images ————————————————————————————————————————- 0.85s
download : download | Sync files / images from ansible host to nodes ————————————————————————————————– 0.83s
download : download | Sync files / images from ansible host to nodes ————————————————————————————————– 0.82s
download : download | Download files / images ————————————————————————————————————————- 0.82s
etcd : Gen_certs | update ca-certificates (RedHat) ——————————————————————————————————————– 0.82s
failed!
please refer to https://kubesphere.io/docs/v2.1/zh-CN/faq/faq-install/
**********************************`