Skip to content

Commit

Permalink
renamed addon to add-on to better reflect upcoming ui changes: harves…
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrokethecloud committed Aug 26, 2024
1 parent 01ac5fb commit 47043f5
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions docs/developer/addon-development.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
---
id: addon-development-guide
title: "Addon Development Guide"
id: Add-on-development-guide
title: "Add-on Development Guide"
sidebar_position: 1
sidebar_label: Addon Development Guide
sidebar_label: Add-on Development Guide
keywords:
- Harvester
- harvester
- Addon Development
Description: How to write your own Harvester Addon
- Add-on Development
Description: How to write your own Harvester Add-on
---

# Background
Harvester Addons provide a means to enable/disable specific Harvester or third party components based on the user requirements.
Harvester Add-ons provide a means to enable/disable specific Harvester or third party components based on the user requirements.

Addons provide a wrapper around [RKE2 HelmChart CRD](https://docs.rke2.io/helm#using-the-helm-crd).
Add-ons provide a wrapper around [RKE2 HelmChart CRD](https://docs.rke2.io/helm#using-the-helm-crd).


## Prerequisites

- An existing Harvester cluster

## Addon Spec
## add-on Spec

The Addon CRD supports the following fields
The `Addon` CRD supports the following fields

```yaml
apiVersion: harvesterhci.io/v1beta1
kind: Addon
metadata:
name: example-addon # name of Addon
namespace: example-namespace # namespace where Addon is deployed. The associated k8s components will be deployed in the same namespace as the Addon crd
labels: # optional Addon labels
addon.harvesterhci.io/experimental: "true" # predefined label used by Harvester dashboard to indicate experimental tag in UI
name: example-add-on # name of add-on
namespace: example-namespace # namespace where add-on is deployed. The associated k8s components will be deployed in the same namespace as the addon crd
labels: # optional add-on labels
Add-on.harvesterhci.io/experimental: "true" # predefined label used by Harvester dashboard to indicate experimental tag in UI
spec:
enabled: false # boolean indicating if an Addon should be enabled or disabled on definition
repo: https://chartsrepo.com # helm chart repo containing the helm chart being managed by Addon
enabled: false # boolean indicating if an add-on should be enabled or disabled on definition
repo: https://chartsrepo.com # helm chart repo containing the helm chart being managed by add-on
version: "v0.19.0" # version of helm chart to be installed
chart: mychart # name of helm chart in the helm chart repo
valuesContent: |- # values.yaml that needs to be passed to the helm chart
Expand All @@ -43,20 +43,22 @@ spec:
to the chart
```
An example add-on is the [rancher-vluster add-on.](https://github.com/harvester/experimental-addons/blob/main/rancher-vcluster/rancher-vcluster.yaml)
## Installation
```bash
kubectl apply -f /path/to/addon.yaml
kubectl apply -f /path/to/add-on.yaml
```

## Usage
Once an Addon CRD has been created, end users can toggle the `enabled` field to `true/false` to accordingly enable and disable the associated Helm Chart
Once an `Addon` CRD has been created, end users can toggle the `enabled` field to `true/false` to accordingly enable and disable the associated Helm Chart

## Upgrade
Changes to the `repo`, `version`, `chart` or `valueContent` field will trigger an underlying `helm upgrade` which will force the existing helm chart to be upgraded

## Uninstallation

```bash
kubectl delete -f /path/to/addon.yaml
kubectl delete -f /path/to/Add-on.yaml
```

0 comments on commit 47043f5

Please sign in to comment.