Skip to content

Commit 8f30914

Browse files
authored
Fix the CRD upgrade and uninstall instructions (#283)
Signed-off-by: Dan Barr <[email protected]> Co-authored-by: Dan Barr <[email protected]>
1 parent 6a93ebf commit 8f30914

File tree

2 files changed

+80
-19
lines changed

2 files changed

+80
-19
lines changed

docs/toolhive/guides-k8s/deploy-operator-helm.mdx

Lines changed: 78 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ MCPServer resources. The CRDs define the structure and behavior of MCPServers in
2525
your cluster.
2626

2727
```bash
28-
helm upgrade -i toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds
28+
helm upgrade --install toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds
2929
```
3030

3131
This command installs the latest version of the ToolHive operator CRDs Helm
3232
chart. To install a specific version, append `--version <VERSION>` to the
3333
command, for example:
3434

3535
```bash
36-
helm upgrade -i toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds --version 0.0.21
36+
helm upgrade --install toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds --version 0.0.52
3737
```
3838

3939
## Install the operator
@@ -44,15 +44,15 @@ To install the ToolHive operator using default settings, run the following
4444
command:
4545

4646
```bash
47-
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --create-namespace
47+
helm upgrade --install toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --create-namespace
4848
```
4949

5050
This command installs the latest version of the ToolHive operator CRDs Helm
5151
chart. To install a specific version, append `--version <VERSION>` to the
5252
command, for example:
5353

5454
```bash
55-
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --create-namespace --version 0.2.10
55+
helm upgrade --install toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --create-namespace --version 0.3.7
5656
```
5757

5858
Verify the installation:
@@ -88,7 +88,7 @@ operator:
8888
Install the operator with your custom values:
8989
9090
```bash {3}
91-
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator\
91+
helm upgrade --install toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator\
9292
-n toolhive-system --create-namespace\
9393
-f values.yaml
9494
```
@@ -129,7 +129,7 @@ operator:
129129
Reference the `values.yaml` file when you install the operator using Helm:
130130

131131
```bash {3}
132-
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator \
132+
helm upgrade --install toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator \
133133
-n toolhive-system --create-namespace
134134
-f values.yaml
135135
```
@@ -170,7 +170,7 @@ environment.
170170
Reference the `values.yaml` file when you install the operator using Helm:
171171

172172
```bash {3}
173-
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator \
173+
helm upgrade --install toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator \
174174
-n toolhive-system --create-namespace
175175
-f values.yaml
176176
```
@@ -223,38 +223,99 @@ kubectl logs -n toolhive-system <TOOLHIVE_OPERATOR_POD_NAME>
223223

224224
## Upgrade the operator
225225

226-
To upgrade the ToolHive operator to a new version, use the same commands you
227-
used to install it. First, upgrade the CRDs if a new version is available:
226+
To upgrade the ToolHive operator to a new version, you need to upgrade both the
227+
CRDs and the operator installation.
228+
229+
### Upgrade the CRDs
230+
231+
To upgrade the ToolHive operator to a new version, upgrade the CRDs first. Helm
232+
does not upgrade CRDs automatically, so you need to upgrade the CRD Helm chart
233+
and then apply the CRDs using `kubectl`.
234+
235+
![Latest CRD Helm chart release](https://img.shields.io/github/v/release/stacklok/toolhive?filter=toolhive-operator-crds-*&style=for-the-badge&logo=helm&label=Latest%20CRD%20chart&color=097aff)
236+
237+
First, upgrade the CRD Helm chart to match your target operator version:
228238

229239
```bash
230-
helm upgrade -i toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds
240+
helm upgrade -i toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds --version 0.0.52
231241
```
232242

233-
Then upgrade the operator itself:
243+
Then apply the CRDs from the same version tag:
234244

235245
```bash
236-
helm upgrade toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --reuse-values
246+
kubectl apply -f https://raw.githubusercontent.com/stacklok/toolhive/refs/tags/toolhive-operator-crds-0.0.52/deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcpexternalauthconfigs.yaml
247+
kubectl apply -f https://raw.githubusercontent.com/stacklok/toolhive/refs/tags/toolhive-operator-crds-0.0.52/deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcptoolconfigs.yaml
248+
kubectl apply -f https://raw.githubusercontent.com/stacklok/toolhive/refs/tags/toolhive-operator-crds-0.0.52/deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcpremoteproxies.yaml
249+
kubectl apply -f https://raw.githubusercontent.com/stacklok/toolhive/refs/tags/toolhive-operator-crds-0.0.52/deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcpservers.yaml
250+
kubectl apply -f https://raw.githubusercontent.com/stacklok/toolhive/refs/tags/toolhive-operator-crds-0.0.52/deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcpgroups.yaml
251+
kubectl apply -f https://raw.githubusercontent.com/stacklok/toolhive/refs/tags/toolhive-operator-crds-0.0.52/deploy/charts/operator-crds/crds/toolhive.stacklok.dev_mcpregistries.yaml
252+
```
253+
254+
Replace `0.0.52` in both commands with your target CRD version.
255+
256+
### Upgrade the operator Helm release
257+
258+
Then, upgrade the operator installation using Helm.
259+
260+
![Latest Operator Helm chart release](https://img.shields.io/github/v/release/stacklok/toolhive?filter=toolhive-operator-0*&style=for-the-badge&logo=helm&label=Latest%20Operator%20chart&color=097aff)
261+
262+
```bash
263+
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --reuse-values
237264
```
238265

239266
This upgrades the operator to the latest version available in the OCI registry.
267+
To upgrade to a specific version, add the `--version` flag:
268+
269+
```bash
270+
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --reuse-values --version 0.3.7
271+
```
272+
240273
If you have a custom `values.yaml` file, include it with the `-f` flag:
241274

242275
```bash
243-
helm upgrade toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --reuse-values -f values.yaml
276+
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --reuse-values -f values.yaml
244277
```
245278

246279
## Uninstall the operator
247280

248-
To uninstall the operator and CRDs, run the following commands:
281+
To uninstall the operator and CRDs:
282+
283+
First, uninstall the operator:
249284

250285
```bash
251286
helm uninstall toolhive-operator -n toolhive-system
287+
```
288+
289+
Then, if you want to completely remove ToolHive including all CRDs and related
290+
resources, delete the CRDs manually.
291+
292+
:::warning
293+
294+
This will delete all MCPServer and related resources in your cluster!
295+
296+
:::
297+
298+
```bash
299+
kubectl delete crd mcpexternalauthconfigs.toolhive.stacklok.dev
300+
kubectl delete crd mcptoolconfigs.toolhive.stacklok.dev
301+
kubectl delete crd mcpremoteproxies.toolhive.stacklok.dev
302+
kubectl delete crd mcpservers.toolhive.stacklok.dev
303+
kubectl delete crd mcpgroups.toolhive.stacklok.dev
304+
kubectl delete crd mcpregistries.toolhive.stacklok.dev
305+
```
306+
307+
Finally, uninstall the CRD Helm chart metadata:
308+
309+
```bash
252310
helm uninstall toolhive-operator-crds
253311
```
254312

255-
This removes all the Kubernetes components associated with the chart and deletes
256-
the release. You'll need to delete the namespace manually if you used Helm to
257-
create it.
313+
If you created the `toolhive-system` namespace with Helm's `--create-namespace`
314+
flag, delete it manually:
315+
316+
```bash
317+
kubectl delete namespace toolhive-system
318+
```
258319

259320
## Next steps
260321

docs/toolhive/tutorials/quickstart-k8s.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ watch for MCP server resources and manage their lifecycle automatically.
105105
First, install the operator CRDs:
106106

107107
```bash
108-
helm upgrade -i toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds
108+
helm upgrade --install toolhive-operator-crds oci://ghcr.io/stacklok/toolhive/toolhive-operator-crds
109109
```
110110

111111
Then install the operator:
112112

113113
```bash
114-
helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --create-namespace
114+
helm upgrade --install toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator -n toolhive-system --create-namespace
115115
```
116116

117117
Verify that the operator deployed successfully:

0 commit comments

Comments
 (0)