Plugin System - Plugin Management #741
Replies: 4 comments 7 replies
-
I noticed something wrong with this statement: How k3d can download a plugin by using a single http URL if it should download at least the plugin and the manifest? The first solution that came in my mind is downloading an archive (e.g zip, tarball) that contains the plugin and others files, do you know another alternative or any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Another idea I would improve is changing the filesystem structure by ignoring if they have been downloaded from github, gitlab or any other host and using a simpler solution (like helm does): creating a folder with the name of the plugin.
What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! I'm back! 😄 I'm re-analyzing the problem and looked at how helm and Hashicorp have implemented plugins in their platforms. Those examples implements two different methodologies, in fact the first one uses shell scripts meanwhile Hashicorp has its own way based on gRPC communication between the main process and other plugins. In the past, we discussed about using Helm plugin system as a reference for implementing plugins in k3d so I tried to briefly sum up the concept:
This is a quick overview about how I would implement plugins in k3d (and how helm does), what do you think? |
Beta Was this translation helpful? Give feedback.
-
Hello there, I tried implementing few solutions about plugin versioning but it's hard to think about a system for maintaining compatibility even with k3d versions. Here's what I tried to add to a manifest of a plugin: apiVersion: plugins.k3d.io/v1
name: ...
... This means that k3d has to check if Do you have any suggestions? Reference: #1040 |
Beta Was this translation helpful? Give feedback.
-
K3d plugin system
Why this discussion
This discussion has been created after trying to implement the plugin system in #714 for the first time but I decided to rewrite it for a better code organization, implementing some cool ideas and having a feedback from the community. In fact, every comment in this discussion will be considered and added to the final realization! 😃
I would like to use this discussion as a draft for the documentation so every hint, improvements on ideas even about English grammar or lexicon is highly appreciated.
Roadmap
Here is a basic roadmap for this feature, once one step has been implemented and tested, we'll move to the next one.
References
Features
Plugins
A plugin is an executable file that could be either a binary or a script (e.g sh) that can be downloaded using HTTP from any VCS like GitHub Release and GitLab Release or directly if a http endpoint is provided.
Every plugin needs to have a manifest i.e a yaml file that describes the plugin and maybe contain some info for runtime, variables and so on...
An example of a manifest could be:
Install
Usage
k3d plugin install PLUGIN [PLUGIN...]
k3d plugin install < plugins.txt
Description
Resolves its command-line or stdin arguments to packages at specific module versions and downloads the compatible artifact in the releases section into
$HOME/.k3d/plugins/ folder
.To download a plugin or replace it to its latest version:
k3d plugin install example.com/user/repository
To download a plugin or replace it to a specific version:
k3d plugin install example.com/user/repository@v0.0.1
List
Usage
k3d plugin list
k3d plugin ls
Description
Lists all plugins in the
$HOME/.k3d/plugins folder
with their corresponding version and short description.Plugin information is read from the manifest.
Remove
Usage
k3d plugin remove PLUGIN [PLUGIN...]
k3d plugin rm PLUGIN [PLUGIN...]
Description
Removes the given plugin(s) folder from
$HOME/.k3d/plugins
.Filesystem organization
This feature will add a folder dedicated to plugins:
$HOME/.k3d/plugins
and it's structure is inspired by golang modules so$HOME/.k3d/plugins
will have a folder for the source (e.ggithub.com
) and every source will have a folder for the plugin executable and its manifest.Here's an example:
Beta Was this translation helpful? Give feedback.
All reactions