Skip to content

AddOns

The table below describes the list of actions that can be performed on "addons" using the RCTL CLI Utility.

Resource Create Get Update Delete
Addon YES YES YES YES

Create Addon

A declarative approach to lifecycle management of addons is strongly recommended backed by the addon payloads version controlled in your SCM/Git repository.


Imperative

Helm Addon Example

In the example below, we are using the following command to create an addon for New Relic with the following information in the currently configured "project" context. If the command was successful, authorized users in the project will be able to view the corresponding addon details in the web console as well.

  • Type: Helm3
  • Helm Chart: nri-bundle-1.7.1.tgz
  • Values File: nri-bundle-custom-values.yaml
  • Namespace: newrelic
  • Version Name: v1.7.1
./rctl create addon helm3 newrelic --namespace newrelic
./rctl create addon version newrelic v1.7.1 --chart-file nri-bundle-1.7.1.tgz --values-file nri-bundle-custom-values.yaml

YAML Addon Example

For example, use the following command to create an addon for Kubeless from the official k8s YAML file into an existing namespace called "kubeless" providing the version name to publish the addon after creation

./rctl create addon yaml kubeless -n kubeless
./rctl create addon version kubeless <version-name> --yaml-input kubeless.yaml

Declarative

You can also create an addon in the controller based on a version controlled addon spec that you can store in a Git repository. This enables users to develop automation for reproducible infrastructure.

./rctl create addon -f addon-spec.yml

An illustrative example of the addon spec YAML file is shown below

kind: Addon
metadata:
  # set addon name
  name: kubeless
  # set project name
  project: defaultproject
spec:
  # addon namespace
  namespace: kubeless
  # type helm or yaml
  type: yaml

Use this command to create an addon version.

./rctl create addon version -f addon-version-spec.yml

An illustrative example of the addon version spec YAML file is shown below

kind: AddonVersion
metadata:
  # version name
  name: v1.0.7
  # project name. optional
  project: defaultproject
spec:
  # addon name
  addon: kubeless
  # template for different addon types
  template:
    # type of addon
    type: yaml
    # path of yaml manifest
    yamlFile: ./kubeless.yaml

List Addons

Use this command to retrieve the list of addons in the configured Project. The name of the addons, the type of payload and publish status are returned. An illustrative example is shown below where RCTL retrieves the list of addons in the project "Demo".

./rctl get addon --project Demo
+-----------------------------+-----------------------+------------------------------+---------------------+
| NAME                        | TYPE                  | MODIFIED AT                  | NAMESPACE           |
+-----------------------------+-----------------------+------------------------------+---------------------+
| nginxplus                   | Helm                  | Fri Sep 11 19:38:25 UTC 2020 | gitlab              |
+-----------------------------+-----------------------+------------------------------+---------------------+
| alert-opsgenie-demo         | System [Alertmanager] | Tue Nov 10 22:22:18 UTC 2020 | rafay-infra         |
+-----------------------------+-----------------------+------------------------------+---------------------+
| cert-manager                | NativeYaml            | Thu Sep 10 01:52:36 UTC 2020 | cert-manager        |
+-----------------------------+-----------------------+------------------------------+---------------------+
| custom-alert                | System [Alertmanager] | Mon Nov  2 22:20:17 UTC 2020 | rafay-infra         |
+-----------------------------+-----------------------+------------------------------+---------------------+
| custom-alertmanager         | System [Alertmanager] | Mon Nov  2 23:46:04 UTC 2020 | rafay-infra         |
+-----------------------------+-----------------------+------------------------------+---------------------+
| datadog                     | Helm                  | Wed Jun  3 00:51:16 UTC 2020 | datadog             |
+-----------------------------+-----------------------+------------------------------+---------------------+
| datadog-helm3               | Helm3                 | Sun Oct 18 18:05:54 UTC 2020 | datadog             |

Get Specific Addon Info

Use this command to retrieve a specific addon's details in the configured project.

./rctl get addon <addon-name>

Below is the illustrative example for the addon called "datadog-helm3"

./rctl get addon datadog-helm3
+--------------+------------------------------+
| VERSION NAME | CREATED AT                   |
+--------------+------------------------------+
| v1           | Mon Jun 29 04:41:11 UTC 2020 |
+--------------+------------------------------+

Or you can use below command to get more information of the addon in json or yaml format

./rctl get addon <addon-name> -o json
./rctl get addon <addon-name> -o yaml


Update Addon

You can create a new version of an existing addon. For declarative models, ensure that you specify the version number for your addon in the specification file.

./rctl create addon version -f <addon-spec.yaml>

For example, the version for this addon update is highlighted below.

kind: AddonVersion
metadata:
  # version name
  name: v0.9.1
  # project name. optional
  project: defaultproject
spec:
  # addon name
  addon: vault-server
  # template for different addon types
  template:
    # type of addon
    type: helm3
    chartFile: addon/examples/vault-0.9.1.tgz
    # values file is optional
    valuesFile: addon/examples/vault-values.yaml

Delete Addon

You can delete an addon in the configured project. Note that addons in active use in a cluster blueprint cannot be deleted and the caller will be provided with an error message.

./rctl delete addon <addon-name>