我在Kubernetes worker上遇到问题,我有2台计算机,第一台作为主计算机,第二台作为工作计算机(节点)。 ubuntu服务器Ubuntu 18.04.3 LTS 当我运行以下命令时:
kubectl describe node kubernetes-worker
以下输出:
Name: kubernetes-worker Roles: Labels: beta.kubernetes.io/arch=amd64 beta.kubernetes.io/os=linux kubernetes.io/arch=amd64 kubernetes.io/hostname=kubernetes-worker kubernetes.io/os=linux role=worker Annotations: flannel.alpha.coreos.com/backend-data: {"VtepMAC":"82:22:c1:fa:c8:61"} flannel.alpha.coreos.com/backend-type: vxlan flannel.alpha.coreos.com/kube-subnet-manager: true flannel.alpha.coreos.com/public-ip: 192.168.1.36 kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock node.alpha.kubernetes.io/ttl: 0 volumes.kubernetes.io/controller-managed-attach-detach: true CreationTimestamp: Mon, 02 Dec 2019 09:31:37 +0000 Taints: node.kubernetes.io/unreachable:NoSchedule Unschedulable: false Conditions: Type Status LastHeartbeatTime LastTransitionTime Reason Message ---- ------ ----------------- ------------------ ------ ------- MemoryPressure Unknown Sat, 28 Dec 2019 15:31:21 +0000 Mon, 30 Dec 2019 06:31:26 +0000 NodeStatusUnknown Kubelet stopped posting node status. DiskPressure Unknown Sat, 28 Dec 2019 15:31:21 +0000 Mon, 30 Dec 2019 06:31:26 +0000 NodeStatusUnknown Kubelet stopped posting node status. PIDPressure Unknown Sat, 28 Dec 2019 15:31:21 +0000 Mon, 30 Dec 2019 06:31:26 +0000 NodeStatusUnknown Kubelet stopped posting node status. Ready Unknown Sat, 28 Dec 2019 15:31:21 +0000 Mon, 30 Dec 2019 06:31:26 +0000 NodeStatusUnknown Kubelet stopped posting node status. Addresses: InternalIP: 192.168.1.36 Hostname: kubernetes-worker Capacity: cpu: 2 ephemeral-storage: 130551876Ki hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 3918032Ki pods: 110 Allocatable: cpu: 2 ephemeral-storage: 120316608723 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 3815632Ki pods: 110 System Info: Machine ID: c87a16d69ec94e03a8a281b2d54c722c System UUID: F493BA8E-F779-234F-AC40-C4899AC930B9 Boot ID: f9b6eb1e-0a6b-4765-b8d6-1e5527a7f970 Kernel Version: 4.15.0-70-generic OS Image: Ubuntu 18.04.3 LTS Operating System: linux Architecture: amd64 Container Runtime Version: docker://18.9.7 Kubelet Version: v1.16.3 Kube-Proxy Version: v1.16.3 PodCIDR: 10.244.1.0/24 PodCIDRs: 10.244.1.0/24 Non-terminated Pods: (2 in total) Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits AGE --------- ---- ------------ ---------- --------------- ------------- --- kube-system kube-flannel-ds-amd64-ssk8h 100m (5%) 100m (5%) 50Mi (1%) 50Mi (1%) 51d kube-system kube-proxy-965g2 0 (0%) 0 (0%) 0 (0%) 0 (0%) 51d Allocated resources: (Total limits may be over 100 percent, i.e., overcommitted.) Resource Requests Limits -------- -------- ------ cpu 100m (5%) 100m (5%) memory 50Mi (1%) 50Mi (1%) ephemeral-storage 0 (0%) 0 (0%) `
问题是什么以及我如何解决,这是我从不碰任何设置或任何东西的地方发生的。 感谢您的帮助。
更新
<pre> 947 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats Jan 23 07:26:27 kubernetes-master kubelet[947]: E0123 07:26:27.344712 947 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats Jan 23 07:26:37 kubernetes-master kubelet[947]: E0123 07:26:37.446034 947 summary_sys_containers.go:47] Failed to get system container stats for "/system.slice/docker.service": failed to get cgroup stats </pre>
答案 0 :(得分:1)
使用以下标志启动kubelet。
--runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice