MiraCluster¶
For: anyone writing the custom resource the operator reconciles.
mira.miradb.dev/v1alpha1, namespaced, short name mira. The schema below is
the one the API server stores, which is the one that decides what
survives a write: a field it does not name is pruned on apply, with
no error anywhere.
Installing it is Install; what the operator builds out of it, and how a scale-in is sequenced, is the chart reference.
spec¶
A Mira storage tier and the proxy in front of it.
| Field | Type | Default | What it sets |
|---|---|---|---|
coldStorageClaim |
string | unset | Name of an existing claim holding the cold store, mounted into the drain Job at the first path segment of offload. |
image |
string | required | The Mira image the storage pods and the drain Jobs both run. |
maxReplicas |
integer ≥ 1 | 10 |
Replica ceiling. Scale-out stops here rather than filling the cluster. |
offload |
string | unset | Where a drained replica's blocks are copied before its volume is deleted. ${node} interpolates to the replica name. |
proxy |
object | — | The mira proxy tier that fans out across the replicas. |
proxy.replicas |
integer | 2 |
How many proxy pods. Zero disables the proxy entirely and leaves the storage pods addressable only through the headless Service. |
proxy.resources |
ResourceRequirements | unset | CPU and memory for one proxy pod. |
replicas |
integer ≥ 1 | 1 |
Replica floor. The tier never shrinks below this. |
resources |
ResourceRequirements | unset | CPU and memory for one storage replica, and for the drain Job that archives its volume. |
route |
object | unset | An HTTPRoute in front of the tier, attached to Gateways you already run. |
route.hostnames |
array | unset | Hostnames the route answers on. Unset answers on every hostname its listener accepts. |
route.parentRefs |
array | required | The Gateways to attach to. At least one, or the route binds to nothing and the apiserver accepts it anyway. |
route.parentRefs[].name |
string | required | metadata.name of the Gateway. |
route.parentRefs[].namespace |
string | unset | The Gateway's namespace. Unset is this MiraCluster's own. |
route.parentRefs[].sectionName |
string | unset | spec.listeners[].name to attach to. Unset attaches to every listener that will have it. |
scaling |
object | — | When to add a replica, and when to take one away. |
scaling.cooldownSeconds |
integer | 600 |
Seconds after any scaling action before another may be considered. |
scaling.downWhenFreeAbove |
number | 0.6 |
Remove a replica when every replica's free_fraction is above this. |
scaling.drainDeadlineSeconds |
integer | 3600 |
Seconds a drain Job may run before Kubernetes fails it. |
scaling.upWhenFreeBelow |
number | 0.15 |
Add a replica when the fullest replica's free_fraction drops below this. |
storage |
object | required | Per-replica volume. |
storage.className |
string | unset | StorageClass. Unset uses the cluster default. |
storage.size |
quantity | required | Volume size, as a Kubernetes quantity — 100Gi. |
status¶
A subresource, so the operator writes it without touching the spec, and an unsatisfiable spec lands here rather than in a log line nobody reads.
| Field | Type | Default | What it reports |
|---|---|---|---|
draining |
integer | unset | Replica ordinal currently being drained, if any. Set before the drain Job is created and cleared only once the volume has been released, so a controller restart mid-drain resumes rather than abandoning a half-copied tier. |
freeFraction |
string | unset | The lowest free_fraction seen across the tier, rendered to two decimals. A string and not a float because this is a printcolumn, and kubectl renders a float64 status field in scientific notation. |
lastScaled |
string | unset | RFC3339 of the last completed scaling action, for the cooldown. |
message |
string | unset | Human-readable reason for the current phase. |
phase |
string | unset | Ready, ScalingUp, Draining or Degraded. |
replicas |
integer | 0 |
Replica count the operator is currently asking for. |
Refused on write¶
Enforced by the API server rather than by the operator, so the kubectl
that would break the tier fails instead of the reconcile that follows it.
| Rule | Message |
|---|---|
self.spec.maxReplicas >= self.spec.replicas |
maxReplicas must be at least replicas |
kubectl get miraclusters¶
| Column | Read from |
|---|---|
| Replicas | .status.replicas |
| Free | .status.freeFraction |
| Phase | .status.phase |
| Age | .metadata.creationTimestamp |