Skip to content

Commit ef5848b

Browse files
authored
docs: add Weaviate config examples and fix paths (#3244)
1 parent 15c011e commit ef5848b

13 files changed

Lines changed: 298 additions & 18 deletions

File tree

addons/pulsar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ spec:
821821
By default, Pulsar does not expose any service to the external network. If you want to expose the service to the external network, you can enable the NodePort service.
822822

823823
```yaml
824-
kubectl apply -f examples/pulsar/cluster-nodeport.yaml
824+
kubectl apply -f examples/pulsar/cluster-node-port.yaml
825825
```
826826

827827
The key difference are:

addons/starrocks-ce/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ It sets up the `PodMonitor` to monitor this StarRocks cluster and scrapes the me
405405
406406
##### Access the Grafana Dashboard
407407
408-
Login to the Grafana dashboard and import the dashboard provided in this example `./examples/starrocks-ce/dashboard/starrocks.json`.
408+
Login to the Grafana dashboard and import the dashboard provided in this example `./examples/starrocks-ce/grafana/starrocks.json`.
409409

410410
You may refer to following links for more information:
411411
- StarRocks Overview provided by StarRocks team: [StarRocks Overview](https://github.com/StarRocks/starrocks/blob/main/extra/grafana/kubernetes/StarRocks-Overview-kubernetes-3.0.json)

addons/weaviate/README.md

Lines changed: 145 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In Weaviate, metadata replication and data replication are separate. For the met
1010

1111
| Horizontal<br/>scaling | Vertical <br/>scaling | Expand<br/>volume | Restart | Stop/Start | Configure | Expose | Switchover |
1212
|------------------------|-----------------------|-------------------|-----------|------------|-----------|--------|------------|
13-
| No | Yes | Yes | Yes | Yes | No | Yes | N/A |
13+
| No | Yes | Yes | Yes | Yes | Yes | Yes | N/A |
1414

1515
### Versions
1616

@@ -87,6 +87,143 @@ spec:
8787
kubectl apply -f examples/weaviate/cluster.yaml
8888
```
8989

90+
### Create with a custom configuration file
91+
92+
Starting with KubeBlocks 1.0, Weaviate configuration is managed through the
93+
`Cluster.spec.componentSpecs[].configs` Configuration API. The previous
94+
`ParametersDefinition` and `ParamConfigRenderer` resources are no longer used.
95+
96+
The example supplies a complete `conf.yaml` template through a ConfigMap and
97+
sets `query_defaults.limit` to `100` when the cluster is created:
98+
99+
Replace `<your-weaviate-component-definition>` in the example with the
100+
ComponentDefinition installed for the Weaviate version you want to run.
101+
102+
```yaml
103+
# cat examples/weaviate/cluster-with-config-template.yaml
104+
apiVersion: v1
105+
kind: ConfigMap
106+
metadata:
107+
name: custom-weaviate-config-template
108+
namespace: demo
109+
data:
110+
conf.yaml: |-
111+
---
112+
authentication:
113+
anonymous_access:
114+
enabled: true
115+
authorization:
116+
admin_list:
117+
enabled: false
118+
query_defaults:
119+
limit: {{ .query_defaults_limit }}
120+
debug: false
121+
---
122+
apiVersion: apps.kubeblocks.io/v1
123+
kind: Cluster
124+
metadata:
125+
name: weaviate-cluster-with-config
126+
namespace: demo
127+
spec:
128+
terminationPolicy: Delete
129+
componentSpecs:
130+
- name: weaviate
131+
componentDef: weaviate
132+
serviceVersion: 1.19.6
133+
replicas: 1
134+
configs:
135+
# The name must match ComponentDefinition.spec.configs[].name.
136+
- name: weaviate-config-template
137+
configMap:
138+
name: custom-weaviate-config-template
139+
variables:
140+
query_defaults_limit: "100"
141+
resources:
142+
limits:
143+
cpu: "1"
144+
memory: 1Gi
145+
requests:
146+
cpu: "0.5"
147+
memory: 512Mi
148+
volumeClaimTemplates:
149+
- name: data
150+
spec:
151+
accessModes:
152+
- ReadWriteOnce
153+
resources:
154+
requests:
155+
storage: 20Gi
156+
157+
```
158+
159+
```bash
160+
kubectl apply -f examples/weaviate/cluster-with-config-template.yaml
161+
```
162+
163+
The config name `weaviate-config-template` must match the corresponding entry
164+
in `ComponentDefinition.spec.configs`. The ConfigMap contains the file template,
165+
while `variables` contains the values rendered into that template.
166+
167+
#### Discover available configurations
168+
169+
Configuration does not provide the parameter schema or value discovery that
170+
was previously supplied by `ParametersDefinition` and `ParamConfigRenderer`.
171+
Use the following sources to determine what can be configured.
172+
173+
List the configuration files exposed by the Weaviate ComponentDefinition:
174+
175+
```bash
176+
WEAVIATE_COMPONENT_DEFINITION="<your-weaviate-component-definition>"
177+
kubectl get cmpd "${WEAVIATE_COMPONENT_DEFINITION}" \
178+
-o jsonpath='{range .spec.configs[*]}{.name}{"\t"}{.template}{"\t"}{.namespace}{"\n"}{end}'
179+
```
180+
181+
Inspect the default file templates:
182+
183+
```bash
184+
kubectl get configmap weaviate-config-template -n kb-system \
185+
-o go-template='{{ index .data "conf.yaml" }}'
186+
187+
kubectl get configmap weaviate-env-config-template -n kb-system \
188+
-o go-template='{{ index .data "envs" }}'
189+
```
190+
191+
For a custom ConfigMap, the placeholders in the file template define the
192+
variable names accepted under `configs[].variables`. For example,
193+
`{{ .query_defaults_limit }}` in this example defines the
194+
`query_defaults_limit` variable. KubeBlocks renders the supplied string value
195+
but does not validate its type or allowed range.
196+
197+
Refer to the [Weaviate environment variable reference][weaviate-env-vars] for
198+
the engine settings, value formats, and defaults. Check that each setting is
199+
supported by Weaviate 1.19.6 because the latest documentation also describes
200+
settings introduced by newer releases.
201+
202+
Inspect the files actually consumed by a running Pod to confirm the effective
203+
rendered values:
204+
205+
```bash
206+
kubectl exec -n demo weaviate-cluster-with-config-weaviate-0 \
207+
-- cat /weaviate-config/conf.yaml
208+
209+
kubectl exec -n demo weaviate-cluster-with-config-weaviate-0 \
210+
-- cat /weaviate-env/envs
211+
```
212+
213+
### Update the custom configuration
214+
215+
Update the Configuration variable directly on the Cluster:
216+
217+
```bash
218+
kubectl patch cluster weaviate-cluster-with-config -n demo \
219+
--type=json \
220+
--patch-file=examples/weaviate/configure.json
221+
```
222+
223+
This changes `query_defaults.limit` from `100` to `150`. Weaviate 1.19.6 loads
224+
this file at startup, so KubeBlocks restarts the component Pods after rendering
225+
the changed file. This workflow does not create a Reconfiguring OpsRequest.
226+
90227
### Vertical scaling
91228

92229
Vertical scaling up or down specified components requests and limits cpu or memory resource in the cluster
@@ -137,20 +274,20 @@ If the `ALLOWVOLUMEEXPANSION` column is `true`, the storage class supports volum
137274
To increase size of volume storage with the specified components in the cluster
138275

139276
```yaml
140-
# cat examples/postgresql/volumeexpand.yaml
277+
# cat examples/weaviate/volumeexpand.yaml
141278
apiVersion: operations.kubeblocks.io/v1alpha1
142279
kind: OpsRequest
143280
metadata:
144-
name: pg-volumeexpansion
281+
name: weaviate-volumeexpansion
145282
namespace: demo
146283
spec:
147284
# Specifies the name of the Cluster resource that this operation is targeting.
148-
clusterName: pg-cluster
285+
clusterName: weaviate-cluster
149286
type: VolumeExpansion
150287
# Lists VolumeExpansion objects, each specifying a component and its corresponding volumeClaimTemplates that requires storage expansion.
151288
volumeExpansion:
152289
# Specifies the name of the Component.
153-
- componentName: postgresql
290+
- componentName: weaviate
154291
# volumeClaimTemplates specifies the storage size and volumeClaimTemplate name.
155292
volumeClaimTemplates:
156293
- name: data
@@ -159,7 +296,7 @@ spec:
159296
```
160297

161298
```bash
162-
kubectl apply -f examples/postgresql/volumeexpand.yaml
299+
kubectl apply -f examples/weaviate/volumeexpand.yaml
163300
```
164301

165302
### Restart
@@ -245,3 +382,5 @@ kubectl delete cluster -n demo weaviate-cluster
245382
## References
246383

247384
[^1]: Weaviate Cluster Architecture, <https://weaviate.io/developers/weaviate/concepts/replication-architecture/cluster-architecture#metadata-replication-raft>
385+
386+
[weaviate-env-vars]: https://docs.weaviate.io/deploy/configuration/env-vars

examples/apecloud-mysql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ kubectl apply -f examples/apecloud-mysql/scale-in.yaml
118118
> [!IMPORTANT]
119119
> On scaling in, the replica will be forgotten from the cluster's Raft group before it is deleted.
120120
121-
#### [Set Specified Replicas Offline](scale-in-specified-instance.yaml)
121+
#### [Set Specified Replicas Offline](scale-in-specified-pod.yaml)
122122

123123
There are cases where you want to set a specified replica offline, when it is problematic or you want to do some maintenance work on it. You can use the `onlineInstancesToOffline` field in the `spec.horizontalScaling.scaleIn` section to specify the instance names that need to be taken offline.
124124

examples/orchestrator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Orchestrator is a MySQL high availability and replication management tool, runs
3131

3232
## Examples
3333

34-
### [Create](cluster.yaml)
34+
### Create
3535

3636
Orchestrator cluster has two modes: *raft* and *share-backend*.
3737

examples/postgresql/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ This example will change the `max_connections` to `200`.
333333
kbcli cluster explain-config pg-cluster # kbcli is a command line tool to interact with KubeBlocks
334334
```
335335

336-
### [Backup](backup.yaml)
336+
### Backup
337337

338338
> [!IMPORTANT]
339339
> Before you start, please create a `BackupRepo` to store the backup data. Refer to [BackupRepo](../docs/create-backuprepo.md) for more details.
@@ -417,7 +417,7 @@ kubectl get backup -n demo -l app.kubernetes.io/instance=pg-cluster -l dataprote
417417

418418
WAL-G is an archival restoration tool for PostgreSQL, MySQL/MariaDB, and MS SQL Server (beta for MongoDB and Redis).[^2]
419419

420-
##### [Full Backup](basebackup-wal-g.yaml)
420+
##### [Full Backup](backup-wal-g.yaml)
421421

422422
To create wal-g backup for the cluster, it is a multi-step process.
423423

examples/pulsar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ spec:
301301
By default, Pulsar does not expose any service to the external network. If you want to expose the service to the external network, you can enable the NodePort service.
302302

303303
```yaml
304-
kubectl apply -f examples/pulsar/cluster-nodeport.yaml
304+
kubectl apply -f examples/pulsar/cluster-node-port.yaml
305305
```
306306

307307
The key difference are:

examples/rocketmq/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ spec:
151151
storage: 30Gi
152152
```
153153
154-
### [Restart](restart.yaml)
154+
### [Restart](restart-namesrv.yaml)
155155
156156
Restart the specified components in the cluster:
157157

examples/starrocks-ce/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ It sets up the `PodMonitor` to monitor this StarRocks cluster and scrapes the me
142142
143143
##### Access the Grafana Dashboard
144144
145-
Login to the Grafana dashboard and import the dashboard provided in this example `./examples/starrocks-ce/dashboard/starrocks.json`.
145+
Login to the Grafana dashboard and import the dashboard provided in this example `./examples/starrocks-ce/grafana/starrocks.json`.
146146

147147
You may refer to following links for more information:
148148
- StarRocks Overview provided by StarRocks team: [StarRocks Overview](https://github.com/StarRocks/starrocks/blob/main/extra/grafana/kubernetes/StarRocks-Overview-kubernetes-3.0.json)

examples/vanilla-postgresql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ NAME VERSIONS STATUS A
9191
vanilla-postgresql 12.15.0,14.7.0,15.7.0,15.6.1-138 Available Xd
9292
```
9393

94-
### [Horizontal scaling](horizontalscale.yaml)
94+
### Horizontal scaling
9595

9696
#### [Scale-out](scale-out.yaml)
9797

0 commit comments

Comments
 (0)