## Module 3: Check The Status Of The Deployed TiDB Cluster

### Step 1. Check TiDB cluster status using kubectl

+ On the Kubernetes control machine, check the TidbCluster resource:

   ```bash
   kubectl get tidbcluster -n tidb-cluster
   ```

   ```output
   NAME        READY   PD   STORAGE   READY   TIKV   STORAGE   READY   TIDB   AGE
   tidb-demo   True    1/1         1/1      1/1    1/1       5m
   ```

+ Check the status of all TiDB-related pods:

   ```bash
   kubectl get pods -n tidb-cluster
   ```

   ```output
   NAME                              READY   STATUS    RESTARTS   AGE
   tidb-demo-pd-0                    1/1     Running   0          5m
   tidb-demo-tidb-0                  1/1     Running   0          5m
   tidb-demo-tikv-0                  1/1     Running   0          5m
   ```

### Step 2. Check TiDB service

+ Verify the TiDB service is exposed via LoadBalancer (internal NLB on EKS):

   ```bash
   kubectl get svc -n tidb-cluster
   ```

   ```output
   NAME              TYPE           CLUSTER-IP      EXTERNAL-IP                                              PORT(S)    AGE
   tidb-demo-tidb    LoadBalancer   10.100.x.x      internal-xxxxx.elb.us-west-2.amazonaws.com   4000:xxxxx/TCP   5m
   ...
   ```

+ The TiDB MySQL port 4000 is exposed via an internal Network Load Balancer. You can connect to TiDB at `${TIDB_HOST}:4000` (the bastion is in the same VPC and can reach the internal NLB).

### Step 3. Check cluster status with TiDB Dashboard (optional)

+ If TiDB Dashboard is enabled, you can access it via port-forward. For this minimal lab setup, the primary way to verify the cluster is to connect via MySQL client as shown in Module 4.
