Skip to content

The operator

The cluster runs its own operations, so that it lasts months or years without anyone: the operator does on schedule what an admin does from the workstation (Operations), with the same playbooks and the same inputs. What it applies is a commit of the cluster's repository; which operator runs is the ethere that commit pins, deployed by Flux. An admin can always do the same by hand, the operator down or not.

What it does

Every 30 minutes (a resource's annotation ethe.re/reconcile-period, e.g. 1m, overrides it), and at once when Flux brings a new commit of the cluster's repository, one reconciliation of the cluster's operations at a time (operator/operations.ts):

  1. The cluster's revision: the commit Flux fetched (its GitRepository cluster), accepted when it pins the operator's own ethere (below); the last accepted one applied otherwise, the reason in its status.
  2. The PKI's repository restored from its S3 bundle, the first time in a new pod (git/restore.yml).
  3. The servers' rotation of every image of server_topology in its region (OS_CLOUD, OS_REGION_NAME), then of its cloud's other regions, their region as OS_REGION_NAME (dampetra's DNS secondaries in GRA9 and SBG5, their delegation written with dns_provider_zones' credentials): provisioning/rotate.yml, the oldest server due replaced (Rotating the servers); what to rotate is operator/plan.yml's. The control plane's own servers are Cluster API's (Cluster API providers).
  4. The cluster's configuration, last (a failure there never holds a rotation back): k8s/configure.yml, but what needs an admin's credentials (cluster_credentials=false: the volumes', the registry's, the backups' credentials and the tenants' repository's Secret, which it can neither make nor decrypt) and the edges' name (k8s_gateway_edges=false: the replacements keep it).

It also runs Cluster API's providers (EthereCluster, EthereMachine, EthereConfig, EthereControlPlane: their playbooks in playbooks/capi/), each on its own period and at once on a change of its spec, its owners or, for some, its annotations.

What it doesn't do

  • A lost quorum or a lost cluster: no API, no operator. The workstation runs provisioning/cluster.yml (Reconciling a cluster), or an operator on a management cluster on an admin's request (Cluster API providers).
  • An admin's credentials: an admin runs k8s/configure.yml once with them, and again to rotate them.
  • An admin's identity and recovery rights: no admin or recipient management, no provider root credentials, nothing deleting the backups or the bundles.
  • Not yet: provisioning/cluster.yml's top-up while the API answers (the missing servers added, the Nodes of servers gone deleted), the monthly CAs ahead of time, the rotation of its age key and of its derived credentials (roadmap).

Checking on it

etherectl operator status            # the last reconciliation, step by step, the revision it applied, and its pod
etherectl operator logs --summaries  # each run that changed something or failed, the revisions, the errors (--all: every run; -f)
etherectl operator logs -f           # its whole log: the controller's events, one JSON object a line
flux get helmreleases -n flux-system # its deployment: the HelmReleases platform and ethere-operator

The playbooks it runs are commands: their output stays in its pod (/run/ethere-operator/runs/), the controller logs each run summed up (step, reconciled: what changed and what failed, by task) and writes its account into its resource's status, failed or not (status.lastReconcile): started, finished, result (Succeeded, Failed), failedTask, revision (the commit applied: main@sha1:…, or workstation@… for an admin's), pending (a newer revision left aside, and why), and a step per playbook it ran: its rc, changed, failed, changedTasks, failedTasks. A reconciliation with nothing to do changes nothing; the first one of a new pod restores pki_dir and writes its kubeconfig.

Its configuration: the cluster's repository

The operator applies a commit of the cluster's repository, never a workstation's checkout (Git): Flux fetches it (k8s/flux.yml: the GitRepository cluster, its artifact the files of operator_cluster_files: ethere.yaml, operator.yaml, platform/, inventory/, secrets/, aws/, openstack/), the operator accepts it when its ethere.yaml pins the operator's own ethere (its image's commit or one of its tags; a path: pin always) and keeps it in the Secret operator-cluster-revision (operator/revision.ts). A commit pinning another ethere waits: the accepted one goes on being applied, the status says what waits and why. A Flux, git or source-controller outage changes nothing: the accepted revision is applied all the same.

So a change of the cluster's configuration is a commit, pushed (git/publish.yml -e git_repository=cluster, then the mirror if any): the operator applies it within a minute. A workstation's k8s/configure.yml is refused while the operator runs (operator/_takeover.yml): its next run would undo it.

Its deployment: Flux, from the cluster's repository

