Preset
Kompose Browser AlternativeZero Server Transmission

Docker Compose to Kubernetes Manifest Converter (Compose to K8s)

Convert docker-compose.yml services, environment variables, ports, and volume mounts into Kubernetes Deployment and Service YAML.

Presets:
K8s Generator Options
docker-compose.ymlv3.8
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: db-data-pvc
  namespace: default
  labels:
    app.kubernetes.io/name: db-data
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
  namespace: default
  labels:
    app: frontend
    app.kubernetes.io/name: frontend
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  replicas: 2
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
        app.kubernetes.io/name: frontend
    spec:
      containers:
        - name: frontend
          image: node:20-alpine
          imagePullPolicy: IfNotPresent
          args:
            - npm
            - start
          workingDir: /app
          ports:
            - name: port-3000
              containerPort: 3000
              protocol: TCP
          env:
            - name: NODE_ENV
              value: production
            - name: API_URL
              value: http://backend:4000
          resources:
            limits:
              cpu: "1"
              memory: 1024Mi
            requests:
              cpu: 200m
              memory: 256Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: backend
  namespace: default
  labels:
    app: backend
    app.kubernetes.io/name: backend
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  replicas: 2
  selector:
    matchLabels:
      app: backend
  template:
    metadata:
      labels:
        app: backend
        app.kubernetes.io/name: backend
    spec:
      containers:
        - name: backend
          image: node:20-alpine
          imagePullPolicy: IfNotPresent
          args:
            - node
            - dist/index.js
          workingDir: /app
          ports:
            - name: port-4000
              containerPort: 4000
              protocol: TCP
          env:
            - name: PORT
              value: "4000"
            - name: DATABASE_URL
              value: postgres://user:password@postgres:5432/appdb
            - name: REDIS_URL
              value: redis://redis:6379
          livenessProbe:
            exec:
              command:
                - curl
                - -f
                - http://localhost:4000/health
            initialDelaySeconds: 10
            periodSeconds: 30
            timeoutSeconds: 5
            failureThreshold: 3
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres
  namespace: default
  labels:
    app: postgres
    app.kubernetes.io/name: postgres
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
        app.kubernetes.io/name: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:16-alpine
          imagePullPolicy: IfNotPresent
          ports:
            - name: port-5432
              containerPort: 5432
              protocol: TCP
          env:
            - name: POSTGRES_DB
              value: appdb
            - name: POSTGRES_USER
              value: user
            - name: POSTGRES_PASSWORD
              value: secretpassword123
          volumeMounts:
            - name: db-data
              mountPath: /var/lib/postgresql/data
      volumes:
        - name: db-data
          persistentVolumeClaim:
            claimName: db-data-pvc
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  namespace: default
  labels:
    app: redis
    app.kubernetes.io/name: redis
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
        app.kubernetes.io/name: redis
    spec:
      containers:
        - name: redis
          image: redis:7-alpine
          imagePullPolicy: IfNotPresent
          ports:
            - name: port-6379
              containerPort: 6379
              protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  name: frontend
  namespace: default
  labels:
    app: frontend
    app.kubernetes.io/name: frontend
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  type: ClusterIP
  selector:
    app: frontend
  ports:
    - name: port-3000
      protocol: TCP
      port: 3000
      targetPort: 3000
---
apiVersion: v1
kind: Service
metadata:
  name: backend
  namespace: default
  labels:
    app: backend
    app.kubernetes.io/name: backend
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  type: ClusterIP
  selector:
    app: backend
  ports:
    - name: port-4000
      protocol: TCP
      port: 4000
      targetPort: 4000
---
apiVersion: v1
kind: Service
metadata:
  name: postgres
  namespace: default
  labels:
    app: postgres
    app.kubernetes.io/name: postgres
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  type: ClusterIP
  selector:
    app: postgres
  ports:
    - name: port-5432
      protocol: TCP
      port: 5432
      targetPort: 5432
---
apiVersion: v1
kind: Service
metadata:
  name: redis
  namespace: default
  labels:
    app: redis
    app.kubernetes.io/name: redis
    app.kubernetes.io/managed-by: compose-to-k8s
spec:
  type: ClusterIP
  selector:
    app: redis
  ports:
    - name: port-6379
      protocol: TCP
      port: 6379
      targetPort: 6379
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: frontend-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: frontend
                port:
                  number: 3000
          - path: /backend
            pathType: Prefix
            backend:
              service:
                name: backend
                port:
                  number: 4000
Services Parsed
4

4 ports mapped across 4 container images

K8s Manifests
10

