# Run controller locally

1. Build the controller binary: `make build`

2. Proxy regional-server service locally: `kubectl port-forward -n regional-server-system svc/regional-server 8080:80`

3. Create a tidb cluster from tidbcloud console

4. Replace tenant, project, cluster id in *ticdc.yaml* with your newly create cluster

5. Set reconciler label and label selector in *ticdc.yaml* and *controller-config.yaml*

6. Run controller: `bin/manager controller -c examples/controller-config.yaml`

7. Create a `TiCDC` CR: `kubectl apply -f examples/ticdc.yaml`
