Saltar al contenido principal

Deploying Zaris on EKS: the Helm OCI Chart and the Replica-Placement Trap

· 9 min de lectura
Clustron Team
Ingeniería de Sistemas Distribuidos

The friction of running a data store on Kubernetes used to start at installation. You added a Helm repo, hoped it stayed online, and reconciled chart versions by hand. That part is now trivial: the Zaris chart ships as an OCI artifact in a container registry, so installing it is the same kind of pull as pulling an image — no repo list, no helm repo update, just a reference and a version. On EKS, where you already have a registry and an IAM story, that removes the last bit of bespoke setup.

What does not become trivial, and what no helm install output will warn you about, is placement. A distributed store's whole availability promise rests on one assumption: that the copies of a piece of data live on different failure domains, so losing one does not lose the data. Kubernetes does not know that assumption exists unless you tell it. Left to its defaults, the scheduler optimises for bin-packing and indifference — and it will quite happily schedule a partition's primary pod and its replica pod onto the same EKS node. When that node is drained for an upgrade or lost to a spot reclaim, both copies go with it, and the replication factor you carefully set to 2 bought you exactly nothing.

This post does the EKS deployment end to end, then spends most of its time on the placement trap, because that is the part that turns a green cluster into a real one.

The cluster and the install​

Everything below assumes a standard EKS cluster with a few worker nodes across availability zones — the kind eksctl create cluster gives you, or any node group you already run. Point kubectl at it, and the install is two steps: a namespace, then the chart straight from its OCI reference.

# The chart is an OCI artifact — no `helm repo add`, just pull-and-install by reference.
kubectl create namespace zaris

helm install zaris oci://registry-1.docker.io/clustron/zaris \
--version 2.2.0 \
--namespace zaris

That brings up the default topology: a set of node pods as a StatefulSet (each pod is one Zaris data node, with its own persistent volume), plus a manager that supervises cluster formation. The pods find each other over a headless Service, form a cluster, and the store is ready. For a smoke test this is enough, and on EKS the persistent volumes come from EBS via the CSI driver with no extra wiring.

Two facts about the topology matter before you put data on it. First, one Zaris node runs per pod — the node-to-pod mapping is one-to-one, which is what makes the pods a clean unit of scheduling and scaling. Second, and this is the one people miss: at replication factor 2, every partition needs two pods to hold its two copies, so N partitions at RF2 want 2N node pods and those pods spread so the two copies never share a node. Set the replica count too low and some partition ends up with only one real copy; let the two copies co-locate and the "two" is a fiction. The chart will let you do both of those wrong without complaint.

The placement trap, concretely​

Here is the failure in slow motion. You deploy with, say, four node pods and RF2, expecting that any single node loss is survivable. The StatefulSet creates four pods; the default scheduling has no rule that says "keep a partition's two copies apart," because Kubernetes has no concept of a Zaris partition. So the scheduler places pods to balance CPU and memory, and on a cluster with fewer nodes than pods — which is normal, you bin-pack — two pods that happen to hold the two copies of partition 3 land on the same EKS node.

Now that node is cordoned for a routine kernel upgrade. Both pods evict. For the moment of the drain, partition 3 has zero live copies, not one — the exact outage your replication factor was supposed to prevent. Nothing was misconfigured in Zaris; the data was replicated faithfully to two pods. The pods were just standing on the same floor when it gave way.

Default schedulingboth copies on one node → node loss = data lossEKS node AP3 primaryP3 replicaEKS node B(other pods)node A drains → P3 has 0 copiesPod anti-affinitycopies spread → node loss survivableEKS node AP3 primaryEKS node BP3 replicanode A drains → replica still serves

The fix: tell the scheduler what a failure domain is​

The cure is pod anti-affinity — a rule that tells the scheduler to keep the store's pods on distinct nodes. Because every Zaris pod carries the same labels, a single requiredDuringScheduling anti-affinity rule keyed on the pod label and topology key kubernetes.io/hostname forces one node pod per node:

# values.yaml override — spread node pods across EKS nodes (and, with zone keys, across AZs).
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: zaris
topologyKey: kubernetes.io/hostname
helm upgrade zaris oci://registry-1.docker.io/clustron/zaris \
--version 2.2.0 --namespace zaris \
-f values.yaml

With topologyKey: kubernetes.io/hostname, no two node pods share a node, so a partition's two copies cannot co-locate. The important and often-overlooked consequence: required anti-affinity means you now need at least as many schedulable nodes as node pods. If you run four node pods, you need four nodes; a pod with nowhere distinct to go stays Pending rather than doubling up. That is the correct behaviour — a Pending pod is a visible, fixable problem, whereas a silently co-located replica is an invisible one that only reveals itself during an outage. On EKS, swap the topology key for topology.kubernetes.io/zone to spread copies across availability zones instead, which buys you survival of a whole-AZ event at the cost of needing nodes in that many zones.

Before you put production traffic on it​

A few things that are easy to defer and expensive to discover late. EBS volumes are zonal, so a pod bound to a PV in one AZ can only reschedule onto a node in that same AZ — your node groups must have capacity in each zone your pods live in, or a rescheduled pod wedges in Pending waiting for a node that cannot exist. Spot instances amplify the placement trap, because reclaims are frequent and correlated; anti-affinity is not optional if any node pod runs on spot. And if you expose the store to clients outside the cluster, that is its own exercise — per-pod addressing and advertised endpoints — separate from the internal clustering this post covers.

Wrap-up​

The OCI chart makes getting Zaris onto EKS genuinely a two-command job, and that is a real improvement — but it also makes it easy to get a green cluster that is not actually fault-tolerant, because Kubernetes schedules pods and has no idea that two of them hold the only two copies of your data. Replication factor is a promise about failure domains, and on Kubernetes you have to state the failure domain yourself: pod anti-affinity on kubernetes.io/hostname (or a zone key) is what makes RF2 mean "survives a node loss" instead of "survives a node loss unless the scheduler got unlucky." Set it before you load data, size your node groups so the required rule can actually be satisfied, and keep EBS zonality in mind when pods reschedule. Do that, and the two commands really are all it takes.