> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Compose to Kubernetes converter

> Convert Docker Compose files to Kubernetes manifests and Helm charts

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/akua-1dce587a/NTgnQstkErDoAPAb/images/heros/compose-converter-light.svg?fit=max&auto=format&n=NTgnQstkErDoAPAb&q=85&s=eda8ff7caf56ab7c31792471f4d610aa" alt="A Docker Compose file with services, ports, and volumes being converted into Kubernetes resources and a Helm chart output for review" width="1536" height="864" data-path="images/heros/compose-converter-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/akua-1dce587a/XutebFe61mz4P6aZ/images/heros/compose-converter-dark.svg?fit=max&auto=format&n=XutebFe61mz4P6aZ&q=85&s=cbb85a9d2db31f71e8ec7e17be38b018" alt="A Docker Compose file with services, ports, and volumes being converted into Kubernetes resources and a Helm chart output for review" width="1536" height="864" data-path="images/heros/compose-converter-dark.svg" />
</Frame>

<Card title="Use the converter" icon="external-link" href="https://akua.dev/kompose">
  Access the Docker Compose to Kubernetes converter tool.
</Card>

The Docker Compose to Kubernetes converter helps you migrate Docker Compose applications to Kubernetes by automatically generating Kubernetes manifests and Helm charts from your `docker-compose.yaml` files.

## What it does

The converter transforms Docker Compose services into Kubernetes resources:

* **Services** → Kubernetes Deployments and Services
* **Volumes** → PersistentVolumeClaims or other volume types
* **Networks** → Kubernetes Services with ClusterIP
* **Ports** → Service ports and optional Ingress resources
* **Environment variables** → ConfigMaps and Secrets
* **Health checks** → Liveness and readiness probes

The converter also generates a complete Helm chart with all resources bundled together. Use that chart as a Kubernetes starting point for a [Package](/packages#package-first-deployment-second).

## When to use

Use the converter when:

* **Migrating from Docker Compose:** You have a working Docker Compose setup and want to deploy to Kubernetes.
* **Quick prototyping:** You want to quickly test a Docker Compose app on Kubernetes.
* **Learning Kubernetes:** You want to see how Docker Compose concepts map to Kubernetes resources.
* **CI/CD integration:** You need to convert Compose files as part of an automated pipeline.

<Note>
  The converter provides a good starting point, but you may need to adjust the generated manifests for production use. Review the generated resources and customize them based on your specific requirements.
</Note>

## How to use

### Access the converter

The converter is available at [https://akua.dev/kompose](https://akua.dev/kompose). You can paste your Docker Compose YAML directly into the interface.

### Conversion options

The converter supports several options to customize the output:

* **Provider:** Choose Kubernetes or OpenShift.
* **Controller type:** Deployment, DaemonSet, or ReplicationController.
* **Replicas:** Number of pod replicas to create.
* **Volume type:** PersistentVolumeClaim, emptyDir, hostPath, or ConfigMap.
* **Namespace:** Target Kubernetes namespace.
* **Network policies:** Generate NetworkPolicy resources for service isolation.
* **Helm chart:** Generate a complete Helm chart (enabled by default).

### Output formats

The converter generates:

1. **Kubernetes manifests:** Individual YAML files for each resource (Deployments, Services, ConfigMaps, and others).
2. **Helm chart:** A complete Helm chart with:
   * `Chart.yaml`: Chart metadata
   * `values.yaml`: Configurable values
   * `templates/`: All Kubernetes manifests as Helm templates

You can download the output as a ZIP file containing all generated files, or copy individual files from the interface.

## Example

Convert a simple web application with Redis:

**Input (docker-compose.yaml):**

```yaml docker-compose.yaml expandable highlight={2-8,10-13} theme={null}
services:
  web:
    image: nginx:latest
    ports:
      - "80:80"
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      
  redis:
    image: redis:alpine
    ports:
      - "6379:6379"
```

**Output (Kubernetes manifests):**

<CodeGroup>
  ```yaml web-deployment.yaml expandable highlight={1-2,6-7,15-20} theme={null}
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    labels:
      io.kompose.service: web
    name: web
    namespace: default
  spec:
    replicas: 1
    selector:
      matchLabels:
        io.kompose.service: web
    template:
      metadata:
        labels:
          io.kompose.service: web
      spec:
        containers:
          - env:
              - name: NODE_ENV
                value: production
            image: nginx:latest
            name: web
            ports:
              - containerPort: 80
                protocol: TCP
        restartPolicy: Always
  ```

  ```yaml web-service.yaml expandable theme={null}
  apiVersion: v1
  kind: Service
  metadata:
    labels:
      io.kompose.service: web
    name: web
    namespace: default
  spec:
    ports:
      - name: "80"
        port: 80
        targetPort: 80
    selector:
      io.kompose.service: web
  ```

  ```yaml redis-deployment.yaml expandable theme={null}
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    labels:
      io.kompose.service: redis
    name: redis
    namespace: default
  spec:
    replicas: 1
    selector:
      matchLabels:
        io.kompose.service: redis
    template:
      metadata:
        labels:
          io.kompose.service: redis
      spec:
        containers:
          - image: redis:alpine
            name: redis
            ports:
              - containerPort: 6379
                protocol: TCP
        restartPolicy: Always
  ```

  ```yaml redis-service.yaml expandable theme={null}
  apiVersion: v1
  kind: Service
  metadata:
    labels:
      io.kompose.service: redis
    name: redis
    namespace: default
  spec:
    ports:
      - name: "6379"
        port: 6379
        targetPort: 6379
    selector:
      io.kompose.service: redis
  ```
</CodeGroup>

The converter generates Kubernetes manifests for each service, including Deployments and Services. When you enable Helm chart generation, it also creates a complete Helm chart with all resources bundled together.

## Limitations

The converter handles most common Docker Compose features, but some features are not supported or require manual adjustment:

| Feature                      | Status                     | Notes                                                                                                                                     |
| ---------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Build contexts**           | Not supported              | Docker Compose `build:` directives are not converted. Use pre-built container images instead.                                             |
| **Docker Compose versions**  | Limited support            | Versions 2.1 and 3.2 have limited support due to their experimental nature. Use stable versions (1, 2, or 3) for best results.            |
| **Docker-specific features** | Not supported              | Some Docker-only features don't have direct Kubernetes equivalents and may be skipped or require manual configuration.                    |
| **Networking**               | Converted with limitations | Docker Compose networks are simplified to Kubernetes Services. Complex network configurations may need manual adjustment.                 |
| **depends\_on**              | Converted with limitations | Service dependencies are converted to init containers or startup order hints where possible, but exact startup ordering isn't guaranteed. |
| **Volumes**                  | Converted with limitations | Volume configurations are converted, but you may need to adjust volume types based on your requirements.                                  |
| **Resource limits**          | Converted with limitations | Basic resource constraints are converted, but you may want to add more detailed resource requests and limits for production use.          |

## Related topics

<CardGroup cols={2}>
  <Card title="Package format" icon="cube" href="/akua/package-format">
    Turn generated manifests into a reusable Package.
  </Card>

  <Card title="Create a product" icon="box" href="/products">
    Deploy your converted application as a product.
  </Card>

  <Card title="Installations" icon="rocket" href="/installs">
    How Packages materialize on clusters.
  </Card>

  <Card title="Concepts" icon="diagram-project" href="/concepts">
    How Packages, products, and installations fit together.
  </Card>
</CardGroup>
