Skip to content

Docker Compose to Kubernetes YAML

Convert Docker Compose to Kubernetes YAML by pasting a Compose file. Each service with an image becomes a Deployment.

This is a static mapping, not Kompose and not kubectl. Build, volumes, and networks are not converted. Invalid input is not repaired.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

YAML indent
Compose YAML
Kubernetes YAML

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste a Compose file with a services mapping, or load the sample web and worker pair.
  2. Read the Kubernetes YAML and the notices. Ignored keys are listed; they are not silently dropped.
  3. If the status is an error, the output stays empty. Fix the Compose file yourself.

What this conversion loses

  • Comments, named volumes, networks, secrets, configs, build, healthcheck, depends_on, and env_file.
  • Host IP and host-mode port publishes. A Service does not bind a host address.
  • restart unless-stopped becomes Always, the only restartPolicy a Deployment allows.
  • The image ENTRYPOINT, when only command is set. This converter does not inspect images.

Supported formats and limitations

  • One YAML document. A stream separated by --- is rejected.
  • Each service needs an image. A build section without an image is an error.
  • Service names must be valid Kubernetes names: lowercase letters, digits, and hyphens.
  • Port ranges, UDP/TCP other than tcp and udp, and host environment passthrough are rejected.
  • The output is apps/v1 Deployment and v1 Service only. Ingress, Jobs, and PVCs are not written.

Examples

A web service with a published port

8080:80 becomes containerPort 80 and a Service port 8080.

services:
  web:
    image: nginx:1.25
    ports:
      - "8080:80"

A worker with no ports

A Deployment is written. No Service is written, and a notice says so.

services:
  worker:
    image: busybox:1.36
    command: ["sleep", "3600"]

Common errors and solutions

A Compose file must have a services mapping
Use Compose file format with a top-level services key. Docker run flags are not Compose.
Service has a build section and no image
Add an image name. This page does not build from a Dockerfile.
Service name is not a valid Kubernetes resource name
Rename the service to lowercase letters, digits, and hyphens. The converter does not rewrite names.

FAQ

How do I convert Docker Compose to Kubernetes YAML?
Paste a Compose file with a services mapping. Each service that has an image becomes a Deployment. Published ports become a Service.
Can I convert docker-compose to k8s online without Kompose?
Yes. This page is a static mapping in the browser, not Kompose and not kubectl. Build, volumes, and networks are listed and omitted.
Will unsupported keys stop the conversion?
No. They are listed as notices and omitted from the manifests. Missing image, bad YAML, and invalid names are errors.
Is the Compose file uploaded?
No. It is parsed in your browser. It is not sent to an application server, stored, or put in the URL.

Privacy check

Open DevTools → Network, paste a document, and confirm no request carries the editor text. The page load and the Google tag still appear. Analytics events carry the tool name, never what you pasted.

Read next

Related tools

  • Kubernetes YAML syntax check

    Check the YAML syntax of a Kubernetes manifest, including files with more than one document. This does not check apiVersion, required fields, or unknown kinds.

  • Merge Helm values files online

    Merge Helm values files online in your browser. Each values.yaml is validated as a mapping, then the override is applied.

  • Kubernetes Secret base64 decode online

    Kubernetes Secret base64 decode online in your browser. data becomes stringData; values are not uploaded.