@@ -25,6 +25,9 @@ and the necessary users for migration and application execution are configured
2525and able to connect to a ` registry ` database. It also assumes that you have a
2626keycloak instance configured to act as identity provider.
2727
28+ All resources are created in the ` toolhive-system ` namespace. This namespace
29+ must exist before applying the deployment.
30+
2831For further details about user grants read the
2932[ Migration user privileges] ( ./database.mdx#migration-user-privileges ) and
3033[ Application user privileges] ( ./database.mdx#application-user-privileges )
@@ -36,6 +39,7 @@ apiVersion: apps/v1
3639kind : Deployment
3740metadata :
3841 name : registry-api
42+ namespace : toolhive-system
3943spec :
4044 replicas : 1
4145 selector :
6468 subPath : pgpass
6569 containers :
6670 - name : registry-api
67- image : ghcr.io/stacklok/toolhive-registry-server/ thv-registry-api:latest
71+ image : ghcr.io/stacklok/thv-registry-api:latest
6872 args :
6973 - serve
7074 - --config=/thv/config.yaml
@@ -110,6 +114,7 @@ apiVersion: v1
110114kind : ConfigMap
111115metadata :
112116 name : registry-api-config
117+ namespace : toolhive-system
113118data :
114119 config.yaml : |
115120 registryName: my-registry
@@ -142,6 +147,7 @@ apiVersion: v1
142147kind : Secret
143148metadata :
144149 name : registry-api-pgpass
150+ namespace : toolhive-system
145151type : Opaque
146152stringData :
147153 pgpass : |
@@ -152,6 +158,7 @@ apiVersion: v1
152158kind : Service
153159metadata :
154160 name : registry-api
161+ namespace : toolhive-system
155162spec :
156163 selector :
157164 app : registry-api
@@ -176,24 +183,31 @@ of workloads. The types being watched are
176183[ ` MCPRemoteProxy ` ] ( ../guides-k8s/remote-mcp-proxy.mdx ) , and
177184[ ` VirtualMCPServer ` ] ( ../guides-vmcp/configuration.mdx ) .
178185
186+ :::note
187+
188+ Currently, only resources in the same namespace as the Registry Server are
189+ discovered.
190+
191+ :::
192+
179193This feature requires the Registry Server to be granted access to those
180- resources via a Service Account like the following
194+ resources.
181195
182196``` yaml title="registry-service-account.yaml"
183197apiVersion : v1
184198kind : ServiceAccount
185199metadata :
186200 labels :
187- toolhive.stacklok.io/registry-name : example- registry
188- name : example-registry- registry-api
201+ toolhive.stacklok.io/registry-name : registry-api
202+ name : registry-api
189203 namespace : toolhive-system
190204---
191205apiVersion : rbac.authorization.k8s.io/v1
192206kind : Role
193207metadata :
194208 labels :
195- toolhive.stacklok.io/registry-name : example- registry
196- name : example-registry- registry-api
209+ toolhive.stacklok.io/registry-name : registry-api
210+ name : registry-api
197211 namespace : toolhive-system
198212rules :
199213 - apiGroups :
@@ -250,15 +264,25 @@ apiVersion: rbac.authorization.k8s.io/v1
250264kind : RoleBinding
251265metadata :
252266 labels :
253- toolhive.stacklok.io/registry-name : example- registry
254- name : example-registry- registry-api
267+ toolhive.stacklok.io/registry-name : registry-api
268+ name : registry-api
255269 namespace : toolhive-system
256270roleRef :
257271 apiGroup : rbac.authorization.k8s.io
258272 kind : Role
259- name : example-registry- registry-api
273+ name : registry-api
260274subjects :
261275 - kind : ServiceAccount
262- name : example-registry- registry-api
276+ name : registry-api
263277 namespace : toolhive-system
264278` ` `
279+
280+ Apply the service account to the registry server deployment in the
281+ ` spec.template.spec` section:
282+
283+ ` ` ` yaml
284+ spec:
285+ template:
286+ spec:
287+ serviceAccountName: registry-api
288+ ` ` `
0 commit comments