Skip to content

Commit 7917ca2

Browse files
tillrohrmannclaude
andcommitted
Document cluster.autoProvision feature and update examples
- Add spec.cluster section to README with autoProvision field documentation - Add warning about disabling other provisioning methods when using operator-managed provisioning (via config or RESTATE_AUTO_PROVISION env var) - Update all examples to use cluster.autoProvision: true with auto-provision = false (minimal, Raft, S3 examples) - Update auto-provision config documentation to emphasize it must be false when using operator-managed provisioning - Update networkPeers documentation to use 'node' instead of 'metrics' - Add allowOperatorAccessToNode field documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9f2e123 commit 7917ca2

2 files changed

Lines changed: 39 additions & 7 deletions

File tree

README.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The `RestateCluster` CRD defines a Restate cluster. The operator watches for the
6060
**All other traffic is denied by default.**
6161

6262
The default behaviour can be disabled with `spec.security.disableNetworkPolicies: true`.
63-
Alternatively, you can add new allowed inbound callers of the Restate ports with `spec.security.networkPeers.{ingress,admin,metrics}`, which are arrays of [`NetworkPolicyPeer`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#networkpolicypeer-v1-networking-k8s-io).
63+
Alternatively, you can add new allowed inbound callers of the Restate ports with `spec.security.networkPeers.{ingress,admin,node}`, which are arrays of [`NetworkPolicyPeer`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#networkpolicypeer-v1-networking-k8s-io).
6464
You can allow new outbound destinations by adding to the `spec.security.networkEgressRules` list, which is an array of [`NetworkPolicyEgressRule`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#networkpolicyegressrule-v1-networking-k8s-io).
6565

6666
**NOTE**: Each cluster is created in its own namespace. Naming the cluster after an existing Namespace is supported, but deploying into namespaces with other applications is not recommended.
@@ -75,10 +75,14 @@ kind: RestateCluster
7575
metadata:
7676
name: restate-test
7777
spec:
78+
cluster:
79+
autoProvision: true
7880
compute:
7981
image: restatedev/restate:1.5
8082
storage:
8183
storageRequestBytes: 2147483648 # 2 GiB
84+
config: |
85+
auto-provision = false
8286
```
8387
8488
For the full schema as a [Pkl](https://pkl-lang.org/) template see [`crd/RestateCluster.pkl`](./crd/RestateCluster.pkl).
@@ -92,6 +96,7 @@ More examples are available just below the spec that follows.
9296
| `compute` | `object` | Compute configuration. See details below. |
9397
| `storage` | `object` | Storage configuration. See details below. |
9498
| `security` | `object` | Security configuration. See details below. |
99+
| `cluster` | `object` | Cluster-wide configuration options. See details below. |
95100
| `config` | `string` | TOML-encoded Restate config file. See details below. |
96101
| `clusterName` | `string` | Sets the `RESTATE_CLUSTER_NAME` environment variable. Defaults to the object name. |
97102

@@ -125,6 +130,28 @@ More examples are available just below the spec that follows.
125130

126131
---
127132

133+
#### `spec.cluster`
134+
135+
| Field | Type | Description |
136+
|---|---|---|
137+
| `autoProvision` | `boolean` | If `true`, the operator will automatically provision the cluster via gRPC after pods are running. Defaults to `false`. |
138+
139+
> ⚠️ **Important**: When `cluster.autoProvision` is set to `true`, you **must** disable all other forms of cluster provisioning:
140+
> - Set `auto-provision = false` in `spec.config`, or set the `RESTATE_AUTO_PROVISION=false` environment variable
141+
> - Do not use any sidecar containers or init containers that run `restatectl provision`
142+
> - Do not manually provision the cluster
143+
>
144+
> Running multiple provisioning methods simultaneously can lead to split brain situations in the Restate cluster.
145+
146+
When enabled, the operator will:
147+
1. Wait for the `restate-0` pod to be in `Running` state
148+
2. Call the Restate gRPC `ProvisionCluster` API
149+
3. Set `status.provisioned = true` to avoid repeated provisioning attempts
150+
151+
This feature is particularly useful for Raft-based metadata clusters where manual provisioning was previously required.
152+
153+
---
154+
128155
#### `spec.security`
129156

130157
| Field | Type | Description |
@@ -191,7 +218,7 @@ While the `config` field accepts any valid [Restate server configuration](https:
191218
* `destination`: The S3 URI where snapshots will be stored (e.g., `s3://my-bucket/snapshots`).
192219
* `snapshot-interval-num-records`: How many log records are processed in a particular partition before a new snapshot is taken.
193220

194-
* **`auto-provision`**: A boolean that controls whether the cluster should automatically initialize itself. This should be `true` for object-store metadata but `false` when using the `replicated` (Raft) metadata store, which requires manual provisioning.
221+
* **`auto-provision`**: A boolean that controls whether the Restate node should automatically initialize itself. **When using `cluster.autoProvision: true` (recommended), this must be set to `false`.** If not using operator-managed provisioning, this can be `true` for object-store metadata but must be `false` for `replicated` (Raft) metadata store.
195222

196223
* **Resource Management**:
197224
* `rocksdb-total-memory-size`: Sets the total memory allocated to RocksDB, which Restate uses for its internal state storage. Typically 75% of the memory requests for the pod is appropriate.
@@ -207,6 +234,8 @@ kind: RestateCluster
207234
metadata:
208235
name: restate-test
209236
spec:
237+
cluster:
238+
autoProvision: true
210239
compute:
211240
replicas: 3
212241
image: restatedev/restate:1.5
@@ -220,8 +249,7 @@ spec:
220249
"metadata-server",
221250
"http-ingress",
222251
]
223-
# auto-provision should not be turned on when using the raft metadata store
224-
# provision with kubectl -n restate-test exec -it restate-0 -- restatectl provision
252+
# auto-provision must be false when using operator-managed provisioning
225253
auto-provision = false
226254
default-num-partitions = 128
227255
default-replication = 2
@@ -250,6 +278,8 @@ kind: RestateCluster
250278
metadata:
251279
name: restate-test
252280
spec:
281+
cluster:
282+
autoProvision: true
253283
compute:
254284
replicas: 3
255285
image: restatedev/restate:1.5
@@ -266,7 +296,8 @@ spec:
266296
"log-server",
267297
"http-ingress",
268298
]
269-
auto-provision = true
299+
# auto-provision must be false when using operator-managed provisioning
300+
auto-provision = false
270301
default-num-partitions = 128
271302
default-replication = 2
272303

docs/minio.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ kind: RestateCluster
9393
metadata:
9494
name: restate-minio-test
9595
spec:
96+
clusterProvisioning:
97+
enabled: true
9698
compute:
9799
replicas: 3
98100
image: restatedev/restate:1.5
@@ -117,8 +119,7 @@ spec:
117119
storageRequestBytes: 2147483648 # 2 GiB
118120
config: |
119121
roles = [ "worker", "admin", "log-server", "metadata-server" , "http-ingress" ]
120-
# auto-provision should not be turned on when using the raft metadata store
121-
# provision with kubectl -n restate-test exec -it restate-0 -- restatectl provision
122+
# auto-provision must be false when using operator-managed provisioning
122123
auto-provision = false
123124
default-num-partitions = 128
124125
default-replication = 2

0 commit comments

Comments
 (0)