@@ -18,8 +18,10 @@ For each of the CRDs on the service cluster that should be published, the servic
1818` PublishedResource ` object, which will contain both which CRD to publish, as well as numerous other
1919important settings that influence the behaviour around handling the CRD.
2020
21- When publishing a resource (CRD), exactly one version is published. All others are ignored from the
22- standpoint of the resource synchronization logic.
21+ When publishing a resource (CRD), service owners can choose to restrict it to a subset of available
22+ versions and even change API group, versions and names in transit (for example published a v1 from
23+ the service cluster as v1beta1 within kcp). This process of changing the identity of a CRD is called
24+ "projection" in the agent.
2325
2426All published resources together form the APIExport. When a service is enabled in a workspace
2527(i.e. it is bound to it), users can manage objects for the projected resources described by the
@@ -46,11 +48,18 @@ spec:
4648 resource :
4749 kind : Certificate
4850 apiGroup : cert-manager.io
49- version : v1
51+ versions : [v1]
5052` ` `
5153
5254However, you will most likely apply more configuration and use features described below.
5355
56+ You always have to select at least one version, and all selected versions must be marked as ` served`
57+ on the service cluster. If the storage version is selected to be published, it stays the storage
58+ version in kcp. If no storage version is selected, the latest selected version becomes the storage
59+ version.
60+
61+ For more information refer to the [API lifecycle](api-lifecycle.md).
62+
5463# ## Filtering
5564
5665The Sync Agent can be instructed to only work on a subset of resources in kcp. This can be restricted
@@ -70,16 +79,18 @@ spec:
7079 foo: bar
7180` ` `
7281
82+ The configuration above would mean the agent only synchronizes objects from `my-app` namespaces (in
83+ each of the kcp workspaces) that also have a `foo=bar` label on them.
84+
7385# ## Schema
7486
75- **Warning:** The actual CRD schema is always copied verbatim. All projections <!--, mutations -->
76- etc. have to take into account that the resource contents must be expressible without changes to the
77- schema, so you cannot define entirely new fields in an object that are not defined by the original
78- CRD.
87+ **Warning:** The actual CRD schema is always copied verbatim. All projections, mutations etc. have
88+ to take into account that the resource contents must be expressible without changes to the schema,
89+ so you cannot define entirely new fields in an object that are not defined by the original CRD.
7990
8091# ## Projection
8192
82- For stronger separation of concerns and to enable whitelabelling of services, the type meta for
93+ For stronger separation of concerns and to enable whitelabelling of services, the type meta for CRDs
8394can be projected, i.e. changed between the local service cluster and kcp. You could for example
8495rename `Certificate` from cert-manager to `Sertifikat` inside kcp.
8596
@@ -103,18 +114,22 @@ metadata:
103114spec:
104115 resource: ...
105116 projection:
106- version: v1beta1
117+ # all of these options are optional
107118 kind: Sertifikat
108119 plural: Sertifikater
109120 shortNames: [serts]
121+ versions:
122+ # old version => new version;
123+ # this must not map multiple versions to the same new version.
124+ v1: v1beta1
110125 # categories: [management]
111126 # scope: Namespaced # change only when you know what you're doing
112127` ` `
113128
114129Consumers (end users) in kcp would then ultimately see projected names only. Note that GVK
115130projection applies only to the synced object itself and has no effect on the contents of these
116131objects. To change the contents, use external solutions like Crossplane to transform objects.
117- <!-- To change the contents, use *Mutations*. -->
132+ To change the contents, use *Mutations*.
118133
119134# ## (Re-)Naming
120135
@@ -274,7 +289,7 @@ spec:
274289 resource:
275290 kind: Certificate
276291 apiGroup: cert-manager.io
277- version: v1
292+ versions: [v1]
278293
279294 naming:
280295 # this is where our CA and Issuer live in this example
@@ -360,7 +375,7 @@ spec:
360375 resource:
361376 kind: Certificate
362377 apiGroup: cert-manager.io
363- version: v1
378+ versions: [v1]
364379
365380 naming:
366381 namespace: kube-system
@@ -445,7 +460,7 @@ spec:
445460 resource:
446461 kind: Certificate
447462 apiGroup: cert-manager.io
448- version: v1
463+ versions: [v1]
449464
450465 naming:
451466 # this is where our CA and Issuer live in this example
0 commit comments