Skip to content

Adapt clusterctl move to the new multi-tenancy model #3042

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

Closed
fabriziopandini opened this issue May 11, 2020 · 32 comments · Fixed by #4598 or #4628
Closed

Adapt clusterctl move to the new multi-tenancy model #3042

fabriziopandini opened this issue May 11, 2020 · 32 comments · Fixed by #4598 or #4628
Assignees
Labels
area/clusterctl Issues or PRs related to clusterctl kind/feature Categorizes issue or PR as related to a new feature. kind/release-blocking Issues or PRs that need to be closed before the next CAPI release lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Milestone

Comments

@fabriziopandini
Copy link
Member

User Story

As a User, I would like to use clusterctl for creating multy-tenant clusters.

Detailed Description

kubernetes-sigs/cluster-api-provider-aws#1713 is introducing the possibility for a provider to use many credentials with a single instance of a provider.

We should define if/how this scenario is supported by clusterctl.

Anything else you would like to add:

clusterctl already support two other different types of multy-tenancy, see https://cluster-api.sigs.k8s.io/clusterctl/commands/init.html#multi-tenancy

The approach introduced by CAPA is potentially by far simpler than the existing ones, and if we can potentially have all the providers to converge on the same approach this can result in a relevant simplification of manifests generation (e.g. no more need of the WebHook namespace) and of clusterctl (lots of corner cases won't be necessary anymore)

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label May 11, 2020
@fabriziopandini fabriziopandini changed the title Define future for multi-tenancy in clusterctl Define future for multi-tenancy in clusterctl/Cluster API May 11, 2020
@fabriziopandini
Copy link
Member Author

/area clusterctl
even do this problem is not clusterctl specific

@k8s-ci-robot k8s-ci-robot added the area/clusterctl Issues or PRs related to clusterctl label May 11, 2020
@vincepri
Copy link
Member

@randomvariable is working on this in the providers for v1alpha3, although we should revisit in v1alpha4 and forward. It's definitely something we might want to tackle before getting to beta.

/milestone Next

@k8s-ci-robot k8s-ci-robot added this to the Next milestone May 11, 2020
@randomvariable
Copy link
Member

Thanks for this issue Fabrizio.

/priority important/long-term

@k8s-ci-robot
Copy link
Contributor

@randomvariable: The label(s) priority/important/long-term cannot be applied, because the repository doesn't have them

In response to this:

Thanks for this issue Fabrizio.

/priority important/long-term

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.

@randomvariable
Copy link
Member

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label May 12, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 10, 2020
@fabriziopandini
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 10, 2020
@vincepri
Copy link
Member

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Aug 18, 2020
@vincepri
Copy link
Member

We need to add definitions for what multi-tenancy is to the glossary

@randomvariable
Copy link
Member

And a provider contract. We should definitely put this in 0.4.0

/assign

@vincepri
Copy link
Member

/milestone v0.4.0

@k8s-ci-robot k8s-ci-robot modified the milestones: Next, v0.4.0 Sep 29, 2020
@vincepri vincepri changed the title Define future for multi-tenancy in clusterctl/Cluster API Move to a single manager watching all namespaces for each provider Oct 7, 2020
@vincepri
Copy link
Member

vincepri commented Oct 7, 2020

Renamed this, hopefully it's going to be a bit more clear going forward :)

@fabriziopandini
Copy link
Member Author

fabriziopandini commented Dec 4, 2020

Given that we are moving to a single manager watching all namespaces for each provider, I started to investigate possible cleanups/action items:

... March 11th edit
Moved missing actions items to #4056 (comment)

@fabriziopandini
Copy link
Member Author

How would clusterctl support multiple credentials?

That the point I'm trying to understand.

For instance, last I checked the AWS proposal it was introducing different types of cluster principals.
Does clusterctl have to support all the AWS cluster principals types during init? how?
Also, are the other providers implementing a similar approach than AWS, so we can design a single UX?

@fabriziopandini
Copy link
Member Author

Linking #4035 because it touches changing credentials during pivoting

@randomvariable
Copy link
Member

Does clusterctl have to support all the AWS cluster principals types during init? how?

For init, other than installing the CRDs, no.
For move, ideally clusterctl should move AWS*Principal resources, including the global ones.

However in the most common case, we only expect the management cluster to be moved, and in that case, will use a singleton AWSClusterControllerPrincipal which is a no-op type of principal that just states the cluster is using the credentials present at controller startup, which is the same secret mounted to ~/.aws/credentials as it is currently in v1alpha3

@nader-ziada
Copy link
Contributor

For capz,
no changes needed for init
no changes need for move; the AzureClusterIdentity type gets moved since its a capz resource and we decided at the time the referenced identity itself should be the responsibility of the user to move/create in the new namespace since its out of the scope of the controller

@CecileRobertMichon
Copy link
Contributor

/area release-blocking

@k8s-ci-robot
Copy link
Contributor

@CecileRobertMichon: The label(s) area/release-blocking cannot be applied, because the repository doesn't have them.

In response to this:

/area release-blocking

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.

@CecileRobertMichon
Copy link
Contributor

/kind release-blocking

@k8s-ci-robot k8s-ci-robot added the kind/release-blocking Issues or PRs that need to be closed before the next CAPI release label Apr 5, 2021
@yastij
Copy link
Member

yastij commented Apr 7, 2021

for now on the CAPV side, we're having two types of credentials:

  • a secret for namespaced credentials
  • later down the road we'd also have aVSphereAccount CRD which would be cluster-scoped for accounts that are available for multiple vcenters.

@sbueringer
Copy link
Member

In case it's relevant in any way, CAPO is using a secret, which is usually located in the same namespace as the Cluster resource, but is referenced via a SecretRef which would also allow using a secret in another namespace.

@fabriziopandini
Copy link
Member Author

Trying to distill a generalised approach and possible impacts on clusterctl and in the CAPI provider operator as well:

For the init workflow:

  • all the providers/identity management systems do requires to install new CRD types; this could be managed by the existing machinery in clusterctl because identity types will be packaged together with the existing CRDs;
  • most of the providers plans to have credentials resources defined in their infrastucture-components.yaml and to use variables substitution for allowing users to specify an initial set of credentials (as of today); CAPZ instead assumes the user has to create credentials before doing clusterctl init (might be there is a chicken egg problem here, given that AzureClusterIdentity CRD is not yet installed in the cluster at this stage...)

For the move workflow:

  • we should ensure clusterctl could manage variants variants: Global Identity vs namespace identity, identity in secrets vs identity in CRD
  • As of today following constraints stands:
    • Move will consider all the kinds defined in the CRDs installed by clusterctl + Secrets and ConfigMap, including both namespaced and global kinds;
    • If those kind are namespaced, only resources in a given namespace will be considered;
    • The resulting set of resources will be further filtered excluding everything:
      1. Is not linked to a cluster via the owner ref chain
      2. Is not explicitly marked as force move (at CRD or at resource level)

Are 1 or 2 enough to address the requirement for all the providers/identity management systems?

@fabriziopandini
Copy link
Member Author

fabriziopandini commented Apr 22, 2021

Thanks to the work in #4514, we can finally nail down required changes in clusterctl move.

@randomvariable @nader-ziada @yastij @gab-satchi @sedefsavas @vincepri

@fabriziopandini fabriziopandini changed the title Move to a single manager watching all namespaces for each provider Adapt clusterctl move to the new multi-tenancy model Apr 25, 2021
@fabriziopandini
Copy link
Member Author

/unassign @randomvariable

/assign
/lifecycle active

@k8s-ci-robot k8s-ci-robot added lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. and removed lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. labels May 11, 2021
@sedefsavas
Copy link

@fabriziopandini Will it be straightforward to backport this to v0.3.x release? Asking because CAPA is supporting multi-tenancy in v1alpha3 releases.

@fabriziopandini
Copy link
Member Author

@fabriziopandini Will it be straightforward to backport this to v0.3.x release? Asking because CAPA is supporting multi-tenancy in v1alpha3 releases.

I don't think we are going to backport this; changes are sort of invasive and not all the guidelines for the providers (#4514) are not yet merged

@fabriziopandini
Copy link
Member Author

We should wait for #4628 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/feature Categorizes issue or PR as related to a new feature. kind/release-blocking Issues or PRs that need to be closed before the next CAPI release lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet