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

✨ Create one DNS nameserver per workspace #2293

Merged
merged 2 commits into from
Nov 14, 2022

Conversation

lionelvillard
Copy link
Contributor

@lionelvillard lionelvillard commented Nov 1, 2022

Summary

Dynamically deploy DNS nameserver k8s resources, one set per workspace. Each set of resources is composed of:

  • a serviceaccount
  • a role with one rule to access only one configmap
  • a rolebinding
  • a deployment (the DNS nameserver for the workspace)
  • a service

The spec controller checks for DNS endpoint readiness before syncing to pclusters.

All DNS objects associated to all workspaces bound to the workload ws are deployed in the synctarget namespace. Initial network policies design document review with @davidfestal shows this approach allows workspaces segmentation.

This PR does not support:

  • upgrade: once created, DNS objects are never updated
  • workspace deletion (yet). The DNS objects are currently never deleted
  • SyncTarget deletion might be supported (not tested)

Related issue(s)

Fixes #1987

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 1, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 1, 2022

Hi @lionelvillard. 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.

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/test-infra repository.

@lionelvillard lionelvillard marked this pull request as ready for review November 4, 2022 16:26
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2022
@lionelvillard
Copy link
Contributor Author

@davidfestal @jmprusi this is now ready for a first round of reviews. Keep in mind that I haven't updated the tests yet.

@lionelvillard lionelvillard force-pushed the virtual-dns branch 2 times, most recently from 4d07bdd to 0b89ddc Compare November 7, 2022 16:26
@davidfestal
Copy link
Member

/ok-to-test

@openshift-ci openshift-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 Nov 7, 2022
@lionelvillard lionelvillard changed the title ✨ one DNS nameserver per workspace ✨ Create one DNS nameserver per workspace Nov 7, 2022
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2022
@lionelvillard lionelvillard force-pushed the virtual-dns branch 4 times, most recently from 63577ba to f48e41c Compare November 7, 2022 21:39
pkg/syncer/namespace/namespace_downstream_process.go Outdated Show resolved Hide resolved
pkg/syncer/namespace/namespace_downstream_process.go Outdated Show resolved Hide resolved
pkg/syncer/namespace/namespace_downstream_process.go Outdated Show resolved Hide resolved
pkg/syncer/namespace/resources.go Outdated Show resolved Hide resolved
pkg/syncer/namespace/resources.go Outdated Show resolved Hide resolved
pkg/syncer/namespace/resources.go Outdated Show resolved Hide resolved
pkg/syncer/shared/helpers.go Show resolved Hide resolved
pkg/syncer/shared/helpers.go Show resolved Hide resolved
@davidfestal
Copy link
Member

Additional, is it possible to create a followup PR for the update, and most importantly for the cleanup case, and add it into the related EPIC: kcp-dev/contrib-tmc#95 ?

@lionelvillard lionelvillard force-pushed the virtual-dns branch 2 times, most recently from 2b43311 to 5923ad3 Compare November 9, 2022 21:17
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2022
@lionelvillard lionelvillard force-pushed the virtual-dns branch 8 times, most recently from bc4836e to 4210ebc Compare November 10, 2022 23:37
@lionelvillard
Copy link
Contributor Author

This PR is now ready @davidfestal @jmprusi. It needs some follow-up PRs which will be captured in issues.

@lionelvillard
Copy link
Contributor Author

/test e2e-multiple-runs

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 14, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidfestal

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 Nov 14, 2022
@openshift-merge-robot openshift-merge-robot merged commit af76b04 into kcp-dev:main Nov 14, 2022
@qiujian16
Copy link
Contributor

do we always need to sync role/rolebinding after this is merged? should we add role/rolebinding by default to the virtual workspace?

@lionelvillard
Copy link
Contributor Author

@qiujian16 yes we always need to sync role/rolebinding. Role restricts the DNS pod to only access the configmap associated to the workspace. See https://github.com/kcp-dev/kcp/blob/main/pkg/syncer/spec/dns/role_dns.yaml#L11. There is also one ServiceAccount per workspace.

@qiujian16
Copy link
Contributor

cc @davidfestal shouldn't we add role/rolebinding as default api resources in syncer virtual workspace and let syncer always sync them?

@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
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Fix InCluster networking when Syncer syncs from multiple user workspaces
6 participants