You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For namespaced resources, syncing from kcp to a Kubernetes cluster (3D space to 2D space, in a way) is usually not a problem because our default resource renaming rules put everything under its own namespace, so e.g. related resources such as Secrets do not create problems with their naming (a secretRef in an object pointing to my-secret is not creating conflicts because everything will happen in a generated namespace of the format WORKSPACE-NAMESPACE [with hashes, but you get the idea]).
This is however not possible with cluster-scoped resources in general, plus referencing other published resources would also create similar problems. Think of the following manifests that I want to create in kcp with both being synced down to a service provider cluster:
apiVersion: service/v1kind: Config # a cluster-scoped resourcemetadata:
name: my-configspec: {}
---
apiVersion: service/v1kind: ServiceInstance # a namespace-scoped resourcemetadata:
name: my-instancenamespace: my-namespacespec:
configRef:
name: my-config # a reference to my Config object from above
What is needed is a way to describe object references like this (basically say: spec.configRef.name in the ServiceInstance kind is a reference to another resource that is within the realm of the api-syncagent) in PublishedResources.
Since the api-syncagent knows about the renaming rules of other resources published via PublishedResources, it should mutate spec.configRef.name to the name that it translated the my-config object to. So on the service provider side, these objects should look somewhat like this:
apiVersion: service/v1kind: Config # a cluster-scoped resourcemetadata:
name: iuc6yffea77crveb-7505d64a54e061b7acd5spec: {}
---
apiVersion: service/v1kind: ServiceInstance # a namespace-scoped resourcemetadata:
name: my-instancenamespace: org-ucdyfdsa7trvfa-sdadsjdjwwewadsspec:
configRef:
name: iuc6yffea77crveb-7505d64a54e061b7acd5 # a reference to my Config object from above
Proposed Solution
I'm not fully clear on how the API should look, but most likely a PublishedResource should have a way to mark object references and define what resource is being referenced here. The api-syncagent would need to hold an internal representation of all renaming rules depending on resources, and would then use those rules in the mutation phase we recently re-enabled in #19.
Alternative Solutions
No response
Want to contribute?
I would like to work on this issue.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Feature Description
For namespaced resources, syncing from kcp to a Kubernetes cluster (3D space to 2D space, in a way) is usually not a problem because our default resource renaming rules put everything under its own namespace, so e.g. related resources such as
Secrets
do not create problems with their naming (a secretRef in an object pointing tomy-secret
is not creating conflicts because everything will happen in a generated namespace of the formatWORKSPACE-NAMESPACE
[with hashes, but you get the idea]).This is however not possible with cluster-scoped resources in general, plus referencing other published resources would also create similar problems. Think of the following manifests that I want to create in kcp with both being synced down to a service provider cluster:
What is needed is a way to describe object references like this (basically say:
spec.configRef.name
in theServiceInstance
kind is a reference to another resource that is within the realm of the api-syncagent) inPublishedResources
.Since the api-syncagent knows about the renaming rules of other resources published via
PublishedResources
, it should mutatespec.configRef.name
to the name that it translated themy-config
object to. So on the service provider side, these objects should look somewhat like this:Proposed Solution
I'm not fully clear on how the API should look, but most likely a
PublishedResource
should have a way to mark object references and define what resource is being referenced here. The api-syncagent would need to hold an internal representation of all renaming rules depending on resources, and would then use those rules in the mutation phase we recently re-enabled in #19.Alternative Solutions
No response
Want to contribute?
Additional Context
No response
The text was updated successfully, but these errors were encountered: