Ошибка инициализации kubeadm при настройке плоскости управления «истекло время ожидания условия» - PullRequest
0 голосов
/ 24 февраля 2019

Я пытаюсь настроить одноузловой кластер на моем одноплатном компьютере (не Raspberry), на котором запущен armbian (ядро на основе Ubuntu Bionic 4.19).Я настроил все в соответствии с официальным руководством , но когда я пытаюсь запустить kubeadm init, происходит сбой с timed out waiting for the condition при запуске плоскости управления.

Я прочитал все вопросы и вопросы по этой проблеме, но, похоже, у меня ничего не работает.Я также пробовал разные версии kubernetes, но получил те же результаты.

Вот все мои журналы (в этом последнем запуске я пробовал k8 v1.12, но результаты были такими же, как в v1.13):

 > kubeadm init --node-name node_name --pod-network-cidr=192.168.0.0/16
[init] using Kubernetes version: v1.12.5
[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 etcd/ca certificate and key.
[certificates] Generated etcd/peer certificate and key.
[certificates] etcd/peer serving cert is signed for DNS names [node_name localhost] and IPs [192.168.0.104 127.0.0.1 ::1]
[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 [node_name localhost] and IPs [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 [node_name kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.0.104]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] Generated front-proxy-ca certificate and key.
[certificates] Generated front-proxy-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



> systemctl status kubelet
Feb 24 20:32:27 node_name kubelet[14903]: W0224 20:32:27.775295   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/blkio/libcontainer_19396_systemd_test_default.slice": 0x40000100 == IN_CREATE|I
Feb 24 20:32:27 node_name kubelet[14903]: W0224 20:32:27.775729   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/memory/libcontainer_19396_systemd_test_default.slice": 0x40000100 == IN_CREATE|
Feb 24 20:32:27 node_name kubelet[14903]: W0224 20:32:27.776032   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/devices/libcontainer_19396_systemd_test_default.slice": 0x40000100 == IN_CREATE
Feb 24 20:32:27 node_name kubelet[14903]: E0224 20:32:27.878076   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:32:27 node_name kubelet[14903]: E0224 20:32:27.978967   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:32:28 node_name kubelet[14903]: E0224 20:32:28.079610   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:32:28 node_name kubelet[14903]: W0224 20:32:28.135637   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/devices/libcontainer_19403_systemd_test_default.slice": 0x40000100 == IN_CREATE
Feb 24 20:32:28 node_name kubelet[14903]: E0224 20:32:28.181134   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:32:28 node_name kubelet[14903]: E0224 20:32:28.289467   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:32:28 node_name kubelet[14903]: E0224 20:32:28.397310   14903 kubelet.go:2236] node "node_name" not found




> journalctl -xeu kubelet
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.135443   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.238032   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.278975   14903 certificate_manager.go:348] Failed while requesting a signed certificate from the master: cannot create certificate signing request: Pos
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.340747   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.536187   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.640348   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.739648   14903 helpers.go:135] readString: Failed to read "/sys/fs/cgroup/cpu,cpuacct/libcontainer_19713_systemd_test_default.slice/cpu.cfs_period_us":
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.782521   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.894575   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:17 node_name kubelet[14903]: E0224 20:33:17.996389   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: W0224 20:33:18.058222   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/devices/libcontainer_19719_systemd_test_default.slice": 0x40000100 == IN_CREATE
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.110161   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.210797   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.314310   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.418032   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.518919   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.622878   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.730465   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.850900   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.857937   14903 eviction_manager.go:243] eviction manager: failed to get get summary stats: failed to get node info: node "node_name" not found
Feb 24 20:33:18 node_name kubelet[14903]: E0224 20:33:18.958122   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.059025   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.160009   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.262647   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: W0224 20:33:19.287875   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/blkio/libcontainer_19734_systemd_test_default.slice": 0x40000100 == IN_CREATE|I
Feb 24 20:33:19 node_name kubelet[14903]: W0224 20:33:19.288793   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/memory/libcontainer_19734_systemd_test_default.slice": 0x40000100 == IN_CREATE|
Feb 24 20:33:19 node_name kubelet[14903]: W0224 20:33:19.289280   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/devices/libcontainer_19734_systemd_test_default.slice": 0x40000100 == IN_CREATE
Feb 24 20:33:19 node_name kubelet[14903]: W0224 20:33:19.335495   14903 cni.go:188] Unable to update cni config: No networks found in /etc/cni/net.d
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.336909   14903 kubelet.go:2167] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.390642   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.491380   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.592135   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.693309   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.794236   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:19 node_name kubelet[14903]: E0224 20:33:19.903073   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.004302   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.114988   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.226253   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.328382   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.440179   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.521245   14903 helpers.go:135] readString: Failed to read "/sys/fs/cgroup/memory/libcontainer_19753_systemd_test_default.slice/memory.memsw.limit_in_by
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.548871   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.650039   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.790947   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:20 node_name kubelet[14903]: W0224 20:33:20.816400   14903 raw.go:87] Error while processing event ("/sys/fs/cgroup/devices/libcontainer_19761_systemd_test_default.slice": 0x40000100 == IN_CREATE
Feb 24 20:33:20 node_name kubelet[14903]: E0224 20:33:20.891646   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.054233   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.155294   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.259447   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.361964   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.463981   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: I0224 20:33:21.498734   14903 kubelet_node_status.go:276] Setting node annotation to enable volume controller attach/detach
Feb 24 20:33:21 node_name kubelet[14903]: I0224 20:33:21.524654   14903 kubelet_node_status.go:70] Attempting to register node node_name
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.564999   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.666157   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.767965   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.870418   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:21 node_name kubelet[14903]: E0224 20:33:21.972369   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:22 node_name kubelet[14903]: E0224 20:33:22.073104   14903 kubelet.go:2236] node "node_name" not found
Feb 24 20:33:22 node_name kubelet[14903]: E0224 20:33:22.174562   14903 kubelet.go:2236] node "node_name" not found