4 Deployments, 4 Services, 1 PVCs

Client-Side Processing
0 ms Latency

100% in-browser memory AST processing with instant live updates

Client-Side Conversion

Instantly parse docker-compose.yml specs into standard Kubernetes Deployments, Services, and PVCs with zero server upload.

Production Spec Compliance

Generates apps/v1 Deployments, v1 Services, and PersistentVolumeClaims with production labels, selectors, and resource limits.

Zero Dependencies Needed

A pure browser-based Kompose alternative without installing Golang, Docker, or external CLI binaries.

Technical Reference & Architecture Guide

Docker Compose to Kubernetes Manifest Converter (Compose to K8s) — Reference Guide

Convert docker-compose.yml services, environment variables, ports, and volume mounts into Kubernetes Deployment and Service YAML.

Key Parameters & Controls

servicesmap[string]Service

Defines application workloads converted into Kubernetes apps/v1 Deployment resources with replica controllers and container specs.

Default: Required
portsarray[string | object]

Container port allocations mapped to containerPort in Pod specs and port/targetPort in companion Kubernetes ClusterIP Services.

Default: Optional
environment / env_filemap | array[string]

Container environment variables converted into container env key-value pairs or ConfigMap/Secret key references.

Default: Optional
volumesarray[string | object]

Storage mappings translated into container volumeMounts backed by emptyDir, HostPath, or PersistentVolumeClaim (PVC) specs.

Default: Optional
deploy.resourcesmap[string]object

Compute constraints mapped to Kubernetes resources.limits and resources.requests for CPU (cores/m) and memory (Mi/Gi).

Default: Optional

Pro Tips & Best Practices

Decouple ConfigMaps and Secrets

Instead of keeping sensitive database credentials hardcoded in the converted Deployment YAML, extract them into dedicated Kubernetes Secret and ConfigMap resources using envFrom.

Docker Compose named volumes operate

Docker Compose named volumes operate on a single Docker host. In Kubernetes, convert stateful storage volumes into PersistentVolumeClaims (PVCs) bound to dynamic StorageClasses.

Leverage Kubernetes Service Discovery

Docker Compose relies on embedded container bridge DNS. In Kubernetes, declare a ClusterIP Service for every deployment so pods can reach each other via standard internal DNS names (e.g., http://service-name:port).

Set Explicit Resource Requests & Limits

Always specify CPU and memory requests and limits in the converted manifest. Without requests, the Kubernetes scheduler cannot efficiently place pods, risking worker node memory pressure and OOM kills.

Common Gotchas & Troubleshooting

Inter-service communication fails with connection refused or DNS NXDOMAIN

Verify that a Kubernetes Service object was generated with selector labels matching the pod template labels (e.g., app: <service-name>), and ensure your client code queries the Service name instead of localhost.

Local bind mounts (e.g. ./src:/app) cause empty directory mounts or pod crashes in cluster

Host filesystem relative paths (./) do not exist on remote Kubernetes worker nodes. Use an emptyDir volume for ephemeral cache, or rebuild your container image with application code baked in.

Pod enters CrashLoopBackOff due to command/entrypoint override syntax mismatches

Docker Compose 'command' maps to Kubernetes 'args', whereas Compose 'entrypoint' maps to Kubernetes 'command'. Check pod events via 'kubectl describe pod <name>' and align entrypoint/command mappings.

Frequently Asked Questions

How does this converter translate Docker Compose services into Kubernetes manifests?▼

Each service defined in docker-compose.yml is translated into a standard Kubernetes apps/v1 Deployment manifest along with a corresponding v1 Service (ClusterIP) for internal networking. Container images, ports, environment variables, and volume mounts are systematically structured into idiomatic Kubernetes specifications.

What is the difference between this web tool and the Kompose CLI utility?▼

While Kompose is a command-line Go binary that requires local installation and system configuration, this converter runs 100% inside your web browser. It provides instantaneous manifest generation and syntax validation without requiring binary downloads, Go environments, or cluster connectivity.

How are Docker Compose ports mapped to Kubernetes Services?▼

A published port mapping like '8080:80' translates to a Kubernetes Service where 'port: 8080' exposes the service inside the cluster (or to ingress/load balancers) and 'targetPort: 80' directs traffic to the container's containerPort in the Deployment specification.

Is my infrastructure configuration and environment data kept private?▼

Yes, absolutely. The conversion process is performed entirely on the client side using pure browser JavaScript. Zero lines of your docker-compose.yml, environment secrets, internal ports, or container names are transmitted to or stored on any remote server.

Related Tools & Utilities

All Tools →