Skip to content
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

🌱 tmc: split apart virtual workspaces #2836

Merged
merged 7 commits into from
Mar 10, 2023

Conversation

sttts
Copy link
Member

@sttts sttts commented Feb 22, 2023

Allows us to run a tmc-enabled virtual workspace command.

This PR converts the plumbing of VWs to the common options/config/server pattern, and with that every layer can be tweaked in a derived command. Especially, this means we can add more virtual workspaces to the base command (which does not include tmc).

Note: this PR does not yet create a tmc-less command. But it could be now with these changes.

@sttts sttts force-pushed the sttts-server-split-virtual branch from cc29eb9 to 61f7d79 Compare March 10, 2023 07:51
Copy link
Contributor

@mjudeikis mjudeikis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lack a background in APIServer machinery to do a meaningful review of the underlying code. Still had a few questions.
How do Virtual workspaces deal with different paths?
I can see rootAPIServer now claims const DefaultRootPathPrefix string = "/services" and looks like TMC is not doing any at the moment, but in theory, it could? Or this is not something desired here?

delegateAPIServer := delegationTarget
for _, vw := range c.Extra.VirtualWorkspaces {
var err error
delegateAPIServer, err = vw.Register(vw.Name, c.Generic, delegateAPIServer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I get this right? Root API server now can take list of virtual workspaces servers and becomes routing layer to route to delegated child API servers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was like that already before. What changes is that the plumbing allows adding to that list after the options have been completed, i.e. in the config or server layer. Before authorization was wired in a way that this list could not be changed anymore.

@@ -30,7 +30,7 @@ import (
virtualworkspacesoptions "github.com/kcp-dev/kcp/cmd/virtual-workspaces/options"
corev1alpha1 "github.com/kcp-dev/kcp/pkg/apis/core/v1alpha1"
workloadv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/workload/v1alpha1"
syncerbuilder "github.com/kcp-dev/kcp/pkg/virtual/syncer/builder"
syncerbuilder "github.com/kcp-dev/kcp/tmc/pkg/virtual/syncer/builder"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that syncer is now part of the TMC stack? Moves out of the core with this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the virtual workspace for syncer, yes

"github.com/kcp-dev/kcp/pkg/virtual/syncer/upsyncer"
apireconciler2 "github.com/kcp-dev/kcp/tmc/pkg/virtual/syncer/controllers/apireconciler"
transformations2 "github.com/kcp-dev/kcp/tmc/pkg/virtual/syncer/transformations"
upsyncer2 "github.com/kcp-dev/kcp/tmc/pkg/virtual/syncer/upsyncer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why upsyncer2 and not just upsyncer ? Versioning?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goland magic. Let me fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sttts sttts force-pushed the sttts-server-split-virtual branch from bc905b7 to 3cadf3f Compare March 10, 2023 08:46
@mjudeikis
Copy link
Contributor

/lgtm
The plumbing looks ok now. You might still want to get more authoritative review too :)

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2023
@sttts
Copy link
Member Author

sttts commented Mar 10, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

The pull request process is described here

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2023
@jmprusi
Copy link
Member

jmprusi commented Mar 10, 2023

/lgtm

1 similar comment
@mjudeikis
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2023
@openshift-merge-robot openshift-merge-robot merged commit cbec7fe into kcp-dev:main Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants