kubebuilder icon indicating copy to clipboard operation
kubebuilder copied to clipboard

Phase 2 Plugins - Meta Issue

Open rashmigottipati opened this issue 2 years ago • 2 comments

What do you want to happen?

The propose of this issue is to track Phase 2 Plugins effort and centralize all related discussions here so that the goals and next steps are aligned, and also share with the community on features to expect from Phase 2 Plugins Implementation.

  • [x] Issue 1378 This is the original feature request created that discusses the main requirements for Phase 2 plugins, which is to have a plugin architecture that supports:
  1. Plugins as separate binaries that can be discovered by the Kubebuilder CLI binary.
  2. Plugins that are language-agnostic, i.e. they can be written in any language.
  • [x] Phase 2 Design Proposal This proposal discusses how to discover and use external plugins, also referred to as out-of-tree plugins (which can be implemented in any language).

  • [x] Phase 2 Plugins implementation This PR handles discovery and chaining of external plugins.

Another goal of this this issue is to track the remaining work that needs to be completed for Phase 2 Plugins:

  • [ ] documentation; we need to update Plugin Section on how to create and run an external plugin.

  • [x] Provide an example of an external plugin for users. This example could reside under the testdata dir.

  • [ ] e2e tests discovering and running the sample plugin.

Extra Labels

No response

rashmigottipati avatar Apr 04 '22 15:04 rashmigottipati

For we accomplish the goal:

a) Add samples We have the PR: https://github.com/kubernetes-sigs/kubebuilder/pull/2810 Also, @rashmigottipati would be great if we could add the python one as well used by you to demo. So we can demonstrate that it can work with any language

b) Add the e2e test to build the binary from the samples added and check that the kubebuilder CLI is capable of to properly using them by creating a project with the external plugin and verifying the result ( very simple we do not need to check all details. )

c) Add the docs and a tutorial to let people know how to create their own plugins that can be consumed by d) update the plugins doc to let the users know that it is implemented, see:

  • https://book.kubebuilder.io/plugins/plugins.html
  • https://book.kubebuilder.io/plugins/creating-plugins.html#future-vision-for-kubebuilder-plugins

Could we update the description of this issue as well accordingly?

Also, I am adding it as a priority for the project since we accepted the implementation but we are missing these parts which can make it harder we ensure its maintainability and usability.

c/c @everettraven

camilamacedo86 avatar Jul 29 '22 09:07 camilamacedo86

We have now the PR"https://github.com/kubernetes-sigs/kubebuilder/pull/2810 And I think it is very important we move forward with this one

camilamacedo86 avatar Aug 12 '22 11:08 camilamacedo86

@rashmigottipati sorry to ping you but do you happen to have an example of a python plugin as mentioned in this comment? No worries if its not ready for a PR I've just been looking into implementing a kubebuilder plugin in python and would love a look at how someone else approached it.

HonakerM avatar Jan 11 '23 02:01 HonakerM

@HonakerM Absolutely. I will create a PR with the example of a python plugin.

rashmigottipati avatar Jan 11 '23 02:01 rashmigottipati

@HonakerM https://github.com/rashmigottipati/POC-Phase2-Plugins here's a sample example python plugin. Please let me know if you have any questions or need any help with this!

rashmigottipati avatar Jan 19 '23 16:01 rashmigottipati

@rashmigottipati thank you so much for putting that repo together. It's really helpful in understanding the plugin structure and process. I had one question regarding how kubebuilder discovers these external plugins/executables? Will I have to extended the kubebuilder executable and bundle my plugin with it? I see your PR for implementing the discovery process but I'm unsure how to use it in the kubebuilder cli. Thanks again for your help.

[EDIT] After further investigating your PR I see how kubebuilder has a few set folder paths that it checks. Do you think it would be viable to add a new cli option like --external-plugin-dir which users can pass in to add custom paths? I can look to implement this feature I'm just wondering if it would fit in with the architecture proposal.

HonakerM avatar Jan 19 '23 16:01 HonakerM

Hi @HonakerM,

That is described here: https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-2.md#discovery-of-plugin-binaries (but basically you need to have a binary)

camilamacedo86 avatar Jan 19 '23 18:01 camilamacedo86

For we accomplish the goal:

a) Add samples We have the PR: #2810 Also, @rashmigottipati would be great if we could add the python one as well used by you to demo. So we can demonstrate that it can work with any language

b) Add the e2e test to build the binary from the samples added and check that the kubebuilder CLI is capable of to properly using them by creating a project with the external plugin and verifying the result ( very simple we do not need to check all details. )

c) Add the docs and a tutorial to let people know how to create their own plugins that can be consumed by d) update the plugins doc to let the users know that it is implemented, see:

  • https://book.kubebuilder.io/plugins/plugins.html
  • https://book.kubebuilder.io/plugins/creating-plugins.html#future-vision-for-kubebuilder-plugins

Could we update the description of this issue as well accordingly?

Also, I am adding it as a priority for the project since we accepted the implementation but we are missing these parts which can make it harder we ensure its maintainability and usability.

c/c @everettraven

@camilamacedo86 I'm not that much confident but I'd like to join and develop the items you listed. (Definitely let me know if we have better candidates OR someone is interested in working on this, so that we can switch the assign)

Kavinjsir avatar Jan 26 '23 19:01 Kavinjsir

/assign @Kavinjsir

Kavinjsir avatar Jan 26 '23 19:01 Kavinjsir

@Kavinjsir Thanks for taking this on. I am happy to answer any questions you may have and help any way I can. I would take this on myself but I just haven't had the time available to dedicate to writing the e2e tests and documentation :(

everettraven avatar Jan 26 '23 19:01 everettraven

/remove-lifecycle frozen

irvifa avatar Mar 21 '23 10:03 irvifa

Why did you remove the /remove-lifecycle frozen? This label is for the bot does not close this issue.

camilamacedo86 avatar Mar 21 '23 10:03 camilamacedo86

This issue is labeled with priority/important-soon but has not been updated in over 90 days, and should be re-triaged. Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Deprioritize it with /priority important-longterm or /priority backlog
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

k8s-triage-robot avatar Jun 19 '23 10:06 k8s-triage-robot

/unassign

Kavinjsir avatar Jul 28 '23 16:07 Kavinjsir

/assign @Eileen-Yu

Kavinjsir avatar Jul 28 '23 16:07 Kavinjsir

All is done. During this work extra needs were found and tracked in other issues.

Great work @Eileen-Yu 🥇

camilamacedo86 avatar Aug 25 '23 16:08 camilamacedo86