Add-on Development Guide

Harvester add-ons allow you to enable and disable specific Harvester and third-party components based on your requirements. Add-ons function as a wrapper for the RKE2 HelmChart resource definition (CRD).

Prerequisites

  • An existing Harvester cluster

Add-on Specifications

The Addon CRD supports the following fields:

  1. apiVersion: harvesterhci.io/v1beta1
  2. kind: Addon
  3. metadata:
  4. name: example-add-on # Name of add-on
  5. namespace: example-namespace # Namespace where the add-on CRD is deployed and where the associated Kubernetes components will be deployed
  6. labels: # Optional add-on labels
  7. Add-on.harvesterhci.io/experimental: "true" # Predefined label used on the Harvester UI to identify add-ons with the "experimental" maturity level
  8. spec:
  9. enabled: false # Boolean indicating if an add-on should be enabled or disabled on definition
  10. repo: https://chartsrepo.com # Helm chart repository containing the Helm chart managed by the add-on
  11. version: "v0.19.0" # Version of the Helm chart to be installed
  12. chart: mychart # Name of the Helm chart in the Helm chart repository
  13. valuesContent: |- # File (values.yaml) that must be passed to the Helm chart
  14. contents of values.yaml
  15. that need to be passed
  16. to the chart

Add-on Development Guide - 图1note

Experimental add-ons are not directly packaged in Harvester. An example is the rancher-vcluster add-on.

Installation

  1. kubectl apply -f /path/to/add-on.yaml

Usage

After creating an Addon CRD, you can can toggle the enabled field to enable and disable the associated Helm chart.

Upgrade

Changes to the repo, version, chart or valueContent fields will trigger a helm upgrade, which forces an upgrade of the existing Helm chart.

Uninstallation

  1. kubectl delete -f /path/to/Add-on.yaml