在node节点使用kubectl:
root@multinode-demo-m02:/# ps aux | grep kubelet
root 218 3.1 1.6 2066316 62516 ? Ssl 07:35 0:29 /var/lib/minikube/binaries/v1.30.0/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --config=/var/lib/kubelet/config.yaml --hostname-override=multinode-demo-m02 --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.49.3
root 3941 0.0 0.0 3456 720 pts/1 S+ 07:51 0:00 grep --color=auto kubelet
root@multinode-demo-m02:/#
root@multinode-demo-m02:/#
root@multinode-demo-m02:/# kubectl get pods --kubeconfig=/etc/kubernetes/kubelet.conf
NAME READY STATUS RESTARTS AGE
nginx-6c485c9fbb-hpbjj 1/1 Running 1 (23h ago) 24h
nginx-6c485c9fbb-nrw6c 1/1 Running 1 (23h ago) 24h
root@multinode-demo-m02:/#
root@multinode-demo-m02:/# kubectl get pod nginx-6c485c9fbb-hpbjj -o yaml --kubeconfig=/etc/kubernetes/kubelet.conf
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2024-10-08T07:05:05Z"
generateName: nginx-6c485c9fbb-
labels:
app: nginx
pod-template-hash: 6c485c9fbb
name: nginx-6c485c9fbb-hpbjj
--end--