Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

Docker & Containerization

Migrating from Docker Compose to Kubernetes or ECS Without Downtime

Moving from Docker Compose to Kubernetes or ECS means translating services, configuration, storage and networking into an orchestrator's model, then cutting over in stages. We choose the target with you, build the manifests properly rather than auto-converting them, and keep a rollback path.

Key takeaways

  • Compose describes containers on one host; Kubernetes and ECS add scheduling, health-driven restarts and rolling updates.
  • Auto-conversion tools give a starting point, not a production-ready result.
  • State (databases, volumes) is the riskiest part and is usually moved to managed services.
  • Choose ECS for simplicity on AWS and Kubernetes for portability and ecosystem, not because it is fashionable.
  • Many small systems should stay on Compose or a single host, and we will say so.

When Compose stops being enough

Docker Compose is a wonderful tool, and many teams quietly run production on it for longer than they should admit. The signs you have outgrown it are practical rather than philosophical. A single host is a single point of failure. Deploys cause a short outage because there is no rolling update. A busy week means resizing a server by hand. Two services need different scaling. You want zero-downtime releases, per-service autoscaling or a clean path to multiple environments.

At that point an orchestrator earns its complexity. This work forms part of our Docker containerisation service and connects to our Kubernetes and EKS consulting.

Choosing the target honestly

OptionBest whenCost of choosing it
Stay on Compose (single host, good backups)Small system, tolerant of brief downtimeManual scaling, limited resilience
Amazon ECS on FargateAWS-only, small team, want low operationsAWS-specific concepts, less portable
Kubernetes (EKS, AKS, GKE)Many services, portability, ecosystem and GitOpsHigher learning curve and platform ownership

We tell clients when the cheapest correct answer is not to migrate. A team of three running a modest product does not need a cluster. If you are unsure, our DevOps maturity assessment is a useful starting conversation.

How a Compose service maps

The concepts translate well once you know where each piece goes:

ComposeKubernetesECS
services: entryDeployment plus ServiceTask definition plus service
environment:ConfigMap and SecretTask environment and Secrets Manager references
ports:Service and IngressLoad balancer target group
volumes:PersistentVolumeClaimEFS or EBS (or managed service)
healthcheck:Liveness, readiness, startup probesContainer health check
depends_on:Not ordered, apps must tolerate retriesDependencies are limited, apps must retry
deploy.replicasreplicas and HPADesired count and autoscaling

The last two rows matter. Orchestrators do not guarantee startup order, so services must handle a missing dependency gracefully. This is one reason we prepare the application before touching manifests.

A translated service

A Compose service becomes a Deployment, and the details Compose never asked for become explicit:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  replicas: 3
  selector:
    matchLabels: { app: api }
  strategy:
    rollingUpdate: { maxUnavailable: 0, maxSurge: 1 }
  template:
    metadata:
      labels: { app: api }
    spec:
      containers:
        - name: api
          image: registry.example.com/platform/api:1.4.2
          ports: [{ containerPort: 8080 }]
          envFrom:
            - configMapRef: { name: api-config }
            - secretRef: { name: api-secrets }
          resources:
            requests: { cpu: 250m, memory: 256Mi }
            limits: { memory: 512Mi }
          readinessProbe:
            httpGet: { path: /healthz, port: 8080 }
          livenessProbe:
            httpGet: { path: /livez, port: 8080 }

None of the numbers above are recommendations: requests and limits come from measuring your workload. Packaging the manifests with Helm or Kustomize, and delivering them through GitOps, keeps environments consistent.

Making services ready before they move

Most of the effort in a migration is not in the manifests. It is in the application. Before we translate anything, we check that each service meets a short list of conditions:

  • It reads configuration from environment variables or mounted files, not from files baked into the image or edited on the host.
  • It logs to standard output, so the platform can collect logs without a sidecar or a shared volume.
  • It shuts down cleanly on SIGTERM, finishing in-flight requests, because orchestrators stop containers routinely during deploys and node changes.
  • It exposes a cheap health endpoint that distinguishes “alive” from “ready to serve”.
  • It tolerates its dependencies being briefly absent, with retries and backoff.

Fixing these in the Compose world first is useful in its own right, because the same changes make the existing deployment more reliable. It also lets the migration proceed as a series of small, reversible steps.

Networking and traffic

