Skip to content

feat: add Server-Side Apply for object synchronization#178

Open
blut wants to merge 1 commit into
kcp-dev:mainfrom
blut:feat/enable-server-side-apply
Open

feat: add Server-Side Apply for object synchronization#178
blut wants to merge 1 commit into
kcp-dev:mainfrom
blut:feat/enable-server-side-apply

Conversation

@blut

@blut blut commented Jul 3, 2026

Copy link
Copy Markdown

on-behalf-of: @eon-se opensource@eon.com

Summary

Introduce an opt-in --enable-server-side-apply flag that switches the
sync controller from client-side merge patches (backed by a last-known-
state secret) to Kubernetes Server-Side Apply with a stable field
manager ("api-syncagent/").

SSA preserves fields owned by other controllers, notably
Crossplane's spec.resourceRef on downstream claims. This prevents
the full-update fallback from clobbering those fields and creating
duplicate composite resources.

Key changes:

  • New --enable-server-side-apply flag (default: false)
  • applyServerSide() in objectSyncer handles create-or-update in a
    single Apply round-trip with ForceOwnership to recover from prior
    client-side field managers

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #

Release Notes

NONE

@kcp-ci-bot kcp-ci-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the DCO. labels Jul 3, 2026
@kcp-ci-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign embik for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 3, 2026
@kcp-ci-bot

Copy link
Copy Markdown
Contributor

Hi @blut. Thanks for your PR.

I'm waiting for a kcp-dev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kcp-ci-bot kcp-ci-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 3, 2026
on-behalf-of: @eon-se opensource@eon.com
Signed-off-by: Hannes Blut <hannes.blut.external@eon.com>
@blut blut force-pushed the feat/enable-server-side-apply branch from 19a7ea0 to 3470854 Compare July 3, 2026 15:10
@kcp-ci-bot kcp-ci-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 3, 2026
@ntnn

ntnn commented Jul 6, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@kcp-ci-bot kcp-ci-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 6, 2026
@kcp-ci-bot

Copy link
Copy Markdown
Contributor

@blut: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-api-syncagent-lint 3470854 link true /test pull-api-syncagent-lint

Full PR test history

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@mjudeikis

Copy link
Copy Markdown
Contributor

@blut you PR needs changing as we did some upstream multicluster-runtimen changes

@xrstf

xrstf commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

If SSA now preserves ownership of fields, does this influence how we keep track of previous states to form proper patches?

@ntnn ntnn moved this to Reviewing in tbd Jul 6, 2026
@ntnn ntnn added this to tbd Jul 6, 2026
@blut

blut commented Jul 6, 2026

Copy link
Copy Markdown
Author

If SSA now preserves ownership of fields, does this influence how we keep track of previous states to form proper patches?

I think it could, but I didn't bother changing any implementation, to avoid breaking behaviour. That's the reason for the flag as well. This was to get a first discussion started.

Based on my initial thoughts: With SSA we could remove the stored state and rely on SSA to compute the correct merged state. There needs to be some thought about mutating webhooks, to avoid reconcile loops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants