差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| tech:kubectl [2023/02/04 16:47] – jonathan | tech:kubectl [2025/12/06 11:57] (目前版本) – [檢查 K8s Cluster 的健康狀態] jonathan | ||
|---|---|---|---|
| 行 6: | 行 6: | ||
| ===== 檢查 K8s Cluster 的健康狀態 ===== | ===== 檢查 K8s Cluster 的健康狀態 ===== | ||
| - | * 參考 - https:// | + | * 檢查 API server< |
| - | * < | + | kubectl get --raw='/ |
| - | $ kubectl get componentstatus | + | |
| - | NAME | + | |
| - | controller-manager | + | |
| - | scheduler | + | |
| - | etcd-0 | + | |
| </ | </ | ||
| + | * ++看實際執行結果|< | ||
| + | jonathan@k3s-master-171: | ||
| + | [+]ping ok | ||
| + | [+]log ok | ||
| + | [+]etcd ok | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | [+]autoregister-completion ok | ||
| + | [+]poststarthook/ | ||
| + | [+]poststarthook/ | ||
| + | healthz check passed | ||
| + | </ | ||
| + | * 檢查 etcd< | ||
| + | kubectl get --raw='/ | ||
| + | </ | ||
| + | * ++看實際執行結果|< | ||
| + | jonathan@k3s-master-171: | ||
| + | ok | ||
| + | </ | ||
| + | * 檢查 kube-system <cli> | ||
| + | kubectl get pods -n kube-system | ||
| + | </ | ||
| + | * ++看實際執行結果|< | ||
| + | jonathan@k3s-master-171: | ||
| + | NAME READY | ||
| + | coredns-64fd4b4794-28wrz | ||
| + | local-path-provisioner-774c6665dc-t8g2l | ||
| + | metrics-server-7bfffcd44-5mkbj | ||
| + | </ | ||
| ===== 讀取 K8s Cluster Name 的方式 ===== | ===== 讀取 K8s Cluster Name 的方式 ===== | ||
| 行 144: | 行 192: | ||
| ===== 顯示 K8s 內的 deploy 清單 ===== | ===== 顯示 K8s 內的 deploy 清單 ===== | ||
| - | * <cli>kubctl | + | * <cli>kubectl |
| localadmin@iiidevops-73: | localadmin@iiidevops-73: | ||
| NAME | NAME | ||
| 行 164: | 行 212: | ||
| ===== 顯示 K8s 內的 namespace 清單 ===== | ===== 顯示 K8s 內的 namespace 清單 ===== | ||
| - | * <cli>kubctl | + | * <cli>kubectl |
| iiidevops@iiidevops1: | iiidevops@iiidevops1: | ||
| NAME | NAME | ||
| 行 283: | 行 331: | ||
| </ | </ | ||
| + | ===== 刪除 PVC 後一直在 Terminating 狀態 | ||
| + | * 查看卡住的 PVC< | ||
| + | kubectl get pvc -n < | ||
| + | </ | ||
| + | * 移除 finalizer 強制刪除< | ||
| + | kubectl patch pvc < | ||
| + | </ | ||
| + | * ++看實際處理訊息|< | ||
| + | jonathan@k3s-master-171: | ||
| + | librenms-frontend-data | ||
| + | jonathan@k3s-master-171: | ||
| + | persistentvolumeclaim/ | ||
| + | </ | ||
| {{tag> | {{tag> | ||