@@ -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:
8787kubectl 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
92229Vertical 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
137274To 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
141278apiVersion : operations.kubeblocks.io/v1alpha1
142279kind : OpsRequest
143280metadata :
144- name : pg -volumeexpansion
281+ name : weaviate -volumeexpansion
145282 namespace : demo
146283spec :
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
0 commit comments