Loading converter...

How to Convert Kubernetes to Docker Compose - Complete Guide

Step 1

Input Kubernetes Manifests

Start by providing your Kubernetes manifests. Whether you're working with production Deployments, Services, or StatefulSets, you have several convenient options:

Paste directly: Copy your K8s manifests or Helm template output and paste directly into the input editor
Upload YAML files: Click "Upload" to select your .yaml or .yml files from your Kubernetes deployment directory
Try the sample: Click "Sample" to load a complete example with Deployment, Service, and see the conversion in action
Multiple resources: Separate multiple Kubernetes resources with --- (three dashes) just like in your K8s YAML files

Example: Kubernetes Deployment + Service

Here's what a typical K8s manifest looks like:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
spec:
  replicas: 3
  template:
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: web-app
spec:
  ports:
  - port: 80
    targetPort: 80
Step 2

Automatic Conversion Process

The magic happens instantly! Our intelligent converter analyzes your Kubernetes configuration and automatically extracts all the essential information needed for Docker Compose:

Container specifications: Extracts image names, versions, and container configurations from your Pods
Port mappings: Converts Service ports and container ports to Docker Compose format with proper host-to-container mapping
Environment variables: Preserves all ENV vars, ConfigMap references, and Secret references for local development
Volume mounts: Converts PersistentVolumeClaims to Docker volumes and bind mounts
Resource limits: Translates K8s resource requests and limits to Docker Compose deploy resources
Replica counts: Preserves deployment replicas for accurate local simulation

What Gets Converted

The converter intelligently maps Kubernetes resources:

Deployments → Docker Compose services
Services → Port mappings and networks
StatefulSets → Services with volumes
PVCs → Docker named volumes
Step 3

Review Docker Compose Output

Review the generated docker-compose.yml file in the output panel. The converter creates a complete, production-ready Docker Compose configuration based on your Kubernetes setup:

Services defined: Each Kubernetes Deployment/StatefulSet becomes a Docker Compose service with all configurations preserved
Volumes configured: All persistent storage requirements are mapped to Docker volumes
Networks setup: Default bridge network created for inter-service communication
Version 3.8+: Uses modern Docker Compose syntax compatible with Docker Desktop and CLI

Example: Resulting Docker Compose

The same Kubernetes config, now as docker-compose.yml:

version: '3.8'
services:
  web-app:
    image: nginx:latest
    ports:
      - "80:80"
    restart: always
    deploy:
      replicas: 3
networks:
  default:
    driver: bridge
volumes: {}
Step 4

Download and Run Locally

Now you're ready to run your Kubernetes application locally! Download the generated docker-compose.yml and start developing:

Download the file: Click "Download" to save docker-compose.yml to your project directory
Start services: Run docker-compose up to start all services defined in the file
Detached mode: Use docker-compose up -d to run services in the background
View logs: Check service logs with docker-compose logs -f
Stop services: Clean up with docker-compose down when done testing

Quick Start Commands

Essential commands for Docker Compose:

# Start all services
docker-compose up
# Rebuild and start
docker-compose up --build
# Stop all services
docker-compose down

Frequently Asked Questions

Why convert Kubernetes to Docker Compose?

Docker Compose is significantly simpler for local development than running a full Minikube or Kind cluster. Converting K8s manifests to Docker Compose lets developers run production-like configurations on their laptops without the overhead of a full Kubernetes cluster, making it perfect for rapid development, testing, and debugging.

What Kubernetes resources are supported?

The converter supports the most common Kubernetes workload resources: Deployments, StatefulSets, Services, and PersistentVolumeClaims. Advanced K8s features like operators, CRDs (Custom Resource Definitions), Ingress controllers, or HorizontalPodAutoscalers aren't directly convertible to Docker Compose as they don't have direct equivalents.

Is the conversion lossless?

Some Kubernetes-specific features don't have direct Docker Compose equivalents, such as pod affinity rules, horizontal pod autoscaling, network policies, or ingress configurations. The converter focuses on core container specifications, networking, and storage configurations that are essential for local development. You may need to adjust some advanced settings manually for your specific use case.

Can I convert Helm charts?

Yes! First render your Helm chart to YAML using helm template my-release my-chart, then paste the rendered YAML output into the converter. This allows you to develop locally against your Helm-packaged applications without needing a Kubernetes cluster.

How are environment variables handled?

Environment variables defined directly in containers are preserved exactly. For ConfigMaps and Secrets, the converter creates placeholder values since the actual ConfigMap/Secret data isn't in the manifest. You'll need to create corresponding .env files or update the docker-compose.yml with actual values for local development.

Does it support multi-container pods?

Yes! If your Kubernetes pod has multiple containers (e.g., main application + sidecar), the converter will extract each container and you can either combine them into a single Docker Compose service or separate them depending on your needs. Sidecar patterns like logging agents or service meshes may need special handling for local development.