cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

Support plugins in clusterctl to make provider-specific setup easier

Open devigned opened this issue 5 years ago • 15 comments

User Story

As a user I would like to be able to use clusterctl to setup my provider with as few commands and scripts as possible, perhaps, just one command.

As a [developer/user/operator] I would like to [high level description] for [reasons]

Detailed Description

As of now, a user of a given cloud provider must use a set of scripts and / or other command line tools to setup a provider. For example, the Azure provider requires a user to use the Azure CLI or the Azure Portal to create an identity for the provider and set a bunch of environment variables in a script that requires base64 encoding. There are a lot of moving pieces that could go wrong. There is a very narrow pit of success.

At this point, to provide a great experience for a user, one must either wrap clusterctl with a set of scripts or another command line, or one must create a new command line tool which would use clusterctl as a library. I don't think either of these paths will end well... I think this leads to a splintered experience for tooling in Cluster API.

What can we do about this?

One solution we could consider is to create a plugin system for clusterctl so that providers could hook into command execution and provide provider specific behaviors, like auth, configuration, customization, etc. Perhaps, we could use something like https://github.com/hashicorp/go-plugin.

/kind feature

devigned avatar Jun 25 '20 16:06 devigned

/area clusterctl

CecileRobertMichon avatar Jun 25 '20 16:06 CecileRobertMichon

I'm generally +1 with the idea, I like seeing clusterctl supporting new use cases.

I think that the discussion should focus on use cases & on defining the required hooks during the full lifecycle of providers (init/upgrade/delete). Also having some sequence diagrams (or better a CAEP) will shape out the idea / document how plugins should work.

fabriziopandini avatar Jun 26 '20 10:06 fabriziopandini

How does kubectl do plugins today?

vincepri avatar Jun 26 '20 16:06 vincepri

Probably needs a proposal / design with use cases.

/milestone Next

vincepri avatar Jul 01 '20 17:07 vincepri

Yeah, this is a good idea imo , seems like over time it seems like this is going to be increasingly important as folks run CAPI in production, and are looking to extend it with cloud specific staples (cloud managed databases, object stores are the obvious day 0 requirements that folks often want to integrate w/ vanilla clusters)...

jayunit100 avatar Jul 28 '20 18:07 jayunit100

@vincepri Can we add this item to the next kessel run?

timothysc avatar Jul 28 '20 18:07 timothysc

/milestone v0.4.0

vincepri avatar Jul 28 '20 18:07 vincepri

/kind design

vincepri avatar Jul 28 '20 18:07 vincepri

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

fejta-bot avatar Oct 26 '20 19:10 fejta-bot

/remove-lifecycle stale /lifecycle frozen

fabriziopandini avatar Oct 26 '20 20:10 fabriziopandini

@devigned @CecileRobertMichon Should we start working on a proposal for this?

vincepri avatar Nov 02 '20 14:11 vincepri

I'm not sure I understand how this fits in with management cluster operator and worry that may have some impact on how this should be designed.

devigned avatar Nov 02 '20 16:11 devigned

@devigned according to my understanding of this issue, those plugins are responsible for all the provider-specific actions done before running clusterctl init

the Azure provider requires a user to use the Azure CLI or the Azure Portal to create an identity for the provider and set a bunch of environment variables in a script that requires base64 encoding.

Given that, I don't see this work impacting the operator effort, but happy to discuss this if you think this will help. Instead, this effort IMO requires some synchronization with https://hackmd.io/Z9tzIkGJQUaU9VbFuo6I7Q

fabriziopandini avatar Nov 02 '20 22:11 fabriziopandini

/milestone Next

vincepri avatar Oct 19 '21 14:10 vincepri

/triage accepted /help wanted

fabriziopandini avatar Aug 05 '22 17:08 fabriziopandini

(doing some cleanup on old issues without updates) /close unfortunately, no one is picking up the task. the thread will remain available for future reference

fabriziopandini avatar Mar 24 '23 17:03 fabriziopandini

@fabriziopandini: Closing this issue.

In response to this:

(doing some cleanup on old issues without updates) /close unfortunately, no one is picking up the task. the thread will remain available for future reference

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.

k8s-ci-robot avatar Mar 24 '23 17:03 k8s-ci-robot