Compose gives every service a DNS name on a shared network and publishes ports on the host. Orchestrators separate these concerns. On Kubernetes, a Service gives stable internal naming and an ingress controller or load balancer handles external traffic; on ECS, a load balancer target group usually fronts each public service. Decide early how TLS certificates are issued and renewed, how internal-only services stay private, and whether you need network policies to restrict traffic between services. Compose’s flat network hides these questions, and teams meet them for the first time in staging.

Cost and team impact

An orchestrator adds running costs (control plane, extra nodes for headroom, load balancers) and, more importantly, people costs: someone must own upgrades, access control and incident response. If you do not have that capacity, managed Fargate or a managed DevOps arrangement reduces the load. We would rather quote the ongoing cost honestly now than have it surprise you in six months.

Dealing with state

Databases and queues deserve their own plan. Our default advice is to use managed services (RDS, Azure Database, Cloud SQL, managed Redis) rather than running them in the new platform on day one. That separates two risky changes: moving compute and moving data. If a database must run in the cluster, it needs persistent volumes, tested backups and a restore drill, and we tie that into backup and disaster recovery.

Cutover without drama

  1. Build the target platform and deploy the workload with no traffic.
  2. Run smoke, load and failure tests, including killing pods or tasks.
  3. Send a small share of traffic through weighted DNS or a load balancer.
  4. Watch error rates and latency, then increase gradually.
  5. Keep the Compose host running and routable until the new platform has handled a full business cycle.
  6. Decommission only after the rollback window passes.

Common failure modes

  • Treating the conversion as the migration. Auto-generated manifests lack probes, limits and security settings.
  • Hidden host dependencies such as files on the Docker host, cron jobs or host networking.
  • Config in the image that must now be externalised.
  • Underestimating the platform work: logging, monitoring, ingress, certificates and CI deploys.
  • Skipping the rollback test.

Delivery and handover

We deliver the manifests or task definitions as code, the CI/CD deploy path, runbooks and a handover session. Your team should be able to deploy, roll back and debug on the new platform without us.

How to tell it is working

Deploys happen without downtime, a failed instance is replaced automatically, scaling is a setting rather than a project, and your team can explain how a release reaches production. To discuss whether and where to migrate, contact us.

References

How we deliver it

  1. 01

    Assess and choose the target

    We review the services, state, traffic and team skills, then recommend Kubernetes, ECS on Fargate or staying put.

  2. 02

    Make the services portable

    Configuration moves to environment variables and secrets, state is externalised and health endpoints are added.

  3. 03

    Translate the definitions

    Each Compose service becomes a Deployment or ECS service with probes, resources, networking and autoscaling.

  4. 04

    Build the platform pieces

    Ingress or load balancing, secrets, logging, monitoring and CI deploys are created before any traffic moves.

  5. 05

    Stage and test

    We run the workload in a staging cluster with realistic data, load tests and failure drills.

  6. 06

    Cut over gradually

    Traffic shifts by weight or by service, with a tested rollback to the Compose host until you are confident.

Tools and technologies

Docker ComposeKubernetesAmazon ECSAWS FargateKomposeHelmKustomizeAmazon EKSTerraformArgo CDAWS Load Balancer ControllerGitHub Actions

Frequently asked questions

Should we move from Docker Compose to Kubernetes or ECS?
If you are all-in on AWS and want the least operational work, ECS on Fargate is often simpler. If you need portability, a rich ecosystem or advanced scheduling, Kubernetes fits better. If one host with backups meets your availability needs, staying on Compose is legitimate. We recommend after reviewing your actual requirements.
Can we just run kompose and be done?
Kompose converts Compose files into Kubernetes manifests, which is a useful first draft. It does not set resource requests, probes, security contexts, autoscaling, ingress rules or sensible storage, and its output often needs substantial rework. We use it for scaffolding and then write production manifests.
What about our databases and volumes?
Stateful services are the main risk. We usually recommend moving databases to managed services such as Amazon RDS rather than running them in containers on a new platform. Where state must stay in the cluster, we use persistent volumes, backups and tested restores.
How long does a migration take?
It depends on the number of services, the amount of state, and how much platform needs building around them. A small stack can move in weeks, while a larger one with data migration takes longer. We give an estimate after a short assessment, not before.
Will there be downtime?
Usually not, if planned. Stateless services run in both places while traffic shifts gradually using DNS weights or a load balancer. Database cutovers are the exception and need a short, rehearsed window or replication-based switch. We agree the approach and rehearse it in staging.

Talk to an engineer about migrate docker compose to kubernetes

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-08.