[root@localhost data]# kubectl get pods
No resources found.
[root@localhost data]#
1,确认docker有没有安装
[root@localhost data]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-06-24 23:38:02 PDT; 4 weeks 2 days ago
Docs: https://docs.docker.com
Main PID: 25831 (dockerd)
Memory: 150.9M
CGroup: /system.slice/docker.service
├─ 472 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/923544ec52647cad7d59abb11e377e896a3dc546...
├─ 515 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/a219a33b97e5fb62de28580470bc9fbf8b703486...
├─ 1264 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/42abc6d542451e6cf79da63078a0ebe3c793b91c...
├─ 2277 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/431f615999bf71e1d1ad3a6744b58cd383b54266...
├─25831 /usr/bin/dockerd
├─25838 docker-containerd --config /var/run/docker/containerd/containerd.toml
├─30959 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/01a584b6045f110b069548671b50c2e3bb28afbd...
├─30970 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/1347e0489ef78405912353cc3504012b50dbff51...
├─30973 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/f0bd0585afeea816cbce8f3f16aec1e3301bcfbf...
└─30982 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/ed0470803bda4fc22a061833e416353fa0e14be0...
docker已经安装了,且启动了
2,kubelet已经安装且启动了
[root@localhost data]# systemctl status kubelet
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/etc/systemd/system/kubelet.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: active (running) since Sun 2021-07-25 06:59:52 PDT; 10min ago
Docs: http://kubernetes.io/docs/
Main PID: 48064 (kubelet)
Memory: 74.5M
CGroup: /system.slice/kubelet.service
└─48064 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml...
Jul 25 07:10:08 k8s-master kubelet[48064]: I0725 07:10:08.194099 48064 kubelet_node_status.go:79] Attempting to register node k8s-master
Jul 25 07:10:08 k8s-master kubelet[48064]: E0725 07:10:08.195788 48064 kubelet_node_status.go:103] Unable to register node "k8s-master" with API server: nodes "k8s-...k8s-master"
Jul 25 07:10:13 k8s-master kubelet[48064]: E0725 07:10:13.366341 48064 eviction_manager.go:243] eviction manager: failed to get get summary stats: failed to get nod..." not found
Jul 25 07:10:15 k8s-master kubelet[48064]: I0725 07:10:15.196280 48064 kubelet_node_status.go:269] Setting node annotation to enable volume controller attach/detach
Jul 25 07:10:15 k8s-master kubelet[48064]: I0725 07:10:15.198868 48064 kubelet_node_status.go:79] Attempting to register node k8s-master
Jul 25 07:10:15 k8s-master kubelet[48064]: E0725 07:10:15.200740 48064 kubelet_node_status.go:103] Unable to register node "k8s-master" with API server: nodes "k8s-...k8s-master"
Jul 25 07:10:22 k8s-master kubelet[48064]: I0725 07:10:22.203883 48064 kubelet_node_status.go:269] Setting node annotation to enable volume controller attach/detach
Jul 25 07:10:22 k8s-master kubelet[48064]: I0725 07:10:22.207637 48064 kubelet_node_status.go:79] Attempting to register node k8s-master
Jul 25 07:10:22 k8s-master kubelet[48064]: E0725 07:10:22.209227 48064 kubelet_node_status.go:103] Unable to register node "k8s-master" with API server: nodes "k8s-...k8s-master"
Jul 25 07:10:23 k8s-master kubelet[48064]: E0725 07:10:23.366736 48064 eviction_manager.go:243] eviction manager: failed to get get summary stats: failed to get nod..." not found
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost data]#
3, 最好发现为啥 加上--all-namespaces
[root@localhost data]# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-78fcdf6894-kq8mc 1/1 Unknown 0 30d
kube-system coredns-78fcdf6894-ksptk 1/1 Running 0 30d
kube-system coredns-78fcdf6894-pq57m 1/1 Unknown 0 30d
kube-system coredns-78fcdf6894-rxbxp 1/1 Running 0 30d
kube-system etcd-localhost.localdomain 1/1 Unknown 0 30d
kube-system kube-apiserver-localhost.localdomain 1/1 Unknown 0 30d
kube-system kube-controller-manager-localhost.localdomain 1/1 Unknown 0 30d
kube-system kube-flannel-ds-amd64-42dkv 0/1 Init:RunContainerError 0 26d
kube-system kube-flannel-ds-amd64-f2f78 0/1 Pending 0 26d
kube-system kube-proxy-4jrhl 1/1 NodeLost 0 30d
kube-system kube-proxy-dmqcr 1/1 Running 0 30d
kube-system kube-scheduler-localhost.localdomain 1/1 Unknown 0 30d
kube-system weave-net-jj68d 2/2 Running 0 30d
kube-system weave-net-pdk54 2/2 NodeLost 1 30d
kubernetes-dashboard dashboard-metrics-scraper-878cb9dc4-dvzsz 1/1 Unknown 0 30d
kubernetes-dashboard dashboard-metrics-scraper-878cb9dc4-trjdv 1/1 Running 0 30d
kubernetes-dashboard kubernetes-dashboard-5bc5dbff7f-lnzlc 1/1 Unknown 0 30d
kubernetes-dashboard kubernetes-dashboard-5bc5dbff7f-z2l5x 1/1 Running 3 30d
rook-ceph rook-ceph-operator-57ffb4fd9f-lbdg7 1/1 Running 1807 30d
rook-ceph rook-ceph-operator-57ffb4fd9f-vglhr 0/1 Unknown 53 30d
很疑惑,待查资料。。。?
?
|