Create a ClusterMirror
A ClusterMirror is the always-on logical mirror of the cluster. The operator rebuilds it on an interval and publishes the cluster's current risk — what is down, pending or lost, and everything that depends on it. It carries no target version and no verdict; that's upgrade analysis.
The Helm chart creates no ClusterMirror. Create one after installing, like an UpgradeAnalysis — with kubectl, or from the Web UI: Mirops → Cluster Mirror → New mirror.
The simplest form
ClusterMirror is cluster-scoped — it has no namespace — and every field has a default:
apiVersion: mirops.mirops.io/v1
kind: ClusterMirror
metadata:
name: default
spec: {}
That mirrors every namespace, rebuilds every 5 minutes, and writes default.mirops inside the operator pod. One mirror is usually enough; add another for a different scope, report destination or interval.
A fuller example
apiVersion: mirops.mirops.io/v1
kind: ClusterMirror
metadata:
name: default
spec:
scope:
mode: application # all (default) | application (skip system namespaces)
excludeNamespaces: [monitoring]
refresh:
interval: 2m # default 5m
source: # where default.mirops is written
type: s3 # file (default) | s3 | blob | pvc
bucket: my-reports
region: us-east-1
key: prod/default.mirops
See every field in the CRD reference.
Read it
kubectl get clustermirror
# NAME COMPONENTS EDGES AT RISK LAST SYNC AGE
# default 184 297 3 30s 1h
kubectl get clustermirror default -o jsonpath='{.status.byNamespace}'
| Status field | Meaning |
|---|---|
components, edges | Size of the dependency graph. |
atRisk | Components with risk 50 or higher. |
byNamespace[] | Per namespace: maxRisk (0–100) and atRisk. |
lastSync | When the mirror was last rebuilt. |
syncError | Why the last rebuild — or writing its report — failed. Empty when fine. |
reportState, reportLocation, reportError | Where the report went, and whether it was written. |
The full picture is in the report — see Read reports — and on the Web UI's Cluster Mirror page. From a pipeline, mirops scan -n <namespace> prints a namespace's current state, and mirops scan -f <change> judges a deploy against the mirror before it lands — see Impact of a change.
Rebuild now
A spec change rebuilds the mirror at once. To rebuild without changing anything, bump the mirops.io/refresh annotation (the Web UI's Refresh now button does the same):
kubectl annotate clustermirror default mirops.io/refresh="$(date +%s)" --overwrite
Where the report goes
The mirror rewrites its report on every rebuild, so the same location always holds the latest one. With the default file destination it lives inside the operator pod: it's lost on a restart, and missing for a few seconds on a leader change until the next rebuild — the Web UI keeps polling through it. For a report a pipeline reads, or one that survives restarts, use s3, blob or pvc. The source block is the same as an UpgradeAnalysis's; see report destinations.
Upgrade analysis on or off
The mirror runs either way. The report's upgrade.enabled says whether this install runs upgrade analysis (Helm upgrade.enabled), and upgrade.analyses[] lists each UpgradeAnalysis with its target version, decision, and where its report is. That's how the Web UI knows to show "upgrade analysis is turned off" instead of an analysis that would never finish.
Next
- Create an upgrade analysis when a version upgrade is coming.
- Use it in CI/CD.