跳至主要内容

已註冊的叢集

本頁面列出的命令/步驟可用於檢查你正在註冊或已在 Rancher 中註冊的叢集。

確保你配置了正確的 kubeconfig(例如,export KUBECONFIG=$PWD/kubeconfig_from_imported_cluster.yml)

Rancher 代理程式​

與叢集的通訊(透過 cattle-cluster-agent 的 Kubernetes API)以及與節點的通訊是透過 Rancher 代理程式完成的。

如果 cattle-cluster-agent 無法連線到配置的 server-url,叢集將保持在 Pending 狀態,顯示 Waiting for full cluster configuration。

cattle-node-agent​

備註

cattle-node-agent 僅存在於使用 RKE 在 Rancher 中建立的叢集中。

檢查 cattle-node-agent Pod 是否存在於每個節點上,具有 Running 狀態,並且沒有大量的重新啟動:

kubectl -n cattle-system get pods -l app=cattle-agent -o wide

範例輸出:

NAME                      READY     STATUS    RESTARTS   AGE       IP                NODE
cattle-node-agent-4gc2p 1/1 Running 0 2h x.x.x.x worker-1
cattle-node-agent-8cxkk 1/1 Running 0 2h x.x.x.x etcd-1
cattle-node-agent-kzrlg 1/1 Running 0 2h x.x.x.x etcd-0
cattle-node-agent-nclz9 1/1 Running 0 2h x.x.x.x controlplane-0
cattle-node-agent-pwxp7 1/1 Running 0 2h x.x.x.x worker-0
cattle-node-agent-t5484 1/1 Running 0 2h x.x.x.x controlplane-1
cattle-node-agent-t8mtz 1/1 Running 0 2h x.x.x.x etcd-2

檢查特定 cattle-node-agent Pod 或所有 cattle-node-agent Pod 的日誌記錄:

kubectl -n cattle-system logs -l app=cattle-agent

cattle-cluster-agent​

檢查 cattle-cluster-agent Pod 是否存在於叢集中,具有 Running 狀態,並且沒有大量的重新啟動:

kubectl -n cattle-system get pods -l app=cattle-cluster-agent -o wide

範例輸出:

NAME                                    READY     STATUS    RESTARTS   AGE       IP           NODE
cattle-cluster-agent-54d7c6c54d-ht9h4 1/1 Running 0 2h x.x.x.x worker-1

檢查 cattle-cluster-agent Pod 的日誌記錄:

kubectl -n cattle-system logs -l app=cattle-cluster-agent