Which operator runs is the ethere the repository pins: Flux deploys it, nothing else decides its version.

  • The platform (platform/ of the cluster's repository, a copy of ethere's charts/ethere-platform: etherectl platform init, then etherectl platform update with every move of ref:), its values the repository's ethere.yaml and operator.yaml (Flux's valuesFiles): a GitRepository ethere at the pinned ref (a full commit, on ethereRepository.branch; or a tag) and a HelmRelease of ethere's chart charts/ethere-operator from it, its image ethere-operator:<ref>, rolled back if its upgrade fails. k8s/flux.yml makes the HelmRelease platform for a cluster pinning a ref whose repository holds platform/, after its checks (k8s/_platform_check.yml: a full commit or a tag, ethere's repository named, the copy this ethere's, operator.yaml saying what the inventory knows).
  • operator.yaml: the operator chart's values (charts/ethere-operator/values.yaml, merged over them as Helm merges): the cluster's name, cloud, region and AWS profile (filled in by etherectl platform init), its spec (rotate_due_days…); and where Flux reads ethere (ethereRepository: its URL, its branch, its credentials' Secret). Plain YAML: Ansible reads the same (operator_values).

Moving the cluster to another ethere moves the operator:

# ethere at the new commit, published (git/publish.yml -e git_repository=ethere -e git_dir=<checkout>)
# ethere.yaml's ref: the new commit, then from the cluster's shell (etherectl runs the pinned ethere):
etherectl ns ansible-playbook $ETHERE_ROOT_DIR/playbooks/containers.yml --limit localhost,ethere-operator,ethere-docs
etherectl ns ansible-playbook $ETHERE_ROOT_DIR/playbooks/images.yml --skip-tags openstack --limit localhost,<roles>
ansible-playbook $ETHERE_ROOT_DIR/playbooks/registry/release.yml     # ethere-operator, ethere-docs, ethere-images/<role>: <commit>
etherectl platform update
git commit -am "ethere <commit>"
ansible-playbook $ETHERE_ROOT_DIR/playbooks/git/publish.yml -e git_repository=cluster

Flux releases the chart at that commit: the new operator's pod replaces the old one (a run under way stopped, resumed by the next: below), accepts the commit that pins it, reconciles at once: it imports the commit's server images into Glance in every region of the topology (images/import.yml: an image unchanged only marked; docs/dev/server-images.md), then its servers on another image rotate, one at a time (the control plane's through Cluster API). A role's image missing from the registry: nothing imported nor rotated for it, the import's report says so.

Without Flux (a cluster pinning a path:: the test project, a workstation's standalone cluster; an operator on a management cluster): operator/deploy.yml renders the same chart (helm template) and applies it, with operator_values, what the inventory and the environment know (operator_facts) and the admin path's own inputs (operator_image, operator_spec, operator_aws_config, operator_resource_reconcile_period). Its objects carry Helm's ownership: a cluster moving to Flux has them adopted.

Bootstrapping it (the first time, or after a takeover):

ansible-playbook $ETHERE_ROOT_DIR/playbooks/operator/credentials.yml   # its credentials, once
ansible-playbook $ETHERE_ROOT_DIR/playbooks/operator/deploy.yml        # its objects, the revision it applies first
ansible-playbook $ETHERE_ROOT_DIR/playbooks/k8s/flux.yml               # the platform (or its own next reconciliation)
  1. Its credentials (operator/credentials.yml, from the workstation): an OpenStack application credential ethere:<cluster>:<region>:operator (every region of the cloud's topology), an S3 user reading and writing the git bundle and nothing else (git_bundle_bucket_manage: false), its age key (a Job of its own image: the Secret operator-age, its recipient alone read back), dns_provider_zones' credentials sops-encrypted for it. Then the admin's side: a creation rule of the cluster's sops configuration for the CA keys (operator_sops_path_regex: the admins' recipients and the operator's), the CA keys re-encrypted, pki_dir pushed.
  2. Its objects (operator/deploy.yml): the chart's, and the Secret operator-cluster-revision seeded from the checkout (workstation@<commit>), which Flux's next commit replaces.

Taking over

kubectl -n flux-system patch helmrelease ethere-operator --type merge -p '{"spec":{"suspend":true}}'
kubectl -n ethere-operator scale deploy/ethere-operator --replicas=0
etherectl operator reconcile          # what it runs, from this checkout: the admin's kubeconfig, PKI and -e variables

etherectl operator reconcile runs the controller in the foreground on the checkout as it is (operator/main.ts reconcile EthereOperations <cluster> --checkout): its variables operator.yaml's operator.spec and the admin's --extra-vars (not the resource's spec: the pod's edge on its host), its account in the resource's status. Refused while the operator runs. Then the HelmRelease resumed (suspend: false): Flux scales the operator back.

Its own server going away

A rotation replaces the oldest server, perhaps the one the operator runs on: the drain evicts it in the middle of replace.yml, its Deployment starts it on another server. Nova keeps what was under way: replace.yml marks the server being replaced in its metadata (replace_metadata_key) before adding the new one, and rotate.yml resumes a marked server first, before or after its new server was added (an image one above its count without a mark is refused; another replacement of the image is refused while one is marked). The same for an admin whose run was interrupted, and for a run stopped by a new operator's pod.

How it works

A controller in TypeScript on Bun (its design): fetch alone against the Kubernetes API (no Kubernetes library), an informer per kind, a queue each (its concurrency, its backoff), a Lease (a single leader), a health endpoint; each reconciliation a sequence of playbooks run as an admin runs them (ansible-playbook with ethere's and the cluster's inventory, the accepted revision's directory as the cluster's, its variables), their events read through a callback of ethere's (plugins/callback/ethere_events.py). Cluster API's kinds keep a finalizer (<group>/ethere) and skip what their playbook would leave at once.

Two identities:

  • Its ServiceAccount is the controller's only: the resources and their status, the Lease, events, the accepted revision's Secret, Flux's GitRepository cluster.
  • The playbooks authenticate as an admin's do: a client certificate from the CA k8s-root made by k8s/kubeconfig.yml (system:masters), the git signer's from the CA pki, the registry pusher's from the CA registry, etcd's client's; their CN signer_name (ethere-admin-$USER on a workstation, ethere-operator in its image: ETHERE_SIGNER_NAME). No RBAC list to keep in sync with the playbooks.

Its environment:

  • On the control plane servers' host network (like Zot and the Cinder CSI controller; managing a cluster from a management cluster, on the pods' network instead): the API's anycast address, the edge on its host (an aio server's HAProxy: edge_address 127.0.0.1, the git writer and the API through it), Git-Net, the host's IPv4 egress (OpenStack's and S3's endpoints), the node's resolvers; its health endpoint on 16789.
  • Its files: pki_dir an emptyDir, restored from the git bundle on its first run, then following the writer as on a workstation; XDG_RUNTIME_DIR, its home and TMPDIR a memory emptyDir (the revisions it applies, the runs' outputs, Ansible's temporary files: never on the node's disk), the Secrets mounted under it: its clouds.yaml, its AWS credentials file, its age key; its variables, the AWS and sops configurations from the ConfigMap operator-config (the revision's aws/config and secrets/sops.yaml preferred).
  • On the qemu provider (Standalone clusters): no OpenStack credentials (it asks its host through its VM's metadata service), no S3 user with the git bundle in the cluster.

Its image, one per ethere commit (playbooks/containers.yml, tagged with the commit: ethere-operator:<commit>, registry/release.yml adding the commit's tags): an Exherbo rootfs from the image pipeline (Python 3.13, git, openssl, tar, kubectl at the cluster's version, helm, sops, Bun: dev-node/bun-bin, its archive's checksum checked), ethere at /opt/ethere-operator (its files as git sees them, the collections, ethere's Python environment built in the chroot against its Python), the controller a bundle Bun runs (bun build, its dependencies inside); two layers, ethere's files above. Nothing of a cluster: the same image for every cluster and every cloud.

Decisions

  • Operator SDK's ansible-operator for the first increment (2026-11-01), replaced by a controller of ethere's in TypeScript (2026-11-19, live 2026-11-24): ansible-operator's wrapper playbooks had grown unreadable (logs, concurrency, its proxy), and @kubernetes/client-node failed under Bun (its CA and certificates ignored, unknown fields dropped). The playbooks stay the actions.
  • It signs with the monthly CAs' keys (2026-11-01), never an intermediate CA issued ahead by an admin: a sops recipient of the CA keys, its own age key generated in the cluster, its public key added by an admin.
  • Its rights (2026-11-01): an admin's over the cluster's operation (the CA keys, the PKI's repository, the cluster's servers, the DNS provider's records, writing the backups and bundles, rotating its own derived credentials); not an admin's identity and recovery rights.
  • The DNS provider's credential is a derived one, restricted to the zones' records (Secrets).
  • Git the only source of truth, an admin bootstraps (2026-11-19): what it applies is a commit of the cluster's repository, which operator runs is the ethere that commit pins, deployed by Flux (2026-11-24); no deploy-time input but the admin's bootstrap.
  • Its values plain YAML outside the inventory (2026-11-21): the chart's values.yaml and the cluster's operator.yaml, read alike by Helm and by Ansible; what the inventory computes is checked against them.
  • The platform a copy in the cluster's repository (2026-11-23): Flux can read ethere.yaml only from a chart of the same repository; etherectl platform update keeps the copy, k8s/flux.yml refuses another.
  • Its image is an Exherbo rootfs (2026-11-02) built by ethere's image pipeline: no third-party base image; Bun an Exherbo package of ethere's (2026-11-22), not the workstation's.

Its history: the servers' rotation of its region first (2026-11-02), the cluster's configuration (2026-11-16), the other regions' servers, the cluster's repository through Flux (2026-11-19), its move by a Job (2026-11-19, gone), the TypeScript controller deployed by Flux (2026-11-24).