New amazing API improvements for Creating External Plugins – Now With Samples and Documentation! done by a student during the Google Summer of Code 2023.

Hi Everyone,

I am excited to share that this year, as a part of the Google Summer Program 2023, we embarked on a project with a mission: to refine and augment the API that facilitates the creation of external plugins.

A huge shoutout to @Eileen-Yu, the talented student behind this project. Her hard work and dedication have made this achievement possible, and we’re eager for our community to benefit from her contributions.A record has been created to showcase the outcomes of this project. You can view it here: https://youtu.be/ksMUkIgfpXA?si=vPTMx0JP5eAy3Ixe

🚀  Who Should Be Interested in These Changes?

If you’re aiming to:

  • Modifying Scaffolding: If you’re looking to tweak or build upon the foundational structures created by Kubebuilder.
  • Creating Tools and Integrations: Aimed at those who want to provide auxiliary tools or solutions that work in tandem with Kubebuilder.
  • Leveraging Kubebuilder’s Approach: Whether you’re generating scaffolds, making adjustments, or even starting a new project from scratch.
  • Enhancing the Default: For those keen on adding extra features or tools to the existing Kubebuilder scaffolding.
  • Exploring Unique Designs: If you’re crafting distinct project layouts and want to tap into the capabilities of the Kubebuilder library.
  • Exploring Beyond Go: For those considering developing plugins in languages other than Go.

Then you’re in luck! With these improvements, you can now harness Kubebuilder as a library to craft your very own plugin.

Note: A prime example of possible customizations atop the existing framework is Operator-SDK. It capitalizes on Kubebuilder as a foundational library, creating unique plugins and adding customized layers over the scaffolding that Kubebuilder offers.

🚀  Usage Example:

Imagine you want your users to benefit from customized scaffolds and files when setting up new projects to ensure they integrate effortlessly with your solution. With the recent improvements we’ve introduced, this becomes straightforward:

1. Set the Path for the External Plugin:

First, users should specify the path where the external plugin’s binary is located:

$ export EXTERNAL_PLUGINS_PATH=<path where the binary for my external plugin resides>

2. Initialize with the Custom Plugin:

Users can then start their project using the custom plugin:

$ kubebuilder init --plugins=go/v4,myespecialplugin/v1

In this scenario, the initialization operations implemented for the init sub-command interface of both plugins will be executed sequentially. This means that the default Kubebuilder project will be scaffolded first (as seen when using kubebuilder init or kubebuilder init –plugins=go/v4). Subsequently, any additions or modifications specified in the myespecialplugin/v1 plugin will be applied, either introducing new files or overlaying changes on top of the default scaffolding.

📌 If you want to know more about:

🌟

I’d like to extend my heartfelt congratulations to the student responsible for this achievement, @Eileen-Yu . A big shoutout to @everettraven for the excellent mentoring throughout this project. I also extend special recognition to @Kavinjsir, who co-mentored and provided unwavering support to @Eileen-Yu alongside @rashansmith. Great work, team! 

Leave a comment