helm-ts
A Node/TypeScript client for Helm. It is modeled after the Helm CLI so if you're already comfortable with the CLI then using this client should be no problem for you.
Examples
Download and install a Helm Chart
With Helm CLI
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-mongodb-release bitnami/mongodb
With helm-ts
await helm.repo.add('bitnami', 'https://charts.bitnami.com/bitnami');
await helm.install('my-mongodb-release', 'bitnami/mongodb');
Uninstall a Helm Chart
With Helm CLI
$ helm uninstall my-mongodb-release
With helm-ts
await helm.uninstall('my-mongodb-release');
List Helm releases
With Helm CLI:
$ helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-mongodb-release default 1 2020-11-11 22:39:35.585098 -0500 EST deployed mongodb-10.0.0 4.4.1
With helm-ts
const releases: Release[] = await helm.list();
/**
* releases = [
* {
* name: 'my-mongodb-release',
* namespace: 'default',
* revision: '1',
* updated: '2020-11-11 22:39:35.585098 -0500 EST',
* status: 'deployed',
* chart: 'mongodb-10.0.0',
* app_version: '4.4.1'
* }
* ]
*/
Rollback a release
Rollbacks a release to the previous revision. It can be used with helm.list()
to fetch available release names.
With Helm CLI:
bash
$ helm rollback <release-name>
With helm-ts
await helm.rollback("<release-name>");
Note: Only commands that support json output will return typed objects. Otherwise a string output is returned where present.
Getting started
- Install the npm package
$ npm install helm-ts
- Import the package into your module
import helm from 'helm-ts';
(async () => {
const releases = await helm.list({ namespace: 'openfaas' }); // list releases in openfaas namespace
console.log(releases);
/**
* [
* {
* name: 'openfaas',
* namespace: 'openfaas',
* revision: '1',
* updated: '2020-10-25 22:02:45.325836 -0400 EDT',
* status: 'deployed',
* chart: 'openfaas-6.0.4',
* 'app_version': ''
* }
* ]
*/
})();
Roadmap
This project is currently a WIP. I will be mostly focused on implementing the most commonly used helm commands first.
If there is a flag or command that you would like implemented, please reach out and let me know! I would be happy to implement it for you.