@@ -81,14 +81,19 @@ kcpKubeconfig: kcp-kubeconfig
8181Once this ` values.yaml` file is prepared, install a recent development build of the Sync Agent:
8282
8383` ` ` sh
84- helm install kcp-api-syncagent oci://github.com/kcp-dev/helm-charts/api-syncagent --version 9.9.9-9fc9a430d95f95f4b2210f91ef67b3ec153b5cab -f values.yaml -n kcp-system
84+ helm repo add kcp https://kcp-dev.github.io/helm-charts
85+ helm repo update
86+
87+ helm install kcp-api-syncagent kcp/api-syncagent \
88+ --values values.yaml \
89+ --namespace kcp-system
8590` ` `
8691
8792Two `kcp-api-syncagent` Pods should start in the `kcp-system` namespace. If they crash you will need to
8893identify the reason from container logs. A possible issue is that the provided kubeconfig does not
8994have permissions against the target kcp workspace.
9095
91- # ## RBAC
96+ # ## Service Cluster RBAC
9297
9398The Sync Agent usually requires additional RBAC on the service cluster to function properly. The
9499Helm chart will automatically allow it to read CRDs, namespaces and Secrets, but depending on how
@@ -134,6 +139,73 @@ due to the inner workings of the Agent they will still be watched (cached) clust
134139tighten permissions on `create`/`update` operations to certain namespaces, but `watch` permissions
135140need to be granted cluster-wide.
136141
142+ # ## kcp RBAC
143+
144+ The Helm chart is installed on the service cluster and so cannot provision the necessary RBAC for
145+ the Sync Agent within kcp. Usually whoever creates the `APIExport` is also responsible for creating
146+ the RBAC rules that grant the Agent access.
147+
148+ The Sync Agent needs to
149+
150+ * manage its `APIExport`,
151+ * manage `APIResourceSchemas` and
152+ * access the virtual workspace for its `APIExport`.
153+
154+ This can be achieved by applying RBAC like this _in the workspace where the `APIExport` resides_ :
155+
156+ ` ` ` yaml
157+ apiVersion: rbac.authorization.k8s.io/v1
158+ kind: ClusterRole
159+ metadata:
160+ name: api-syncagent-mango
161+ rules:
162+ # manage its APIExport
163+ - apiGroups:
164+ - apis.kcp.io
165+ resources:
166+ - apiexports
167+ resourceNames:
168+ - test.example.com
169+ verbs:
170+ - get
171+ - list
172+ - watch
173+ - patch
174+ - update
175+ # manage APIResourceSchemas
176+ - apiGroups:
177+ - apis.kcp.io
178+ resources:
179+ - apiresourceschemas
180+ verbs:
181+ - get
182+ - list
183+ - watch
184+ - create
185+ # access the virtual workspace
186+ - apiGroups:
187+ - apis.kcp.io
188+ resources:
189+ - apiexports/content
190+ resourceNames:
191+ - test.example.com
192+ verbs:
193+ - '*'
194+
195+ ---
196+ apiVersion: rbac.authorization.k8s.io/v1
197+ kind: ClusterRoleBinding
198+ metadata:
199+ name: api-syncagent-columbo:mango-system
200+ roleRef:
201+ apiGroup: rbac.authorization.k8s.io
202+ kind: ClusterRole
203+ name: api-syncagent-mango
204+ subjects:
205+ - kind: User
206+ name: api-syncagent-mango
207+ ` ` `
208+
137209# # Publish Resources
138210
139211Once the Sync Agent Pods are up and running, you should be able to follow the
0 commit comments