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

Replace managed syncer with deployed syncer #881

Merged
merged 8 commits into from
Apr 19, 2022

Conversation

marun
Copy link
Contributor

@marun marun commented Apr 12, 2022

Previously the syncer was managed by kcp or tested in-process, but there was no easy path for syncer deployment to a workload cluster and no testing of this configuration. This PR intends to:

  • add a plugin command to automate syncer enablement in kcp and generate the yaml to apply to the workload cluster
  • ensure a syncer can still be configured to run in-process for testing

Follow ups:

@marun marun force-pushed the deployed-syncer branch 8 times, most recently from 3c1df58 to 6fa5da4 Compare April 13, 2022 13:00
@marun marun changed the title WIP Enable deployed syncer Enable deployed syncer Apr 13, 2022
@marun marun changed the title Enable deployed syncer Replace managed syncer with deployed syncer Apr 13, 2022
@marun marun force-pushed the deployed-syncer branch 2 times, most recently from bfbb96d to 2614df2 Compare April 14, 2022 12:30
@marun marun mentioned this pull request Apr 14, 2022
@marun marun force-pushed the deployed-syncer branch 3 times, most recently from 35aa497 to af5702c Compare April 15, 2022 21:01
@marun marun force-pushed the deployed-syncer branch 2 times, most recently from 63aed72 to e8dbbb6 Compare April 18, 2022 13:37
Copy link
Member

@ncdc ncdc left a comment

Choose a reason for hiding this comment

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

Review part 1 - everything but e2e changes

pkg/cliplugins/workspace/plugin/enablesyncer.go Outdated Show resolved Hide resolved
pkg/cliplugins/workspace/plugin/enablesyncer.go Outdated Show resolved Hide resolved
pkg/cliplugins/workspace/plugin/enablesyncer.go Outdated Show resolved Hide resolved
pkg/cliplugins/workspace/plugin/enablesyncer.go Outdated Show resolved Hide resolved
pkg/cliplugins/workspace/plugin/kubeconfig.go Outdated Show resolved Hide resolved
@@ -23,7 +23,7 @@ rules:
resources:
- namespaces
verbs:
- create
- "*"
Copy link
Member

Choose a reason for hiding this comment

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

Why star? What is missing?

Copy link
Contributor Author

@marun marun Apr 19, 2022

Choose a reason for hiding this comment

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

Updated to create, list and watch which are required. delete will also be required when the syncer gains the ability to respond to deletion.

Copy link
Member

Choose a reason for hiding this comment

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

please add a TODO (and a security+timebomb issue) that the syncer has to get rid of namespace permission. These mean basically admin access to the pcluster.

We have had some conversation before that we will need some kind of privilege separation. Something to think about: would project+projectrequest be enough in an OpenShift cluster to enable syncer namespace creation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issues that touch on this already:

I think there needs to be a namespace agent separate from the syncer that is deployed to each cluster and is responsible for creating/updating/deleting pcluster namespaces and managing the role for each syncer deployed to the pcluster.

// TODO(marun) Only use a fake workload server if a pcluster is not configured
parentClusterName, ok := wsClusterName.Parent()
require.True(t, ok, "%s does not have a parent", wsClusterName)
downstreamServer := NewFakeWorkloadServer(t, upstream, parentClusterName)
Copy link
Member

Choose a reason for hiding this comment

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

this confuses me.

Copy link
Member

Choose a reason for hiding this comment

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

Can you elaborate here in a longer comment what you are doing with this fake workload servers? Is it just to test the cli plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's to test the syncer without requiring a kind cluster. This isn't new code - we've been using it for some time now to test syncers - it's just being refactored. In #909 it becomes an optional path that is used when a pcluster (e.g. kind) isn't configured for the test run with --pcluster-kubeconfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marun
Copy link
Contributor Author

marun commented Apr 19, 2022

Updated, PTAL

@sttts sttts enabled auto-merge April 19, 2022 14:27
@ncdc
Copy link
Member

ncdc commented Apr 19, 2022

@marun FYI e2es are failing

@sttts sttts merged commit bb7c4e8 into kcp-dev:main Apr 19, 2022
@marun marun deleted the deployed-syncer branch April 19, 2022 15:30
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 6, 2022
The plugin can be called via "kubectl kcp" or since kcp-dev#881 also via
"kubectl workloads" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 6, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 7, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 7, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 7, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 23, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 23, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 26, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 27, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
hardys pushed a commit to hardys/kcp that referenced this pull request Sep 29, 2022
The plugin can be called via "kubectl kcp workspaces" or since kcp-dev#881 also via
"kubectl workspaces" - when calling in the latter context it's
confusing to get usage info referring to the kcp plugin.
@kcp-ci-bot kcp-ci-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants