-
Notifications
You must be signed in to change notification settings - Fork 1.4k
📖 Document multi-tenancy contract #4074
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
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
fabriziopandini:document-multi-tenancy-contract
Jan 20, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
13 changes: 13 additions & 0 deletions
13
docs/book/src/developer/architecture/controllers/multi-tenancy.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Multi tenancy | ||
|
||
Multi tenancy in Cluster API defines the capability of an infrastructure provider to manage different credentials, each | ||
one of them corresponding to an infrastructure tenant. | ||
|
||
## Contract | ||
|
||
In order to support multi tenancy, the following rule applies: | ||
|
||
- Infrastructure providers MUST be able to manage different sets of credentials (if any) | ||
- Providers SHOULD deploy and run any kind of webhook (validation, admission, conversion) | ||
following Cluster API codebase best practices for the same release. | ||
- Providers MUST create and publish a `{type}-component.yaml` accordingly. |
41 changes: 41 additions & 0 deletions
41
docs/book/src/developer/architecture/controllers/support-multiple-instances.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Support running multiple instances of the same provider | ||
|
||
Up until v1alpha3, the need of supporting [multiple credentials](../../../reference/glossary.md#multi-tenancy) was addressed by running multiple | ||
instances of the same provider, each one with its own set of credentials while watching different namespaces. | ||
|
||
However, running multiple instances of the same provider proved to be complicated for several reasons: | ||
|
||
- Complexity in packaging providers: CustomResourceDefinitions (CRD) are global resources, these may have a reference | ||
to a service that can be used to convert between CRD versions (conversion webhooks). Only one of these services should | ||
be running at any given time, this requirement led us to previously split the webhooks code to a different deployment | ||
and namespace. | ||
- Complexity in deploying providers, due to the requirement to ensure consistency of the management cluster, e.g. | ||
controllers watching the same namespaces. | ||
- The introduction of the concept of management groups in clusterctl, with impacts on the user experience/documentation. | ||
- Complexity in managing co-existence of different versions of the same provider while there could be only | ||
one version of CRDs and webhooks. Please note that this constraint generates a risk, because some version of the provider | ||
de-facto were forced to run with CRDs and webhooks deployed from a different version. | ||
|
||
Nevertheless, we want to make it possible for users to choose to deploy multiple instances of the same providers, | ||
in case the above limitations/extra complexity are acceptable for them. | ||
|
||
## Contract | ||
|
||
In order to make it possible for users to deploy multiple instances of the same provider: | ||
|
||
- Providers MUST support the `--namespace` flag in their controllers. | ||
|
||
⚠️ Users selecting this deployment model, please be aware: | ||
|
||
- Support should be considered best-effort. | ||
- Cluster API (incl. every provider managed under `kubernetes-sigs`, won't release a specialized components file | ||
supporting the scenario described above; however, users should be able to create such deployment model from | ||
the `/config` folder. | ||
- Cluster API (incl. every provider managed under `kubernetes-sigs`) testing infrastructure won't run test cases | ||
with multiple instances of the same provider. | ||
|
||
In conclusion, giving the increasingly complex task that is to manage multiple instances of the same controllers, | ||
the Cluster API community may only provide best effort support for users that choose this model. | ||
|
||
As always, if some members of the community would like to take on the responsibility of managing this model, | ||
please reach out through the usual communication channels, we'll make sure to guide you in the right path. |
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
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
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.
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.
@wfernandes this is a clusterctl internal; we should probably re-consider this during the implementation phase of the CAPI provider operator