# Docker To K8S Manifests

> Automatically generate optimized Kubernetes deployment manifests from Dockerfile and docker-compose configurations with proper resource limits and health checks.

- Skill: `dvcrn/docker-to-k8s-manifests` (Agent Skill, multi-file: 20 files)
- Install (CLI): `npx skillmds@latest add dvcrn/docker-to-k8s-manifests`
- Raw SKILL.md: https://api.skillmd.com/api/skills/dvcrn/docker-to-k8s-manifests/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: dvcrn (https://skillmd.com/u/dvcrn)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/dvcrn/docker-to-k8s-manifests

---


# docker-to-k8s-manifests

Converts Dockerfile and docker-compose.yml files into production-ready Kubernetes deployment manifests.

## Usage

### CLI

```bash
# From a Dockerfile
docker-to-k8s --dockerfile ./Dockerfile --output ./k8s/

# From a docker-compose.yml
docker-to-k8s --compose ./docker-compose.yml --output ./k8s/

# With custom app name
docker-to-k8s --dockerfile ./Dockerfile --name my-app --output ./k8s/
```

### As a library

```javascript
const { DockerfileParser } = require('./scripts/dockerfile-parser');
const { ComposeParser } = require('./scripts/compose-parser');
const { K8sGenerator } = require('./scripts/k8s-generator');

// Parse Dockerfile
const parser = new DockerfileParser();
const config = parser.parseFile('./Dockerfile');

// Generate K8s manifests
const generator = new K8sGenerator();
const manifests = generator.generate(config, { name: 'my-app' });
```

## Features

- Parses Dockerfile instructions and extracts metadata
- Parses docker-compose.yml multi-service configurations
- Generates Deployment, Service, and Ingress manifests
- Estimates resource limits based on application type
- Configures liveness, readiness, and startup probes
- Validates output against Kubernetes schemas
- Applies security best practices (non-root, read-only FS, dropped capabilities)

## Output

Generates the following Kubernetes resources:

- **Deployment** — with resource limits, probes, security context
- **Service** — ClusterIP with correct port mappings
- **Ingress** — optional, for HTTP services
- **ConfigMap** — for environment variables
- **PersistentVolumeClaim** — for volume mounts

