home / skills / openclaw / skills / k8s-config-gen

k8s-config-gen skill

/skills/lxgicstudios/k8s-config-gen

This skill translates docker-compose into Kubernetes manifests, generating deployments, services, and configs with minimal setup and reliable results.

npx playbooks add skill openclaw/skills --skill k8s-config-gen

Review the files below or copy the command above to add this skill to your agents.

Files (8)
SKILL.md
2.0 KB
---
name: k8s-gen
description: Generate Kubernetes manifests from docker-compose or descriptions. Use when deploying to K8s.
---

# K8s Generator

Translating docker-compose to Kubernetes manifests is tedious YAML shuffling. Feed in your compose file and get proper K8s manifests back.

**One command. Zero config. Just works.**

## Quick Start

```bash
npx ai-k8s docker-compose.yml
```

## What It Does

- Converts docker-compose to Kubernetes manifests
- Generates from plain English descriptions
- Creates Deployments, Services, ConfigMaps
- Handles secrets and persistent volumes

## Usage Examples

```bash
# From docker-compose
npx ai-k8s docker-compose.yml --namespace production

# From description
npx ai-k8s "3 replicas of a node app with redis and postgres"

# Save output
npx ai-k8s docker-compose.yml -o k8s-manifests.yml
```

## Best Practices

- **Use namespaces** - organize your resources
- **Set resource limits** - prevent runaway pods
- **Add health checks** - liveness and readiness probes
- **Use secrets properly** - don't hardcode credentials

## When to Use This

- Migrating from docker-compose to Kubernetes
- Setting up new K8s deployments
- Learning Kubernetes manifest structure
- Quick prototyping before fine-tuning

## Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

**Find more:**
- GitHub: https://github.com/LXGIC-Studios
- Twitter: https://x.com/lxgicstudios
- Substack: https://lxgicstudios.substack.com
- Website: https://lxgicstudios.com

## Requirements

No install needed. Just run with npx. Node.js 18+ recommended. Needs OPENAI_API_KEY environment variable.

```bash
npx ai-k8s --help
```

## How It Works

Parses your docker-compose.yml or description, understands the services and their relationships, then generates equivalent Kubernetes resources with proper configuration.

## License

MIT. Free forever. Use it however you want.

Overview

This skill generates Kubernetes manifests from docker-compose files or plain-English descriptions to speed up K8s deployments. It produces Deployments, Services, ConfigMaps, Secrets, and PersistentVolumeClaims with minimal input and no heavyweight configuration. Use it to migrate, prototype, or learn Kubernetes manifest structures quickly.

How this skill works

The tool parses a docker-compose.yml or a short textual description to identify services, ports, volumes, environment variables, and inter-service relationships. It then maps those concepts to Kubernetes objects (Deployment, Service, ConfigMap, Secret, PersistentVolumeClaim) and emits ready-to-apply YAML. Optional flags let you set namespace, output file, and replica counts without manual YAML editing.

When to use it

  • Migrating a docker-compose stack to Kubernetes
  • Prototyping K8s deployments quickly from a description
  • Generating baseline manifests to customize later
  • Learning how compose concepts translate into Kubernetes objects
  • Producing initial secrets, volumes, and probes for new services

Best practices

  • Run in a separate namespace to review generated resources before applying to production
  • Set resource requests and limits after generation to match cluster capacity
  • Add or refine liveness/readiness probes for production readiness
  • Keep secrets out of source files; use external secret management if possible
  • Validate and test manifests in a staging cluster before roll-out

Example use cases

  • Convert a docker-compose.yml for a web+db+cache stack into k8s YAML with one command
  • Generate a three-replica Node app with Redis and Postgres from a short description
  • Produce an output file for CI pipelines to apply to a cluster -o k8s-manifests.yml
  • Quickly scaffold ConfigMaps and Secrets for environment variables and credentials
  • Create PVCs and Services for stateful components when migrating to Kubernetes

FAQ

Do I need to install anything?

No installation is required; run via npx with Node.js 18+. It uses an environment OPENAI_API_KEY for description-based generation.

Will the generated manifests be production-ready?

They provide a practical baseline but should be reviewed: add resource limits, refine probes, and integrate with your secret management and RBAC policies before production.