Skip to content

Controller · manager

TalosCluster controller

The TalosCluster controller brings a TalosCluster from "nodes booted" to "bootstrapped, healthy, kubeconfig available". It bootstraps etcd once, and it publishes the admin kubeconfig and talosconfig as Secrets.

Reconciles
TalosCluster (For, spec or annotation changes only). Controller name taloscluster.
Writes
Secrets <cluster>-kubeconfig, <cluster>-talosconfig and, on request, <cluster>-talosconfig-reader. The cluster status.
Talks to
The Talos API of the control planes, and the Kubernetes API of the cluster.
Requeue
10 seconds until the cluster is Available, then 2 minutes.
Credential TTL
spec.credentials.ttl, default 24 hours. New credentials when a third of the life is left.
Kind Relation Why a change starts a pass
TalosCluster For, with a generation or annotation predicate You changed the spec or asked for something with an annotation. Its own status writes do not start a pass.
Secret Owns, and Watches the secrets bundle A credential Secret or the bundle changed.
TalosNode Watches A member became ready, joined or left.
TalosRollout Watches A rollout of the cluster moved.
Host Watches, the cluster of the node in spec.os A machine got or lost a node. The counts change.
The TalosCluster reconcile loop: count members, guard the bundle, publish credentials, probe Kubernetes, bootstrap once, set Available.Read the cluster1Stopbeing deletedCount the membersready control planes and workers2Guard the secrets bundle3SecretsBundleHeld = Truebundle changed after bootstrapLoad the bundle4Bootstrapped = UnknownSecretsUnavailablePublish the credentialskubeconfig, talosconfig5Probe the Kubernetes API6Bootstrap etcd, once7Bootstrapped = UnknownBootstrapRequestedSet Available8next pass: 10 s, then 2 min when Available
  1. Read the cluster.
  2. Count the members. A member is a node that a Host runs and that is not being removed. Other nodes count as unassigned.
  3. Guard the secrets bundle. After the bootstrap, a changed bundle is held and the copy that the machines run stays in use.
  4. Load the bundle. If it is missing, the conditions are Unknown with SecretsUnavailable.
  5. Publish the admin credentials. Make new ones only when the CA, the endpoints or the TTL changed, or when the expiry is near.
  6. Ask the Kubernetes API for its version.
  7. Bootstrap etcd through the first control plane that answers. Do this once only.
  8. Set Available.
Bootstrap once
The controller records status.bootstrappedAt the first time it sees the cluster bootstrapped. Later, if all members lose etcd, it reads this as a loss and never bootstraps again. Recovery is an approved EtcdRecover operation.
Restore pending
The annotation os.platform-kit.org/restore-pending also stops a bootstrap. See Etcd backup controllers.
Secrets bundle hold
A new bundle on a running cluster would make every control plane look down. The controller keeps the applied copy, and SecretsBundleHeld is True until a person puts the bundle back or deletes the copy.
Short credentials
A certificate that the cluster CA signed cannot be revoked. The short TTL limits a leaked copy. If you shorten the TTL, the controller makes new credentials at once.
Object or field When Field manager
Credential Secrets, owned by the cluster New or near expiry manager (create or update)
Applied bundle copy First time after bootstrap manager
Cluster status: counts, versions, bootstrappedAt, credentialsExpireAt, conditions When it changed manager (status update)
Condition Reasons
Bootstrapped True when etcd runs. Unknown: BootstrapRequested, SecretsUnavailable. False: the reason of the bootstrap check.
Available True: ClusterAvailable. False: NotBootstrapped, KubernetesUnreachable, NodesNotReady.
SecretsBundleHeld True while a changed bundle is held.
You see Cause Do this
Available=False, NodesNotReady A member is not Ready. Use Node not ready.
Bootstrapped=False after it was True Etcd lost its data. Use etcd unhealthy or quorum lost.
SecretsBundleHeld=True The bundle changed after bootstrap. Put the bundle back.
API groupResourcesVerbsScope
os.platform-kit.orgtalosclustersgetlistwatchcluster
os.platform-kit.orgtalosclusters/statusupdatecluster
os.platform-kit.orgtalosclusters/finalizersupdatecluster
os.platform-kit.orgtalosnodesgetlistwatchcluster
metal.platform-kit.orghostsgetlistwatchcluster
coresecretsgetlistwatchcreateupdatenamespace pk-metal