Skip to main content

Easy and Flexible Kubernetes Package Management

Using GitOps or applying manifests via CLI? Anemos has you covered.

Generate, and modify Kubernetes manifests with the flexibility of JavaScript and deploy with confidence through a streamlined workflow.

Why Anemos?

Easy to Use

Single binary tool with simple JavaScript API and rich features

🛠️

Highly Flexible

Modify any part of your Kubernetes manifests programmatically

🔄

GitOps Ready

Integrates with your existing CI/CD pipelines

Define packages easily

Define all your manifests for a package in a single file for easy sharing. Use power of NPM ecosystem for more flexibility.

package.js
const anemos = require("@ohayocorp/anemos");

/**
* Generates Pod and Service manifests for a simple application.
* @param {anemos.Builder} builder - The Anemos builder instance.
* @param {Object} options - The options for the package.
*/
function add(builder, options) {
options ??= {};

options.name ??= "simple-package";
options.namespace ??= "default";
options.image ??= "hashicorp/http-echo:1.0";

// Use template literals for better readability. Anemos allows manifest generation via both
// YAML strings and object literals.
builder.addDocument({
documentGroup: options.name,
content: `
apiVersion: "v1"
kind: "Pod"
metadata:
name: ${options.name}
namespace: ${options.namespace}
labels:
app: ${options.name}
spec:
containers:
- name: "echo"
image: "${options.image}"
args:
- "-text=Hello, Anemos!"
ports:
- name: "http"
containerPort: 5678
protocol: "TCP"
`
});

// Use object-oriented approach for better development experience. Anemos provides
// type-safe abstractions for Kubernetes resources.
builder.addDocument({
documentGroup: options.name,
content: new anemos.k8s.Service({
metadata: {
name: options.name,
namespace: options.namespace
},
spec: {
type: "ClusterIP",
ports: [
{
name: "http",
port: 80,
targetPort: "http",
protocol: "TCP"
}
]
}
})
});
}

module.exports = {
add
}

Apply with confidence

Apply manifests to your cluster or delete them, seeing the diffs before each operation.

# Apply manifests from URL or local file
anemos apply -y https://anemos.sh/examples/hello-world.js
[16:47:31.358] INFO: Starting to build documents
[09:44:11.881] INFO: Applying actions for step: '2' - Sanitize
[09:44:11.881] INFO: Applying actions for step: '5' - Generate resources
[09:44:11.883] INFO: Applying actions for step: '100' - Apply
[16:47:31.360] INFO: Provision plan:
[16:47:31.360] INFO: APPLY -> anemos-hello-world
[16:47:31.360] INFO: WAIT -> anemos-hello-world
[16:47:31.360] INFO:
[16:47:31.360] INFO: Applying document group: anemos-hello-world
[16:47:31.389] INFO: Summary of changes:
[16:47:31.390] INFO: OP NAMESPACE RESOURCE
[16:47:31.390] INFO: A default deployments/anemos-hello-world
[16:47:31.390] INFO: A default services/anemos-hello-world
[16:47:31.407] INFO: Successfully applied document group: anemos-hello-world
[16:47:31.418] INFO: Resource Service/anemos-hello-world is in desired state: Service is ready
[16:47:31.418] INFO: Waiting for resource Deployment/anemos-hello-world, expected=Current, actual=InProgress: Replicas: 0/1
[16:47:33.419] INFO: Waiting for resource Deployment/anemos-hello-world, expected=Current, actual=InProgress: Available: 0/1
[16:47:37.420] INFO: Resource Deployment/anemos-hello-world is in desired state: Deployment is available. Replicas: 1
[16:47:37.421] INFO: Successfully applied Kubernetes manifests

Using GitOps?

Use power of JavaScript to generate and edit manifests for all your applications in a single place.

// Build with: `anemos build index.js`
const anemos = require('@ohayocorp/anemos');
const helloWorld = require("https://anemos.sh/examples/hello-world.js");

const builder = new anemos.Builder();

helloWorld.add(builder, {
ingress: {
host: "anemos-hello-world.local",
}
});

builder.build();

Modify manifests in any way you want

Modify generated manifests using JavaScript. Useful when you need quick changes or don't want to wait for new features/bug fixes.

const anemos = require('@ohayocorp/anemos');
const helloWorld = require("https://anemos.sh/examples/hello-world.js");

const builder = new anemos.Builder();

helloWorld.add(builder);

builder.onModify(context => {
context
.getDocument("anemos-hello-world/deployment.yaml")
.setLabel("deployment-specific-label", "example-deployment");

for (const document of context.getAllDocuments()) {
document.setLabel("label-for-all-documents", "example");
}
});

builder.build();

Can't give up Helm?

Embed Helm charts in your workflows easily and benefit from Anemos' features.

helm.js
const anemos = require('@ohayocorp/anemos');

const builder = new anemos.Builder();

// Use YAML strings for Helm values.
builder.addHelmChart(
"https://github.com/crowdsecurity/helm-charts/releases/download/helloworld-0.2.1/helloworld-0.2.1.tgz",
"helloworld",
`
image:
tag: "1.0"
replicaCount: 2
`);

// Use objects for Helm values.
builder.addHelmChart(
"https://charts.softonic.io/charts/hello-world-app-1.2.2.tgz",
"another-helloworld",
{
image: {
tag: "1.0"
},
replicaCount: 2
});

builder.build();

Get Started in Minutes

1️⃣

Install Anemos

Download and install the Anemos CLI on your system.

Installation Guide
2️⃣

Create Your Package

Define your Kubernetes resources using JavaScript.

Basic Tutorial
3️⃣

Deploy to Kubernetes

Apply your package to your cluster with a single command.

Deployment Guide