helm-1.7.0

KOSI Plugin Helm Version 1.7.0

Summary

The Helm Plugin allows users to manage Helm packages. It enables the installation, upgrade, and deletion of Helm charts via KOSI package.

The Key Features are:

  • Install Helm charts with custom values and additional flags.
  • Upgrade existing Helm deployments.
  • Delete Helm deployments.
  • Supports namespace customization.
  • Allows the use of multiple values files for configuration.

Keys

Key Required Description
command Yes Defines the operation to perform. Possible values: install, upgrade or delete.
tgz Yes (only for install and upgrade) The filename of the Helm chart archive (.tgz).
values Optional A list of YAML files containing configuration values for the Helm chart.
flags Optional Additional Helm command flags.
namespace Optional, Default: default The Kubernetes namespace in which to deploy the chart.
deploymentName Yes (only for upgrade and delete) Specifies the name of the Helm release. If omitted during installation, a random name will be generated.

Important Notes:

  • A helmvalues.yaml file must be present in the execution directory when running KOSI install commands.
  • The Helm .tgz package (Helm chart) must be included in the files tree inside the includes tree.
  • KOSI’s --dname argument is not related to Helm’s deploymentName parameter. --dname in KOSI is used to define a KOSI deployment name, whereas deploymentName in the Helm plugin specifies the Helm release name.
  • Helm charts and values files (.tgz and .yaml) can be obtained from sources like ArtifactHub, or you can package your own Helm chart using helm package. Knowledge of Helm is required here.

Examples

Example 1 - Helm Install

This command deploys a Helm chart to a Kubernetes cluster.

languageversion = "1.0.0";
apiversion = "kubernative/kubeops/sina/user/v4";
name = "kosi-example-package";
description = "helm-installation-example";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
    guestbook = "guestbook.tgz";
    values1 = "gbValues.yaml";
    values2 = "values2.yaml";
}

install
{
    cmd(command="echo Installing Helm chart...");

    helm
    (
        command = "install";
        tgz = "guestbook.tgz";
        values = "['gbValues.yaml','values2.yaml']";
        deploymentName = "guestbook";
        namespace = "dev";
    );
}

Explanation

  • The guestbook.tgz Helm chart is installed.
  • Values files (gbValues.yaml and values2.yaml) customize the deployment.
  • The Helm release is named guestbook in the dev namespace.
  • The cmd plugin ensures a status message is displayed before execution.

Example 2 - Helm Upgrade

Upgrades an existing Helm release to a new version or updates its values.

languageversion = "1.0.0";
apiversion = "kubernative/kubeops/sina/user/v4";
name = "kosi-example-package";
description = "helm-upgrade-example";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
    guestbook = "guestbook.tgz";
    values1 = "gbValues.yaml";
    values2 = "values2.yaml";
}

update
{
    cmd(command = "echo Upgrading Helm chart...");

    helm
    (
        command = "upgrade";
        tgz = "guestbook.tgz";
        values = "['gbValues.yaml','values2.yaml']";
        deploymentName = "guestbook";
        namespace = "dev";
    );
}

Explanation

  • Upgrades the existing guestbook Helm release using an updated guestbook.tgz chart.
  • New configuration values are applied from gbValues.yaml and values2.yaml.

Example 3 - Helm Delete

Deletes a Helm release from the Kubernetes cluster.

languageversion = "1.0.0";
apiversion = "kubernative/kubeops/sina/user/v4";
name = "kosi-example-package";
description = "helm-delete-example";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
    guestbook = "guestbook.tgz";
    values1 = "gbValues.yaml";
    values2 = "values2.yaml";
}

delete
{
   cmd(command = "echo Deleting Helm chart...");

   helm
   (
      command = "delete";
      deploymentName = "guestbook";
      namespace = "dev";
      flags = "['--wait']";
  );
}

Explanation

  • Deletes the guestbook release from the dev namespace.
  • The --wait flag ensures the command waits for all resources to be fully removed.