-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KCP SyncResource #991
Comments
Some feedback:
|
Depends on the purpose of the identifier, if you want to indicate something like SKR shoot name, then it's not. This label is the Kyma CR name, which is one-to-one mapped with SKR cluster, it's also used for LM to identify the SKR cluster kubeconfig secret. In current Kyma CR, we have following labels for indicate SKR cluster, but they are not create or used by LM, if you need similar label used for other services, we can also add them.
The purpose of this |
@ruanxin How would the submission process of manifest content look like in case of mandatory modules that need to synced across all remote runtimes? |
@ruanxin If the resource manifests are removed from the content of Sync Object, would lifecycle manager remove the resources on the remote clusters? |
@janmedrek @ruanxin |
Currently, in my mind, this idea is more suitable for serving some dynamic content which based on each individual skr cluster, for example, some resources contain skr specific data. So it requires a component in KCP which can generate this resource on the fly, LM just take responsibility to sync it. But for your case, if all resources are identical, it's more relavent to put it in the module template. If you just submit it once, there is no such component recreate it when module disabled and enabled again.
Yes, LM take care the synchronize of this object. |
Use case
|
Details about: "KEB installs secret for BTP service operator:
|
Hi @PK85,
What was the contract data from KEB to ERS to fetch this credential? is it something you can get from current Kyma CR?
are they contain the required data? |
KEB is not fetching credentials, KEB receives credentials when ERS is calling KEB to spin a Kyma cluster. Nope, those labels are not related to those credentials. Updated |
@ruanxin, Based on our understanding, the Kyma CR implementation will also be enhanced to include the contents of
|
This is based on Manifest CR which parsed by ModuleTemplate, each module provide the Module CR in the
Current LM only support deploy a single Module CR for each module, and we don't plan to introduce multiple Module CR if there is no enough reason for it.
It depends on your use case, LM only take care deploy the resources contains in the SyncResource.
Good question, the change should be tracked in the SKR, the answer to both questions is yes, but it means we need to introduce some fields in SyncResource to tracking old resources, we actually have a solution in Manifest CR to tracking synced resources, will introduce this concept to SyncResource also, I extend the |
In your example you outline that transporting a secret is a common use case. The kind Secret is special in kubernetes in regards on how the data gets stored in the APIServer. Embedding a secret inside a CR will not fullfil these requirements coming with secrets, as the APIServer will not treat the data special anymore. So it must be checked if the solution is acceptable for secret data at all, or what kind of limitations that will imply. |
As discussed today the sample scenario can look like this.
|
@ruanxin Some additional aspect that came from discussion with the interested teams: There is a case where module does not have an active component in the SKR. The manager is running in the KCP and wants to set the status of the module CR. The status is a subresource in kubernetes so it can be updated independently from spec, so I think it would be nice to provide a syntax to update status subresource. |
Hi @pbochynski ,
Is the usage just for updating Module CR status? or it need to support all resources subresource? The thing is But the SyncResource definition can be extended as follows:
One thing I want to address here is if we allow update subresources, it really needs the Module team to take care of the frequency of updating the subresources, it should prevent updating SyncResource if the status is not changed, otherwise, it will significantly increase the amount of traffic for sync module status. |
Hi @pbochynski @ruanxin In the summary the KCP Sync Resources:
Eventually, the Sync feature seems a bit stretched to cover the Cloud Resources use cases. Considering the effort and delivery time, maybe we should relax the requirements, simply the protocol, and search for alternative approach to cover Cloud Resources use cases. If it stands as a possibility I could elaborate it more. |
Hi @tmilos77, Thanks for the feedback, regarding this
And I also want to make it clear by current design, LM only treats |
Since we know have the Acceptance Criteria to not have sensitive data inside of the How could this look like:
Thus, we can actively restrict specific resource to be synced and exposed/store sensitive data. We could also just document which resources are not allowed to be synced, but past shows to be more strict about such features. |
@ruanxin I wasn't much concentrated on the SyncResource as much I was on the CloudResources flow. My point was to seek for a way to simplify the flow and not to have to watch yet another resource, On the other hand, after these additional considerations, I'm unable to understand the need to distinguish create and update operations. If I'm wrong please correct me, but wouldn't server side apply create new resource if it doesn't exist, and just patch the existing object? If that stands, wouldn't just a simple Following the automatic removal of deleted items considerations, then also Having all that, I would say two strategies are enough: Sync and Delete. In the base line, just regarding the CloudResources functionality, following the mentioned option 2 with a helper |
@jeremyharisch I have no direct interests atm for it regarding the CloudResources, but since already included in the SyncResource proposal discussion... I missed the decision reasons and explanation on sensitive data, is there some record on it? I'm not particularly convinced that preventing certain resource kinds would solve the issue. One can always bypass such constraints and transfer the sensitive data trough other kinds, ie instead in a Secret in a ConfigMap, or even as a Deployment env var. On the other hand, not sure what encryption at rest has to do with this SyncResource feature and it doesn't have with for example |
Hi @tmilos77, yes, I agree that has resources synced automatically handled by LM will be easier for module manager, actually I introduced a synced list in status field in my first draft to tracking the diff between resources, but this concept challenged by @pbochynski, it introduced complexity to LM, also may bring inconsistency if the status messed up. That's why we bring this
That's the thing I need to verify with you by your use case. As I said in the previous comment, do you use this strategy for only update the existing resource or not? If you have such use case, then introducing this
|
Created on 2023-10-30 by Xin Ruan (@ruanxin)
Decision log
Context
Several modules need to create some resources in managed Kyma Runtimes based on the control plane contexts. However, in order to avoid introducing more central components to directly connect to remote clusters, optimize the number of connections, and maintain the principle of least privilege, where only a few central components have admin permissions to access remote clusters, we should provide a way for relies on one centralized component to push those resources to Kyma Runtimes.
Decision
SyncResource
, the data encryption at rest solution should be further designed as a prerequisite.KCP SyncResource example:
KCP SyncResource explain:
operator.kyma-project.io/kyma-name
label enables the lifecycle manager to identify the target Kyma Runtime for deploying the resource.spec.kyma
mandatory, specifies the target Kyma name for deploying this resource.spec.items
mandatory, specifies a list of resources to be syncedstrategy
mandatory, defines the sync strategyCreateAndSync
: the resources designed as immutable resources for SKR cluster, any modification to the resources by users should be reset.Delete
: the resources previously deployed in SKR cluster, but should be removed now, this is useful for the scenario to cleanup some old resources.CreateAndIgnore
: the resources designed as mutable resources for SKR cluster, LM only take care of creating this resource, and recreate it if deleted by users, but any update to the deployed resources in SKR cluster will be ignored.name
: mandatory, the name of this resource, not necessary same as actual resource name deployed in SKR cluster.resource
optional, contains the resource YAML content as plain text.subresource
optional, contains the subresource YAML content as plain text.status.conditions
andstatus.lastOperation
indicate the synchronization status and provide information about the last operation performed by the lifecycle manager.status.state
reflects the current state of the sync resource.status.items
indicates the status of the current list of Resources been synced.Consequences
SyncResource
) for defining resources as Kubernetes manifests.Risks:
SyncResource
could lead to synchronization problems or resource mismanagement.The text was updated successfully, but these errors were encountered: