Insights from practice

Docker Compose or Kubernetes: which deployment model fits your application?

One container host or a distributed platform? A decision matrix covering updates, failures, data and operational effort.

Containers & KubernetesInfrastructure
Two people discuss an application's architecture using a sketch on the table.

A containerized application needs a suitable deployment model. Docker Compose can be enough for a production service of manageable complexity. Kubernetes becomes worth considering when applications need to run across several machines and their deployment needs coordinated control. The decision starts with the application’s requirements.

One company runs an internal portal with a web interface, a database and background processing. It has a maintenance window, a manageable workload and a designated administrator. Another company releases new versions of several services multiple times a week and needs to remain available during planned maintenance. Both use containers, but different deployment models may suit them.

Docker, Compose and Kubernetes serve different purposes

A container runtime runs the containers. Docker Engine provides a widely used platform for this. Docker Compose describes the services that make up an application in a YAML file. This can bring together images, networks, persistent volumes and configuration. The Compose tools create and manage the application on the Docker host they connect to.

Kubernetes manages a desired state for workloads in a cluster. It schedules Pods onto suitable Nodes and can replace managed instances or update them gradually. Each Node still needs a suitable container runtime. A Compose file and Kubernetes resources describe deployments differently, so migration involves more than renaming a file.

Company size tells us little about this decision. A small software team with frequent releases may benefit from orchestration. A much larger company may be well served by one properly maintained host for a single supported business application service.

Docker Compose is also intended for production use

Docker explicitly documents the use of Compose in production, particularly on a single server. Development and production configurations can be kept separate or extended for specific needs. Restart policies, published ports, logging and the update process must suit the production environment.

For an internal document portal, this can be a straightforward arrangement: a manageable set of services, documented versions, protected data and tested recovery. Host failure still needs a separate plan. A restart policy does not move an application to another machine. Redundancy in an underlying virtualization platform and application backups are separate layers as well.

The installation method supported by the software vendor also matters. An officially maintained Compose deployment may be more valuable in operations than a custom cluster installation without a reliable update path.

A decision matrix for operations

Which requirements favor which approach?
Question Docker Compose on one host Kubernetes
How large is the environment? A good fit for individual applications with a manageable set of services. Several workloads and Nodes can be managed through shared platform policies.
What happens if a host fails? Recovery or infrastructure redundancy is organized outside Compose. Replacement on other Nodes is possible when the application, capacity, control plane and data access have been prepared for it.
How are releases deployed? The affected services are replaced through a documented and, where useful, automated process. Deployment policies support controlled rollouts. Data changes and functional testing still need their own plan.
Where is business data stored? In volumes or external services with their own backup and restore procedures. In persistent storage or external services whose resilience and backup arrangements still need to be assessed.
Who maintains the platform? Responsibility covers the host, runtime, images and application. It also covers the cluster, network integration, storage integration and their lifecycles.
How is the service’s condition assessed? The host, services and business processes are monitored. The cluster and interactions between platform components are monitored as well; a running Pod alone is not enough.
What does the vendor support? The supported installation method and its update path are decisive. An operable Kubernetes deployment and suitable vendor support must be available.

When Kubernetes provides a concrete benefit

A sound reason may be the need to manage many similar deployments consistently or share available computing capacity across several services. Frequent updates with clear rollout policies and separate responsibilities for different application areas can also support the case. This requires an application that can run in multiple instances and people who can manage the additional platform work.

Before choosing a service, establish whether the provider manages the control plane, which components you maintain yourself and which incident response tasks remain with you. A managed cluster reduces certain platform tasks. Responsibility for applications, access rights, data and costs remains.

Assumptions about shared data are a common stumbling block. Can the business application work with several active instances? Where does it write files? Where are sessions stored? Is a background job safe to run again? These questions need answers before migration. A reachable container does not prove that orders are being processed correctly.

The effort spans the entire lifecycle

Server or cloud charges alone are not enough for a comparison. Implementation, documentation, updates, monitoring, backups and time spent on incidents also count. Kubernetes additionally requires platform expertise and coordination between cluster, networking and storage components. Standardized operations can reduce recurring work, but that standard must first be established and maintained.

Three scenarios make a useful cost comparison: continue operating the existing application properly, standardize it on Compose, or introduce a Kubernetes platform. Apply the same business requirements to each scenario. Otherwise, it is easy to compare a simple standalone server with a much higher availability target without making the difference clear.

How to reach a sound decision

  1. Define the operating requirements: describe acceptable downtime, maintenance windows, data loss and expected changes.
  2. Assess the application: record supported installation methods, support for multiple instances, files, sessions and external interfaces.
  3. Assign responsibility: identify who handles maintenance, alerts, recovery and cover for absences.
  4. Test one service: rehearse an update, a failure and a restore in the proposed environment, and document the effort involved.
  5. Expand afterwards: assess further applications against the same criteria.

DAXS combines an assessment of the application and its interfaces with infrastructure planning and a suitable operating model. A specific service, its dependencies and the required operating outcomes are enough for an initial assessment. A personal discussion starts there.

Sources: Docker: the Compose application model · Docker Compose in production · Kubernetes: components and responsibilities · Kubernetes: Deployments and rollouts · Planning a production Kubernetes environment