> docker logs <id>
Flag --insecure-port has been deprecated, This flag will be removed in a future version.
I0224 20:31:13.598834       1 server.go:681] external host was not specified, using 192.168.0.104
I0224 20:31:13.602481       1 server.go:152] Version: v1.12.5
I0224 20:31:27.566073       1 plugins.go:158] Loaded 8 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,Priority,DefaultTolerationSeconds,DefaultStorageClass,MutatingAdmissionWebhook.
I0224 20:31:27.566393       1 plugins.go:161] Loaded 6 validating admission controller(s) successfully in the following order: LimitRanger,ServiceAccount,Priority,PersistentVolumeClaimResize,ValidatingAdmissionWebhook,ResourceQuota.
I0224 20:31:27.584264       1 plugins.go:158] Loaded 8 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,Priority,DefaultTolerationSeconds,DefaultStorageClass,MutatingAdmissionWebhook.
I0224 20:31:27.584469       1 plugins.go:161] Loaded 6 validating admission controller(s) successfully in the following order: LimitRanger,ServiceAccount,Priority,PersistentVolumeClaimResize,ValidatingAdmissionWebhook,ResourceQuota.
I0224 20:31:28.579683       1 master.go:240] Using reconciler: lease
W0224 20:32:03.553674       1 genericapiserver.go:325] Skipping API batch/v2alpha1 because it has no resources.
W0224 20:32:10.861340       1 genericapiserver.go:325] Skipping API rbac.authorization.k8s.io/v1alpha1 because it has no resources.
W0224 20:32:10.985660       1 genericapiserver.go:325] Skipping API scheduling.k8s.io/v1alpha1 because it has no resources.
W0224 20:32:11.379405       1 genericapiserver.go:325] Skipping API storage.k8s.io/v1alpha1 because it has no resources.
W0224 20:32:22.680967       1 genericapiserver.go:325] Skipping API admissionregistration.k8s.io/v1alpha1 because it has no resources.
[restful] 2019/02/24 20:32:23 log.go:33: [restful/swagger] listing is available at https://192.168.0.104:6443/swaggerapi
[restful] 2019/02/24 20:32:23 log.go:33: [restful/swagger] https://192.168.0.104:6443/swaggerui/ is mapped to folder /swagger-ui/
[restful] 2019/02/24 20:32:47 log.go:33: [restful/swagger] listing is available at https://192.168.0.104:6443/swaggerapi
[restful] 2019/02/24 20:32:47 log.go:33: [restful/swagger] https://192.168.0.104:6443/swaggerui/ is mapped to folder /swagger-ui/
I0224 20:32:49.058392       1 plugins.go:158] Loaded 8 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,Priority,DefaultTolerationSeconds,DefaultStorageClass,MutatingAdmissionWebhook.
I0224 20:32:49.059791       1 plugins.go:161] Loaded 6 validating admission controller(s) successfully in the following order: LimitRanger,ServiceAccount,Priority,PersistentVolumeClaimResize,ValidatingAdmissionWebhook,ResourceQuota.

Я просто хочу выучить kubernetes, поэтому, если кто-нибудь знает другой метод установки, отличный от kubeadm, который работает на armv7, я был бы признателен за это тоже.

1 Ответ

0 голосов
/ 25 февраля 2019

Попробуйте следующую команду

kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 192.168.0.0/16

Примечание. Возможно, вам придется запустить kubeadm reset, чтобы удалить все старые вещи, которые были созданы из предыдущих команд 'kubeadm init'

...