How to Build Your First Plugin
Building plugins for k3ai is very simple. This guide will walk you through the steps required to build a plugin and contribute to the project.
The first step is to learn the structure of the plugins repository: https://github.com/kf5i/k3ai-plugins****
The repo is structured in a very simple way.
core
groups
plugins
common
community
Core
is the root folder it includes plugins and groups
Plugins
are the actual application to be deployed, for each plugin folder there is a plugin.yaml file.
Groups are a combination of various plugins to be installed altogether
Under common
you'll find all the manifests or files needed by more than one plugin. Those are sort of reusable components (i.e.: treafik ingress definitions for plugins).
k3ai supports custom repositories for plugins and groups so this means you may have your own instead of using our public ones.
Let's create a local repo and deploy a "hello-world" plugin.
First, we have to create the basic structure. So let's create anywhere on your laptop a structure like this:
demo
core
groups
plugins
demo-plugin
plugin.yaml
common
demo-plugin
deployment.yaml
Now let's open the plugin.yaml file and copy the below content in it.
Save the file and open the deployment.yaml. Copy&Paste the following content.
We are ready let's check the plugin list with
You should get something like this
Great! Now let's apply the plugin to our environment
Now let's check if the pod is running with
We are ready so let's execute a command inside our plugin. Copy and Paste the below command into your terminal.
If everything goes right you should see something like this
Congratulation you created your first plugin. Now to delete it simply execute
Last updated