那个命令或者组件
sealos init --master 10.3.138.175 --node 10.3.138.167 --pkg-url /root/kube1.22.0.tar.gz --version v1.22.0
描述你的问题
之前用sealos安装过 k8s群集,后来重启master 节点后 群集就挂了,在关闭swap 后问题还存在,log 日志报
Oct 15 11:18:59 host-10-3-138-175 kubelet: E1015 11:18:59.506798 25554 event.go:273] Unable to write event: '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"host-10-3-138-175.16ae147dca297dc7", GenerateName:"", Namespace:"default", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"Node", Namespace:"", Name:"host-10-3-138-175", UID:"host-10-3-138-175", APIVersion:"", ResourceVersion:"", FieldPath:""}, Reason:"NodeHasNoDiskPressure", Message:"Node host-10-3-138-175 status is now: NodeHasNoDiskPressure", Source:v1.EventSource{Component:"kubelet", Host:"host-10-3-138-175"}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc052590150868bc7, ext:6548214272, loc:(*time.Location)(0x55b99ddc7660)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc0525901639137a1, ext:6867680730, loc:(*time.Location)(0x55b99ddc7660)}}, Count:5, Type:"Normal", EventTime:v1.MicroTime{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'Patch "https://apiserver.cluster.local:6443/api/v1/namespaces/default/events/host-10-3-138-175.16ae147dca297dc7": dial tcp 10.3.138.175:6443: connect: connection refused'(may retry after sleeping)
Oct 15 11:18:59 host-10-3-138-175 kubelet: E1015 11:18:59.542752 25554 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 11:18:59 host-10-3-138-175 kubelet: E1015 11:18:59.643806 25554 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
你看到的一些参考资料
[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'
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.
Here is one example how you may list all Kubernetes containers running in cri-o/containerd using crictl:
- 'crictl --runtime-endpoint /run/containerd/containerd.sock ps -a | grep kube | grep -v pause'
Once you have found the failing container, you can inspect its logs with:
- 'crictl --runtime-endpoint /run/containerd/containerd.sock logs CONTAINERID'
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
[[email protected] ~]# tail -f /var/log/messages
Oct 15 10:08:01 host-10-3-138-175 kubelet: E1015 10:08:01.721363 18724 event.go:273] Unable to write event: '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"host-10-3-138-175.16ae12192bd7df61", GenerateName:"", Namespace:"default", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"Node", Namespace:"", Name:"host-10-3-138-175", UID:"host-10-3-138-175", APIVersion:"", ResourceVersion:"", FieldPath:""}, Reason:"Starting", Message:"Starting kubelet.", Source:v1.EventSource{Component:"kubelet", Host:"host-10-3-138-175"}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc052566f8606f361, ext:5194550566, loc:(*time.Location)(0x55edb2499660)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc052566f8606f361, ext:5194550566, loc:(*time.Location)(0x55edb2499660)}}, Count:1, Type:"Normal", EventTime:v1.MicroTime{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'Post "https://apiserver.cluster.local:6443/api/v1/namespaces/default/events": dial tcp 10.3.138.175:6443: connect: connection refused'(may retry after sleeping)
Oct 15 10:08:01 host-10-3-138-175 kubelet: E1015 10:08:01.785303 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:01 host-10-3-138-175 kubelet: E1015 10:08:01.886237 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:01 host-10-3-138-175 kubelet: E1015 10:08:01.987312 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.088026 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.188175 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.288420 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.388967 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.489771 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.589925 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.690835 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.742830 18724 controller.go:144] failed to ensure lease exists, will retry in 7s, error: Get "https://apiserver.cluster.local:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/leases/host-10-3-138-175?timeout=10s": dial tcp 10.3.138.175:6443: connect: connection refused
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.792017 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.892218 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:02 host-10-3-138-175 kubelet: I1015 10:08:02.918412 18724 kubelet_node_status.go:71] "Attempting to register node" node="host-10-3-138-175"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.919023 18724 kubelet_node_status.go:93] "Unable to register node with API server" err="Post "https://apiserver.cluster.local:6443/api/v1/nodes": dial tcp 10.3.138.175:6443: connect: connection refused" node="host-10-3-138-175"
Oct 15 10:08:02 host-10-3-138-175 kubelet: E1015 10:08:02.992815 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.093095 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.194291 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.294604 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.395231 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.496135 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.596669 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.697719 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.797904 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.898385 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:03 host-10-3-138-175 kubelet: E1015 10:08:03.998899 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:04 host-10-3-138-175 kubelet: E1015 10:08:04.099730 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:04 host-10-3-138-175 kubelet: E1015 10:08:04.200819 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:04 host-10-3-138-175 kubelet: E1015 10:08:04.301861 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:04 host-10-3-138-175 kubelet: E1015 10:08:04.402020 18724 kubelet.go:2407] "Error getting node" err="node "host-10-3-138-175" not found"
Oct 15 10:08:04 host-10-3-138-175 kubelet: E1015 10:08:04.426620 18724 eviction_manager.go:255] "Eviction manager: failed to get summary stats" err="failed to get node info: node "host-10-3-138-175" not found"
Oct 15 10:08:04 host-10-3-138-175 containerd: time="2021-10-15T10:08:04.442842718+08:00" level=error msg="Failed to load cni configuration" error="cni config load failed: no network config found in /etc/cni/net.d: cni plugin not initialized: failed to load cni config"
Oct 15 10:08:04 host-10-3-138-175 kubelet: E1015 10:08:04.443170 18724 kubelet.go:2332] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized"
eg. 文档的引用xxxx
type: question