You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide explains how to run a sharded kcp environment locally for development and testing purposes.
4
+
5
+
## Using `sharded-test-server`
6
+
7
+
The easiest way to stand up a sharded environment is using the `sharded-test-server` tool. This tool automates the creation of a root shard, additional shards, a front proxy, and all necessary certificates.
8
+
9
+
### Prerequisites
10
+
11
+
build the tool before running it:
12
+
13
+
```bash
14
+
make build WHAT=./cmd/sharded-test-server
15
+
```
16
+
17
+
### Running the Server
18
+
19
+
To start a cluster with 2 shards (Shard-0/Root and Shard-1):
20
+
21
+
```bash
22
+
./bin/sharded-test-server --number-of-shards=2
23
+
```
24
+
25
+
This command will launch:
26
+
27
+
-**Shard-0 (Root):** Hosting the root logical cluster and core APIs.
28
+
-**Shard-1:** A secondary shard joined to the root.
29
+
-**Front Proxy:** Handles routing requests to the appropriate shard.
30
+
31
+
### Accessing the Cluster
32
+
33
+
The tool generates several kubeconfig files in the current directory (or the path specified by `--work-dir-path`):
34
+
35
+
-`.kcp/admin.kubeconfig`: **Primary Admin Access.** connects via the front-proxy. Use this for most operations.
36
+
-`.kcp-0/admin.kubeconfig`: Direct access to Shard-0 (Root).
37
+
-`.kcp-1/admin.kubeconfig`: Direct access to Shard-1.
38
+
39
+
### Verification
40
+
41
+
To verify that your shards are running and registered, query the `Shard` resources from the root shard:
42
+
43
+
```bash
44
+
KUBECONFIG=.kcp/admin.kubeconfig kubectl get shards
45
+
```
46
+
47
+
You should see both `root` (shard-0) and `shard-1` listed.
0 commit comments