JovianX / helm-release-plugin

Helm3 plugin that pulls(re-creates) helm Charts from deployed releases, and updates values of deployed releases without the chart.
Apache License 2.0
97 stars 12 forks source link
helm kubernetes plugin
[![Open Source](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://opensource.org/) [![GitHub license](https://img.shields.io/github/license/JovianX/helm-release-plugin)](https://github.com/JovianX/helm-release-plugin) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/helm-release)](https://artifacthub.io/packages/helm-plugin/helm-release/release) ![GitHub contributors](https://img.shields.io/github/contributors/JovianX/helm-release-plugin) ![Discord](https://img.shields.io/discord/1014893148599754894?style=flat) [![GitHub stars](https://img.shields.io/github/stars/JovianX/helm-release-plugin)](https://github.com/JovianX/helm-release-plugin/stargazers) | **Please star ⭐ the repo if you find it useful.** | | --- |

Helm3 Plugin helm-release

helm-release is a Helm 3 plugin that allows running operations on Helm releases (deployed Helm charts).

✨ Features:

🫶 Common use-Cases:

Getting started

Installation

To install the plugin:

helm plugin install https://github.com/JovianX/helm-release-plugin

Dependencies: helm-release plugin depends on:

 jq - a lightweight and flexible command-line JSON processor.
        Install: https://stedolan.github.io/jq/download/

Update to the latest version:

$ helm plugin update release

Verify it's been installed:

$ helm plugin list
NAME    VERSION DESCRIPTION
...
release 0.3.2   Update values of a release, pull charts from releases
...

Usage

$ helm release
usage: helm release [ pull | upgrade ]

Available Commands:

Note: Setting Namespace and Context are supported via helm native flags

-n, --namespace string            namespace scope for this request`
    --kube-context string         name of the kubeconfig context to use

helm release pull

Pulls (re-create) a Helm chart from a deployed Helm release.

$ helm release pull
usage: helm release pull <RELEASE NAME> [-d | --destination <TARGET CHART DIRECTORY>] [-o | --output [yaml | json | text]]

Example:

$ helm --namespace nginx release pull nginx --destination /home/me/helm-charts
Chart saved to nginx-ingress-0.13.2

$ ls /home/me/helm-charts/nginx-ingress-0.13.2/
Chart.yaml  crds  README.md  templates  values-icp.yaml  values-nsm.yaml  values-plus.yaml  values.yaml

Note: Setting namespace[-n | --namespace ] or context [--context] name as needed)

helm release upgrade

Update the Helm release values, without specifying the helm chart. The helm release upgrade command accepts the same parameters as helm upgrade without specifying the helm chart. --destination is an optional parameter to set the directory where the chart is saved, defaults to /tmp. After the release is updated the chart is deleted. We recommend setting the --reuse-values flag to keep existing values and provide only the values you would like to change.

$ helm release upgrade
Update release values without specifying the Helm Chart. Usage: helm release upgrade [RELEASE NAME] [-d | --destination <TARGET CHART DIRECTORY>] [helm upgrade arguments]

Example:

helm release upgrade rabbitmq --namespace=rabbitmq --set=key1=value1 --reuse-values
...
... standard helm upgrade output ...
Update Complete. ⎈Happy Helming!⎈

helm release ttl

Sets release time-to-live(TTL) to schedule automatic release uninstallation. release ttl uses Kubernetes CronJob to schedule automatic uninstallation of releases. Helm release TTL supports actions: set, unset and get TTL for a helm release.

Note: Helm release TTL feature uses date binary provided by coreutils package.

GET TTL

To get the current TTL of a release pass the <RELEASE NAME>.

helm release ttl <RELEASE NAME>

Supproted outputs: text(defaul), yaml and json. For example, to see when redis release is scheduled for deletion, run:

helm release ttl redis
Scheduled release removal date: Tue Aug 30 20:12:00 EEST 2022

Same request with json output:

helm release ttl redis --output=json
{"scheduled_date": "2022-08-30 17:12"}

Same request with yaml output:

helm release ttl redis --output=yaml
scheduled_date: 2022-08-30 17:12
Note: Dates returned in cluster timezone (default UTC).

SET TTL

Sets the TTL of a release, after which the release is deleted. Provide <RELEASE-NAME> and --set to set the release TTL time using date format.

helm release ttl <RELEASE NAME> --set <DATE>

For example to schedule deletion of a release in `five minutes, run:

helm release ttl redis --set='5 minutes'
cronjob.batch/redis-ttl created

Refer to complete <DATA> [documentation](https://www.gnu.org/software/ coreutils/manual/html_node/Relative-items-in-date-strings.html) for detailed description of possible time delta options.

If TTL is configured (CronJob exists) and the --set command is executed again the TTL(CronJob) will be rescheduled:

helm release ttl redis --set='5 minutes'
cronjob.batch/redis-ttl configured

UNSET TTL

To remove release TTL pass <RELEASE NAME> and --unset flag.

helm release ttl <RELEASE NAME> --unset

For example, to remove redis release TTL run:

helm release ttl redis --unset
cronjob.batch "redis-ttl" deleted

Contributing

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

Please see the CONTRIBUTING guide.

Users

Who is using helm-release-plugin:

Contributors

License

Copyright 2022 JovianX Ltd.

Licensed under the Apache License, Version 2.0 (the "LICENSE")