Skip to content

Commit 0398d04

Browse files
committed
update helm usage
On-behalf-of: @SAP [email protected]
1 parent 009fcef commit 0398d04

File tree

2 files changed

+94
-2
lines changed

2 files changed

+94
-2
lines changed

docs/faq.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,23 @@ restrict an Agent to a subset of published resources.
1616
Only if you have distinct API groups (and therefore also distinct `PublishedResources`) for them.
1717
You cannot currently publish the same API group onto multiple kcp setups. See issue #13 for more
1818
information.
19+
20+
## What happens when CRDs are updated?
21+
22+
At the moment, nothing. `APIResourceSchemas` in kcp are immutable and the Sync Agent currently does
23+
not attempt to update existing schemas in an `APIExport`. If you add a _new_ CRD that you want to
24+
publish, that's fine, it will be added to the `APIExport`. But changes to existing CRDs require
25+
manual work.
26+
27+
To trigger an update:
28+
29+
* remove the `APIResourceSchema` from the `latestResourceSchemas`,
30+
* delete the `APIResourceSchema` object in kcp,
31+
* restart the api-syncagent
32+
33+
## Does the Sync Agent handle permission claims?
34+
35+
Only those required for its own operation. If you configure a namespaced resource to sync, it will
36+
automatically add a claim for `namespaces` in kcp, plus it will add either `configmaps` or `secrets`
37+
if related resources are configured in a `PublishedResource`. But you cannot specify additional
38+
permissions claims.

docs/getting-started.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,19 @@ kcpKubeconfig: kcp-kubeconfig
8181
Once 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

8792
Two `kcp-api-syncagent` Pods should start in the `kcp-system` namespace. If they crash you will need to
8893
identify the reason from container logs. A possible issue is that the provided kubeconfig does not
8994
have permissions against the target kcp workspace.
9095

91-
### RBAC
96+
### Service Cluster RBAC
9297

9398
The Sync Agent usually requires additional RBAC on the service cluster to function properly. The
9499
Helm 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
134139
tighten permissions on `create`/`update` operations to certain namespaces, but `watch` permissions
135140
need 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

139211
Once the Sync Agent Pods are up and running, you should be able to follow the

0 commit comments

Comments
 (0)