Skip to content

Instantly share code, notes, and snippets.

@gamename
Created October 22, 2018 17:57
Show Gist options
  • Save gamename/c19e87e015a9a686b205135d1f40b68b to your computer and use it in GitHub Desktop.
Save gamename/c19e87e015a9a686b205135d1f40b68b to your computer and use it in GitHub Desktop.
$ sudo kubeadm init --pod-network-cidr 10.244.0.0/16 --apiserver-advertise-address 10.0.0.1
[init] using Kubernetes version: v1.12.1
[preflight] running pre-flight checks
[preflight/images] Pulling images required for setting up a Kubernetes cluster
[preflight/images] This might take a minute or two, depending on the speed of your internet connection
[preflight/images] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[preflight] Activating the kubelet service
[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/healthcheck-client certificate and key.
[certificates] Generated apiserver-etcd-client certificate and key.
[certificates] Generated etcd/server certificate and key.
[certificates] etcd/server serving cert is signed for DNS names [k8s localhost] and IPs [127.0.0.1 ::1]
[certificates] Generated etcd/peer certificate and key.
[certificates] etcd/peer serving cert is signed for DNS names [k8s localhost] and IPs [10.0.0.1 127.0.0.1 ::1]
[certificates] Generated ca certificate and key.
[certificates] Generated apiserver certificate and key.
[certificates] apiserver serving cert is signed for DNS names [k8s kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.0.0.1]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] valid certificates and keys now exist in "/etc/kubernetes/pki"
[certificates] Generated sa key and public key.
[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
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'
couldn't initialize a Kubernetes cluster
@gamename
Copy link
Author

$ sudo systemctl status kubelet -l
● kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: active (running) since Mon 2018-10-22 14:15:08 UTC; 3h 48min ago
     Docs: https://kubernetes.io/docs/home/
 Main PID: 19944 (kubelet)
    Tasks: 22 (limit: 4915)
   Memory: 39.9M
      CPU: 31min 48.377s
   CGroup: /system.slice/kubelet.service
           └─19944 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --cgroup-driver=cgro

Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.012993   19944 reflector.go:134] k8s.io/kubernetes/pkg/kubelet/kubelet.go:451: Failed to list *v1.Node: Get https://10.0.0.1:6443/api/v1/nodes?fiel
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.020511   19944 reflector.go:134] k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list *v1.Pod: Get https://10.0.0.1:6443/api/v1/pod
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.097124   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.197706   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.299211   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.399904   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.502778   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.603245   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.703817   19944 kubelet.go:2236] node "k8s" not found
Oct 22 18:04:08 k8s kubelet[19944]: E1022 18:04:08.805213   19944 kubelet.go:2236] node "k8s" not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment