-
Notifications
You must be signed in to change notification settings - Fork 499
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
Support br-federation-manager managing resources in specific-namespace tidb clusters #5410
Support br-federation-manager managing resources in specific-namespace tidb clusters #5410
Conversation
Welcome @michaelmdeng! It looks like this is your first PR to pingcap/tidb-operator 🎉 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5410 +/- ##
==========================================
+ Coverage 61.43% 67.19% +5.75%
==========================================
Files 228 239 +11
Lines 29093 32875 +3782
==========================================
+ Hits 17873 22090 +4217
+ Misses 9463 8988 -475
- Partials 1757 1797 +40
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/retest |
/run-pull-e2e-kind-br |
/test-pull-e2e-kind-serial |
/retest |
2 similar comments
/retest |
/retest |
@BornChanger just pushed a fix to the failing tests, can I get some help rerunning? |
/retest |
@michaelmdeng please sign the CLA as required. |
/retest |
eb8f36c
to
ac4e15e
Compare
`clusterScoped` controls whether the manager should control resources cluster-wide or only scoped to the specific namespace
ac4e15e
to
af6fc1e
Compare
woops, used the wrong email in the commit, should be fixed now |
/run-pull-e2e-kind-across-kubernetes |
/run-pull-e2e-kind-br |
/run-pull-e2e-kind |
/run-pull-e2e-kind-across-kubernetes |
/run-pull-e2e-kind |
/run-pull-e2e-kind-basic |
/run-pull-e2e-kind-serial |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BornChanger, WangLe1321 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 |
[LGTM Timeline notifier]Timeline:
|
/merge |
@WangLe1321: We have migrated to builtin Please use
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 ti-community-infra/tichi repository. |
/cherry-pick release-1.5 |
@WangLe1321: new pull request created to branch In response to this:
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 ti-community-infra/tichi repository. |
…e tidb clusters (#5410) (#5434) Co-authored-by: Michael Deng <[email protected]>
What problem does this PR solve?
Our infra setup deploys a given TiDB cluster across multiple k8s clusters, so we use federation to manage br resources across these k8s clusters. Additionally, we deploy multiple of these TiDB clusters in a single k8s cluster across different namespaces -- for ease of deployment/upgrade and least-access, we want to deploy the br-federation-manager control plane independently for each of these TiDB clusters to manage volume backups/restores in separate namespaces.
What is changed and how does it work?
This PR applies two sets of changes that enable br-federation-manager (bfm) to run in a namespace-scoped way.
clusterScoped
in helm charts. WhenclusterScoped=false
, charts generate manifests forRole
s andRoleBinding
s in the specified namespace rather thanClusterRole
s andClusterRoleBinding
s.clusterScoped
in the bfm executable. When-cluster-scoped=false
, the manager will listen to changes in br resources only within the specified namespace rather than cluster-wide.I modeled these changes after how
clusterScoped
is used in the controller-manager helm charts and executable.These changes only affect how the control-plane access resources in its namespace and does not affect how bfm manages data-plane resources in other k8s clusters using provided kubeconfig. Managing data-plane resources continues to be done through
.spec.clusters.tcNamespace
in the federation CRDs.Code changes
Tests
Manual testing to set up bfm in a namespace-scoped way on a control plane cluster and validate it attempts to reconcile namespaced br resources and does not attempt to reconcile br resources in other namespaces.
Set up bfm kubeconfig following directions here. This can be mocked as we won't be testing managing data-plane resources
Build image and install namespace-scoped bfm
cluster1
namespace control plane.Repeat validation for
VolumeRestore
andVolumeBackupSchedule
Create br resources in other namespace.
Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.