# 集群检查工具 **Repository Path**: CodeGrok/cdt ## Basic Information - **Project Name**: 集群检查工具 - **Description**: No description available - **Primary Language**: Rust - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-19 - **Last Updated**: 2026-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CDT - Cluster Diagnose Tool A powerful CLI tool for diagnosing Kubernetes clusters and bare-metal servers. ## Features ### K8s Mode - `pod ` - Diagnose specific Pod issues - `net [pod] ` - Network connectivity test (host mode or pod-in mode) - `node [target]` - Node diagnostic (local or remote via SSH) - `lb ` - Load balancer / Service check - `events [pod]` - View K8s events - `nodes` - Node status overview - `scan` - Quick scan for abnormal Pods ### Bare Metal Mode - `dns` - Check DNS configuration - `net ` - Network connectivity test ## Quick Start ```bash # Download binary chmod +x cdt ./cdt # Select mode 1. K8s Cluster 2. Bare Metal # K8s mode commands > pod my-app > net my-app google.com > node 192.168.1.100 > lb my-service > scan ``` ## Installation ### Linux ```bash # Download from releases or build from source curl -L -o cdt https://gitee.com/CodeGrok/cdt/releases chmod +x cdt sudo mv cdt /usr/local/bin/ ``` ### Build from Source ```bash git clone git@gitee.com:CodeGrok/cdt.git cd cdt cargo build --release ./target/release/cdt ``` ## Configuration CDT automatically searches for kubectl and kubeconfig: ### kubectl Path 1. PATH environment variable 2. `/usr/local/bin/kubectl` 3. `which kubectl` ### kubeconfig Path 1. `KUBECONFIG` environment variable 2. `/etc/kubernetes/admin.conf` 3. `/etc/kubernetes/kubelet-config.yaml` 4. `/etc/kubernetes/kubelet.conf` 5. `~/.kube/config` If no kubeconfig is found, CDT will prompt you to enter the path. ## Architecture ``` cdt/ ├── src/ │ ├── main.rs # Entry point │ ├── k8s/ # K8s mode module │ │ ├── pod.rs # Pod diagnosis │ │ ├── net.rs # Network diagnosis │ │ ├── lb.rs # Load balancer │ │ ├── events.rs # Events viewer │ │ ├── nodes.rs # Node status │ │ ├── scan.rs # Quick scan │ │ └── node_check.rs # Node diagnostic │ └── host/ # Bare metal module │ ├── dns.rs # DNS check │ └── network.rs # Network test └── target/release/cdt # Binary ``` ## License MIT