A Kubernetes package manager for TypeScript.
Features:
- Define Kubernetes infra without touching YAML.
- Supports Zod schemas for parsing values.
- Programatically manage packages.
- Helm-like CLI.
First install the k8pm
CLI:
# Globally
npm i -g @k8pm/cli
# Locally
npm i -D @k8pm/cli
Then within your project install the packages required to build charts.
npm i @k8pm/core @k8pm/components
// chart.ts
const chart = new Chart() < { service: string } > "my-chart";
const serviceName = "my-service";
const namespace = "my-namespace";
chart.values({
service: serviceName,
});
chart.addComponent(
(values, context) =>
new Service({
metadata: {
name: serviceName,
labels: {
service: values.service,
namespace: context.namespace,
},
},
spec: {
selector: {
service: serviceName,
},
ports: [
{
port: 80,
},
],
},
})
);
Install the chart using the k8pm
command:
k8pm install my-release ./chart.ts -n my-namespace
k8pm uninstall my-release -n my-namespace
You can also manage your charts programatically:
import chart from "./chart";
const manager = new FreightManager();
await manager.install("my-release", chart);
await manager.uninstall("my-release");
Feature | Status |
---|---|
Install | ✅ |
Uninstall | ✅ |
List installed packages | ✅ |
Upgrade | TODO |
Rollback | TODO |
CRD handling | TODO |
Additional components | TODO |
K8PM stands for K8PM. It does not stand for Kubernetes Package Manager, as that would make use of a Linux Foundation trademark for "Kubernetes".
Nope. Helm is not a dependency. We use the Kubernetes API directly.
That is the goal.
Life is too short to spend it writing YAML.