A machine-readable index of this documentation for AI agents is available at https://kubevela.io/llms.txt. Markdown versions of documentation pages are available by appending .md to their URLs.
Skip to main content

Make Your Own Addon

An addon is a directory with three kinds of files: metadata (metadata.yaml, README.md), definitions and UI schemas, and an Application that installs the operator behind them. This page builds one from a Helm chart, enables it on your cluster and checks that it worked. Every file and field an addon can carry is listed in the Addon reference.

tip

For a longer walkthrough that builds an addon around the Redis operator, see the blog post building an addon from scratch.

How an addon is installed​

ADDON REGISTRYKUBEVELA CLI / UIKUBEVELA APP CONTROLLERAddonmetadata.yamltemplate.yaml(or template.cue)resources/definitions/schemas/(UI schemas)enable addonrenderApplicationapplyapply definitions and UI schemasControlclusterManaged clusterManaged clusterManaged clusterservicedeploymentand more
  1. An addon registry stores addons so they can be shared. It can be a Git repository, a Helm chart repository or an OCI registry. You can also enable an addon straight from a directory on your machine.
  2. When you enable an addon from the CLI or VelaUX, KubeVela reads its files, assembles them into an Application named addon-<name> in vela-system and applies it, along with the addon's definitions and UI schemas.
  3. The Application controller then delivers that Application like any other, to the hub and, if the addon asks for it, to your managed clusters.

Quick start​

This builds an addon that installs podinfo from its Helm chart, published in an OCI registry.

1. Create the scaffold​

vela addon init podinfo --helm-repo oci://ghcr.io/stefanprodan/charts --chart podinfo --chart-version 6.11.2
Scaffold created in directory podinfo. What to do next:
- Check out our guide on how to build your own addon: https://kubevela.io/docs/platform-engineers/addon/intro
- Review and edit what we have generated in podinfo
- To enable this addon, run: vela addon enable podinfo

The directory holds a starting point for every part of an addon:

$ ls podinfo
README.md definitions metadata.yaml parameter.cue resources schemas template.cue views

The chart is installed by resources/helm.cue, a component of the helm type:

output: {
name: "addon-podinfo"
type: "helm"
properties: {
repoType: "oci"
url: "oci://ghcr.io/stefanprodan/charts"
chart: "podinfo"
version: "6.11.2"
}
}

The helm component type comes from the fluxcd addon, so the scaffold lists fluxcd under dependencies in metadata.yaml. The addon's version is set to the chart version, 6.11.2.

The other files (definitions/mytrait.cue, schemas/myschema.yaml, views/my-view.cue, resources/myresource.cue) are samples. Edit them or delete them; pass --no-samples to leave them out.

2. Enable it from the local directory​

An addon enabled from a registry brings its dependencies with it, but one enabled from a directory doesn't. Enable fluxcd first, or the CLI stops with:

Error: you must first enable dependencies: [fluxcd]
vela addon enable fluxcd
vela addon enable ./podinfo
enabling addon by local dir: ./podinfo
Addon podinfo enabled successfully.
Please access addon-podinfo from the following endpoints:
+---------+---------------+-----------------------------------+--------------------------------+-------+
| CLUSTER | COMPONENT | REF(KIND/NAMESPACE/NAME) | ENDPOINT | INNER |
+---------+---------------+-----------------------------------+--------------------------------+-------+
| local | addon-podinfo | Service/vela-system/addon-podinfo | addon-podinfo.vela-system:9898 | true |
| local | addon-podinfo | Service/vela-system/addon-podinfo | addon-podinfo.vela-system:9999 | true |
+---------+---------------+-----------------------------------+--------------------------------+-------+

3. Check it​

vela addon status podinfo
podinfo: enabled (6.11.2)
==> Installed Clusters
[local]
==> Registry Name
local

local as the registry means the addon was enabled from a directory. The chart itself is a HelmRelease in vela-system, so vela status addon-podinfo -n vela-system shows its health like any other Application.

To pick up an edit, run vela addon enable ./podinfo again. To remove it, run vela addon disable podinfo.

Other starting points​

Base the addon on Kubernetes objects at remote URLs, such as CRDs. The scaffold adds a ref-objects component that reads them:

vela addon init my-addon --url https://example.com/crd1.yaml --url https://example.com/crd2.yaml

Write the addon's definitions in Go with defkit instead of CUE. The scaffold adds a godef/ Go module, with a stub for each definition you name:

vela addon init my-addon --godef --components api --traits scaler

The flags combine, so one addon can start from a Helm chart, remote objects and Go definitions together. vela addon init --help lists them all.

Next steps​

Known limits​

An addon can't be installed on managed clusters only. vela-core renders every resource on the hub, so any CRD the addon's definitions use must also be installed on the hub, or rendering fails with no matches for kind.

Contribute an addon​

Besides publishing an addon in your own registry, you can open a pull request against the verified addons or experimental addons in the community catalog. Once it merges, every KubeVela user can find and enable it.

  • A new addon starts as experimental. It needs:
    • An icon URL and a project URL in metadata.yaml that resolve.
    • A README.md that says what the addon is, why you'd use it, what it installs, and a basic example.
    • Examples in the catalog's examples directory make it more likely to be accepted.
  • To be promoted to verified, an experimental addon must:
  • If you hit a problem with an addon, open an issue or a pull request to fix it, and bump the addon's version in that pull request.