|
1 | 1 | # Sharding |
2 | 2 |
|
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 | | -
|
9 | 3 | kcp's architecture primarily consists of the front-proxy, the cache-server and shards. Shards are kcp's primary scaling mechanism for workspace capacity. |
10 | 4 |
|
11 | 5 | 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 |
105 | 99 | VW-->>Op: consumer resources |
106 | 100 | ``` |
107 | 101 |
|
| 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 | + |
108 | 153 | ## Related |
109 | 154 |
|
110 | 155 | - [kcp](./kcp.md) |
|
0 commit comments