Loading Helm Chart
Kosko supports loading manifests from Helm charts. You have to install the Helm CLI before using this package.
@kosko/helm
uses the helm template
command to render Helm chart templates. Most options of helm template
command are supported. See API documentation for available options.
Under the hood, @kosko/helm
uses @kosko/yaml
to load YAML, which means the loadChart
function supports all options of the loadString
function. See loading Kubernetes YAML for more details.
Install
Install @kosko/helm
.
npm install @kosko/helm
Load from a Local Chart
- TypeScript
- JavaScript
import { loadChart } from "@kosko/helm";
loadChart({
chart: "./nginx"
});
const { loadChart } = require("@kosko/helm");
loadChart({
chart: "./nginx"
});
Load from a Repository
- TypeScript
- JavaScript
import { loadChart } from "@kosko/helm";
loadChart({
chart: "prometheus",
repo: "https://prometheus-community.github.io/helm-charts",
version: "13.6.0"
});
const { loadChart } = require("@kosko/helm");
loadChart({
chart: "prometheus",
repo: "https://prometheus-community.github.io/helm-charts",
version: "13.6.0"
});
Specify Release Name
- TypeScript
- JavaScript
import { loadChart } from "@kosko/helm";
loadChart({
chart: "./nginx",
name: "http-server"
});
const { loadChart } = require("@kosko/helm");
loadChart({
chart: "./nginx",
name: "http-server"
});
Specify Values
- TypeScript
- JavaScript
import { loadChart } from "@kosko/helm";
loadChart({
chart: "./nginx",
values: {
replicaCount: 5
}
});
const { loadChart } = require("@kosko/helm");
loadChart({
chart: "./nginx",
values: {
replicaCount: 5
}
});
Include CRDs
- TypeScript
- JavaScript
import { loadChart } from "@kosko/helm";
loadChart({
chart: "traefik",
repo: "https://helm.traefik.io/traefik",
includeCrds: true
});
const { loadChart } = require("@kosko/helm");
loadChart({
chart: "traefik",
repo: "https://helm.traefik.io/traefik",
includeCrds: true
});