Skip to content

Commit ac83946

Browse files
authored
docs: improve sharding documentation (#232)
Signed-off-by: OlegErshov <olezhka1629@gmail.com> On-behalf-of: SAP aleh.yarshou@sap.com
1 parent b4aa533 commit ac83946

1 file changed

Lines changed: 51 additions & 6 deletions

File tree

reference/components/sharding.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Sharding
22

3-
> [!WARNING]
4-
> In Platform Mesh 0.3 sharding is experimental and expected to break. It
5-
> is possible to deploy the local-setup with multiple shards by using
6-
> one of the `:sharded` tasks or adding `--sharded` to the deployment
7-
> script.
8-
93
kcp's architecture primarily consists of the front-proxy, the cache-server and shards. Shards are kcp's primary scaling mechanism for workspace capacity.
104

115
This page only provides a terse overview of kcp's sharding to convey the concept. For a detailed discussion review the official kcp documentation:
@@ -105,6 +99,57 @@ sequenceDiagram
10599
VW-->>Op: consumer resources
106100
```
107101

102+
## Configuration
103+
104+
Platform Mesh configures sharding through the `infra` Helm chart. The `kcp.shards` array defines additional shards beyond the root shard.
105+
106+
### Shard configuration
107+
108+
| Value | Type | Default | Description |
109+
| --- | --- | --- | --- |
110+
| `kcp.shards` | list | `[{name: nereus}, {name: triton}]` | Additional shards beyond the root shard |
111+
| `kcp.shards[].name` | string | — | Shard name, used in resource names and DNS |
112+
| `kcp.shards[].hostname` | string | `<name>.kcp.<external.hostname>` | External hostname for the shard |
113+
| `kcp.shards[].spec` | object | inherits from `kcp.rootShard` | Per-shard overrides for replicas, resources, extraArgs |
114+
| `kcp.shards[].etcd` | object | inherits from `kcp.etcd` | Per-shard etcd configuration |
115+
116+
### Root shard and front proxy
117+
118+
| Value | Type | Default | Description |
119+
| --- | --- | --- | --- |
120+
| `kcp.rootShard.replicas` | int | `1` | Root shard replicas |
121+
| `kcp.rootShard.shardBaseURL` | string | `https://root.kcp.localhost:8443/` | Root shard external URL |
122+
| `kcp.rootShard.resources` | object | `{}` | Resource requests and limits |
123+
| `kcp.frontProxy.replicas` | int | `1` | Front proxy replicas |
124+
| `kcp.frontProxy.port` | int | `8443` | Front proxy service port |
125+
| `kcp.cacheServer.name` | string | `cache-server` | Cache server name |
126+
127+
### Example
128+
129+
```yaml
130+
kcp:
131+
shards:
132+
- name: triton
133+
hostname: triton.kcp.localhost
134+
- name: nereus
135+
hostname: nereus.kcp.localhost
136+
```
137+
138+
Each shard in the list gets its own etcd instance, TLS certificates, and TLSRoute for external access.
139+
140+
## Local setup
141+
142+
The Platform Mesh local setup runs in sharded mode by default with two additional shards (`nereus` and `triton`) alongside the root shard.
143+
144+
To run without additional shards, use the `:single-shard` task variants:
145+
146+
```bash
147+
task local-setup:single-shard
148+
task local-setup:single-shard:iterate
149+
```
150+
151+
The sharded kustomize overlay is at `local-setup/kustomize/overlays/platform-mesh-resource-sharded/`.
152+
108153
## Related
109154

110155
- [kcp](./kcp.md)

0 commit comments

Comments
 (0)