Docker Compose to Kubernetes Converter
Turn every service of a docker-compose.yml into Kubernetes Deployments, Services and PersistentVolumeClaims.
How to Convert Docker Compose to Kubernetes - Step by Step Guide
Input Your Docker Compose File
Start with the Docker Compose file you already run locally. If you are moving those containers to Kubernetes, this saves you writing the first set of manifests by hand. If the YAML itself needs tidying first, the YAML formatter can help. There are three ways in:
Example: Docker Compose Input
A single nginx service with a published port, one environment variable and a named volume:
version: '3.8'
services:
web:
image: nginx:latest
ports:
- "80:80"
environment:
- ENV=production
volumes:
- web-data:/usr/share/nginx/html
restart: always
volumes:
web-data:Read the Generated Manifests
The output updates a moment after you stop typing. It is one YAML file with the documents separated by ---, in the order kubectl apply handles best, and it starts with notes on anything that did not carry over. You get these Kubernetes objects:
Example: Generated Kubernetes Deployment
The Deployment made from the service above. The output also holds a PersistentVolumeClaim for web-data and a Service for port 80:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
labels:
app: web
spec:
replicas: 1
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx:latest
ports:
- containerPort: 80
protocol: TCP
env:
- name: ENV
value: "production"
volumeMounts:
- name: vol-1
mountPath: /usr/share/nginx/html
volumes:
- name: vol-1
persistentVolumeClaim:
claimName: web-dataSet the Options
Click Options above the input to adjust what gets written:
Export and Deploy Your Kubernetes Manifests
Take the manifests with you in whichever form suits your repo:
💡 Tip: check before you deploy
Let the cluster check the files first, then apply them:
kubectl apply --dry-run=server -f kubernetes-manifests.yaml
kubectl apply -f kubernetes-manifests.yamlFrequently Asked Questions
How does Docker Compose to Kubernetes conversion work?
Each service in your compose file becomes a Deployment with the same image, command, environment and resource limits. A service that publishes or exposes ports also gets a Service with the same name, so other pods can reach it the way they did in Compose. Each named volume a service mounts becomes a PersistentVolumeClaim. Everything is converted in your browser.
Can I apply the manifests straight to my cluster?
They are valid Kubernetes YAML, but treat them as a first draft. Read the notes at the top of the output: they list what could not be carried over, such as bind mounts, depends_on, health checks, build sections and variables taken from your shell. Claims ask for 1Gi each, passwords sit in plain env values (move them into a Secret), and there are no probes or Ingress. Run kubectl apply --dry-run=server before the real thing.
Which Docker Compose settings are converted?
image, ports and expose (short and long form, /udp kept, host IPs dropped, small ranges written out), environment in list or map form, command and entrypoint, deploy.replicas, deploy.resources and the older cpus and mem_limit (memory like 512M becomes 512Mi), named volumes, anonymous and tmpfs volumes (as emptyDir) and read-only mounts. YAML anchors and <<: merge keys are resolved first. depends_on, healthcheck, build, networks, secrets, configs, labels and env_file are not converted and are named in the notes.
Will my environment values change?
No. Values are copied exactly as you typed them, so 8901240544102066246, 00501, 14.50, true or yes stay that text. Every env value is written in double quotes, because Kubernetes only accepts strings there and an unquoted yes or 00501 would be read as something else. A $$ in your compose file becomes a single $, as Docker Compose does.
Can I convert a compose file with several services?
Yes. Every service gets its own Deployment, and its own Service when it has ports. Names are turned into valid Kubernetes names (db_main becomes db-main) and the note says so, because other containers that connect to it by name need the new name. A service without ports gets no Service, so nothing else can reach it by name until you add one.
What do the options do?
Namespace adds metadata.namespace to every manifest. Service Type sets the type of each generated Service; it starts as ClusterIP, so nothing is exposed outside the cluster unless you pick NodePort or LoadBalancer. Default Replicas is used for services without deploy.replicas, and Storage Class is written into every PersistentVolumeClaim.
Is my compose file uploaded anywhere?
No. The conversion runs in your browser, so the file you paste or upload, including any passwords in it, never leaves your computer.
Related Tools
Kubernetes to Docker Compose
Convert Kubernetes manifests to Docker Compose format for local development
Kubernetes YAML Fixer
Fix broken Kubernetes manifests automatically, repair Deployment, Service, Pod, and ConfigMap YAML errors
Docker Compose to Helm
Generate complete Helm charts from Docker Compose files with templates and values
Kubernetes to Helm Chart
Generate Helm charts from Kubernetes manifests with Chart.yaml, values.yaml, and templates
Helm to Kubernetes
Convert Helm charts to plain Kubernetes manifests by rendering templates with values
Kustomize to Helm
Convert Kustomize configurations to Helm charts with templates and values