Conversation
…spaces Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
ec3347a to
dee363e
Compare
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
This was referenced Mar 6, 2025
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
deepthi
reviewed
Mar 7, 2025
| kind: Role | ||
| metadata: | ||
| name: vitess-operator-subcontroller | ||
| namespace: example |
Contributor
There was a problem hiding this comment.
Isn't this supposed to be in the default namespace?
Contributor
There was a problem hiding this comment.
Maybe not the subcontroller if it is meant for backups, but there are tons of places in this PR where vitess-operator is in the example namespace.
Contributor
There was a problem hiding this comment.
OK, this is just creating metadata both both namespaces. It wasn't obvious from the diff, but at line 25, the namespace is implicitly default.
deepthi
approved these changes
Mar 7, 2025
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Over the last few years, we have received several reports (#236 and #8172) from people saying that the vitess-operator does not support multiple namespaces. Meaning, the operator only works when both the operator pod and the Vitess cluster are in the same K8S namespace.
The vitess-operator, like other Kubernetes operators built with the Operator SDK, uses the built-in
WATCH_NAMESPACEenvironment variable to determine which namespaces to observe and manage. According to the Operator SDK documentation (docs), this variable accepts a comma-separated list of namespaces. Note that this detail is not explicitly documented in the vitess-operator documentation or the example scripts we provide, as this behavior is inherited from how Kubernetes operators work.We know the operator already sees and manages multiple namespaces thanks to
WATCH_NAMESPACE, the rest of the code was also written in a way where every resources inside aVitessClusterinherit the same namespace.Changes
In order to provide more clarity and better examples to our end-users I have modified the examples we provide. They now contain all the configuration required to run with two namespaces:
defaultandexample. Wheredefaulthosts the vitess-operator pod, andexamplethe entire Vitess cluster. With this change I am also changing our E2E test scripts to create theexamplenamespace and use-n exampleas an option tokubectlwhere applicable.The changes needed to run with multiple namespaces are the following:
The
WATCH_NAMESPACEvariable that we set inoperator.yamlhas to contain a comma-separated list of all the namespaces we want to have. (code)The
Rolenamedvitess-operatornow has to become aClusterRolein order to not be namespaced and allow the operator to manage resources across the entire K8S cluster. TheServiceAccountnamedvitess-operatoralso have to be binded cluster-wide, using aClusterRoleBindinginstead of aRoleBinding.The Vitess backup subcontroller,
VitessBackupStorage, creates its own fork of thevitess-operatorpod, into a new pod located in the same namespace as theVitessCluster. This new operator process only runs a single reconciling loop, a simplified version of the root operator process, which will watch and manage new backups in theVitessCluster. To achieve this, it needs API access to these resources:VitessShards,VitessBackupsandVitessBackupsStorages. New RBAC have to be added allowing access to these resources, along with a newServiceAccountin the target namespace (same namespace as theVitessCluster). The new RBAC andServiceAccountthen have to be binded using aRoleBinding.Documentation and
vitessio/vitessChangesTo avoid conflict and unnecessary work, once #658 has been merged along with its two follow-up PRs: vitessio/website#1946 and vitessio/vitess#17869 - I will work on creating the follow up PRs on the documentation repository and the
vitessio/vitessrepository to reflect the changes made in this PR.Edit: follow ups are available:
Related Issues