For the latest Add-Ons CLI information, see the Add-Ons CLI topic.
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
Both imperative and declarative approach is available to manage the addons. This is strongly recommended backed by the addon payloads version controlled in your SCM/Git repository.
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 version -f addon-spec.yml
An illustrative example of the addon spec YAML file is shown below
kind:Addonmetadata:# set addon namename:kubeless# set project nameproject:defaultprojectspec:# addon namespacenamespace:kubeless# type helm or yamltype:yaml
Below is an example config file to create an add-on with Helm Chart and values from different repositories
kind:AddonVersionmetadata:name:v1project:project1description:description for v1spec:addon:demorctladdon-new4namespace:rctltemplate:type:Helm3repository_ref:default-bitnamirepo_artifact_meta:helm:chartName:apachetag:8.5.4value_repository_ref:testrepo1additional_reference:git:revision:mainrepoArtifactFiles:-name:apache-valuesrelPath:apache-values.yamlfileType:HelmValuesFile
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.
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 version newrelic v1.7.1 --chart-file nri-bundle-1.7.1.tgz --values-file nri-bundle-custom-values.yaml
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 version kubeless <version-name> --yaml-input kubeless.yaml
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 |
Use this command to retrieve a specific add-on's details in the configured project.
./rctl get addon <addon-name>
Below is the illustrative example for the add-on 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
In order to update an add-on (excluding add-on labels), you create a new version of an existing add-on. For example, if you have a v1 version for the add-on, to update you will now create a v2 version. 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:AddonVersionmetadata:# version namename:v0.9.1# project name. optionalproject:defaultprojectspec:# addon nameaddon:vault-server# template for different addon typestemplate:# type of addontype:helm3chartFile:addon/examples/vault-0.9.1.tgz# values file is optionalvaluesFile:addon/examples/vault-values.yaml
You can delete an add-on in the configured project. Note that add-ons in active use in a cluster blueprint cannot be deleted and the caller will be provided with an error message.
The above commands can be used for any type of add-on where the files are manually updated for artifact type. This cannot be used when artifact type pull files from repository is selected. Artifacts are downloaded as a zip file that contains all the value files except for Managed System Add-Ons, all the components are downloaded as separate files,
Use the below command to download a particular file associated with an add-on