The Orchestration Headache: Moving Beyond docker run
Let’s be honest. Running Docker on your MacBook is fun. It’s clean, it’s isolated, and it solves the dependency hell that has plagued us since the early days of RHEL 5. But pushing containers into a production environment? That is where the nightmare begins.
I spoke to a sysadmin in Oslo last week who tried to manually manage port mappings for 50 microservices across three bare-metal servers. He looked like he hadn't slept in days. The script he wrote to update his HAProxy configuration had a race condition, and every time he deployed a patch, 10% of his traffic 404'd.
We need orchestration. But the landscape in mid-2015 is a fragmented mess of alpha versions, beta promises, and Google whitepapers. If you are trying to decide how to cluster your containers today, you have three main contenders: Kubernetes, Docker Swarm, and Apache Mesos.
The Contenders
Before we look at the underlying hardware requirements (spoiler: latency kills distributed systems), let's look at the software stack.
| Feature | Kubernetes (v1.0 RC) | Docker Swarm (Beta) | Apache Mesos + Marathon |
|---|---|---|---|
| Maturity | Young, complex, rapid changes. | Very new, native Docker API. | Battle-tested (Twitter, Airbnb). |
| Setup Difficulty | High. Multiple components (etcd, flannel, kubelet). | Low. It's just Docker commands. | High. Requires Zookeeper. |
| Scaling | Pods paradigm. Good for density. | Node-centric. One container per node view. | Massive scale (10,000+ nodes). |
1. Kubernetes (The Google Way)
Google has been running containers for a decade (Borg), and Kubernetes is their attempt to open-source that logic. It introduces concepts like Pods, Replication Controllers, and Services. It is powerful, but it is heavy. You need a dedicated etcd cluster just for state management.
2. Docker Swarm (The Native Way)
Swarm is attractive because it speaks the standard Docker API. If you have tooling that talks to the Docker daemon, it talks to Swarm. However, it is still in beta. I wouldn't bet a major e-commerce launch on it just yet unless you enjoy reading Go stack traces.
3. Apache Mesos (The Enterprise Way)
If you are running a massive cluster, Mesos is the abstract kernel of your datacenter. Frameworks like Marathon run on top of it to manage long-running services (like Docker). It’s rock solid, but setting up Zookeeper and Mesos masters for a simple web app is overkill.
The Hidden Cost: Infrastructure and Latency
Here is what the tutorials don't tell you: Orchestration relies heavily on consensus algorithms (Raft, Paxos).
Whether it's etcd for Kubernetes or Zookeeper for Mesos, your cluster needs to agree on the state of the world. If your network latency between nodes fluctuates, or if your disk I/O chokes during a log write, your cluster will partition. Nodes will think the master is dead. Services will be rescheduled unnecessarily.
This is where "Cheap VPS" providers fail. They oversell their CPU and, more importantly, their storage I/O. If a neighbor on your physical host starts compiling a kernel, your etcd heartbeats might miss a deadline. Boom. Split-brain scenario.
Pro Tip: Always tune your heartbeat intervals if you are not on bare metal. Foretcd, adjust theheartbeat-intervalandelection-timeoutto account for network variance.
# Example tuning for etcd in a high-latency environment
./etcd -name infra0 \
-heartbeat-interval 100 \
-election-timeout 1000 ...
Why Isolation Matters (KVM vs OpenVZ)
Docker interacts directly with the kernel (cgroups, namespaces). If you try to run Docker inside an OpenVZ container, you are asking for trouble. You generally can't. You need a proper hypervisor like KVM.
At CoolVDS, we strictly use KVM virtualization. This ensures that your Docker host has its own kernel. We also use high-performance storage backends. When you are pulling a 500MB image across 10 nodes simultaneously, you need disk throughput, or your deployment will time out.
Data Sovereignty in Norway
We are seeing increased scrutiny on where data lives. The Datatilsynet (Norwegian Data Protection Authority) is watching closely. With the current legal challenges against the US Safe Harbor agreement, moving your persistence layer (databases) to US-controlled clouds is a risk.
Running your orchestration cluster on Norwegian soil isn't just about latency to the NIX (Norwegian Internet Exchange); it's about compliance. Keep your customer data in Oslo.
Verdict: What should you use in 2015?
If you are a small team, stick to configuration management tools like Ansible or SaltStack to manage standard Docker hosts. Don't overcomplicate it.
If you are ready for orchestration:
- Choose Kubernetes if you want to be future-proof and buy into the Google ecosystem. Be prepared for a steep learning curve.
- Choose Mesos if you have 500+ nodes.
Whatever you choose, build it on a foundation that won't crumble. Orchestration tools are sensitive. They demand consistent I/O and low latency.
Need a stable cluster environment? Deploy a KVM instance on CoolVDS today. We offer direct connectivity to the major Nordic exchanges and pure storage performance that keeps your etcd cluster happy.