Controller · manager
Manager
The manager is the operator process. It loads the ledger, wires the 14 lanes of controllers, and serves boot media to the BMCs. It runs the same way against a kind cluster on day 0 and in the management cluster.
At a glance
Section titled “At a glance”- Binary
manager, from cmd/manager.- Deployment
pk-metal-managerin the namespacepk-metal, service accountpk-metal-manager.- Identity
- At start, the manager asks the API server who it is (SelfSubjectReview). It writes that name into
proposedByof each proposal. - Leader election
--leader-elect. Leasepk-metal.metal.platform-kit.orgin the namespace of the pod. The lease is released on a clean stop.- Cache
- Secrets, ConfigMaps and Jobs only in the namespace of
--credentials-namespace. So their permissions can be a namespaced Role. - Subcommands
imager-stageandimager-run. Only the imager Job uses them.
What runs inside
Section titled “What runs inside”The controllers reconcile the kinds of the API group. Controllers shows which controller owns which kind.
| Flag | Default | What it sets |
|---|---|---|
--ledger |
necessary | The ledger file: YAML that maps each BMC MAC to its HTTPS URL. A line that does not parse is logged and skipped. |
--credentials-namespace |
pk-metal |
Where the manager reads BMC logins and CAs, and writes node configs and cluster credentials. Operations are proposed here too. |
--bmc-ca-secret |
empty | Secret (key ca.crt) with the CA of the BMC certificates. Empty pins the key of each BMC on first use, see Trust the BMC certificate. |
--bmc-insecure |
false |
Accept any BMC certificate, and pin no key. Each device at the address of a BMC gets its password. For simulated BMCs in a lab only. See BMC certificates. |
--poll-interval |
5m |
How often each BMC is read again. |
--image-factory |
public factory | The host of the Talos image factory. |
--registry-ca |
empty | PEM file with the CA of the registry that serves firmware images. |
--media-listen |
:8443 |
The address of the media service (HTTPS). |
--media-url |
empty | https://host[:port] where BMCs reach the media service. Empty stops the media service, and with it installs. |
--media-cert-secret |
empty | Secret with the media certificate, read again each minute. Empty uses a self-signed certificate, replaced 10 days before it expires. |
--media-store |
empty | Directory of the media store for embedded installers. |
--media-store-claim |
empty | PersistentVolumeClaim at --media-store, which the imager Jobs mount. Needs --media-store. |
--imager-repository |
upstream | Where the imager image comes from. The default is ghcr.io/siderolabs/imager. |
--imager-digest |
current release | <version>=sha256:<digest>. Can repeat. |
--imager-helper-image |
pod image | The image with the manager binary for the imager Jobs. |
--etcd-backup-dir |
empty | Directory of the etcd backup volume for pvc sinks. |
--etcd-backup-claim |
pk-metal-etcd-backups |
The claim that pvc:// locations name. |
--checkin-timeout |
30m |
How long an install waits for the machine to answer. |
--release-shutdown-timeout |
5m |
How long a release lets the OS shut down before it forces the machine off. From 1 s to 1 h. |
--node-name |
$NODE_NAME |
The Kubernetes node of the pod. With it, the self guard works. See Protection controller. |
--metrics-bind-address |
0 (off) |
Address of /metrics. |
--health-probe-bind-address |
0 (off) |
Address of /healthz and /readyz. |
--leader-elect |
false |
Use leader election. |
--version |
Print the version and stop. |
The manager refuses to start when --ledger is empty, a duration is out of range, or --media-store-claim has no --media-store. Each error message names the fix.
The ledger
Section titled “The ledger”The ledger maps each BMC MAC to the address of the BMC. The standard install mounts it from ledger.yaml in the ConfigMap pk-metal-ledger.
- The manager reads the ledger once, at start.
- With the standard overlay, an apply of a changed ledger restarts the manager. The overlay generates the ConfigMap with a name that changes with its content.
- If you edit the ConfigMap by hand, restart the Deployment:
kubectl -n pk-metal rollout restart deployment/pk-metal-manager. - A bad line does not stop the manager. The Asset with that MAC says
LedgerEntryInvalid.
See Asset controller.
The media service
Section titled “The media service”BMCs download boot media over HTTPS from the media service. Each download needs a grant: a 128-bit random token in the URL path, valid for one operation and a limited time.
- The service starts only with
--media-url. - BMCs do not check the certificate. HTTPS gives privacy. The grant gives access control.
- A grant ends when its operation ends or is deleted.
See Virtual media boot.
The imager Job
Section titled “The imager Job”For a BMC with one media slot, the BootAsset controller builds an installer with the config inside. The imager runs as a Job in pk-metal.
- The init container
stagecopies the manager binary into the pod (manager imager-stage). - The container
imagerruns the pinned imager throughmanager imager-run, which keeps the config out of the log. - The ISO goes to the media store. The manager imports it.
The Job runs without root and without a service account token, next to the manager pod.
Metrics
Section titled “Metrics”All series have the prefix pk_metal_. They come from the cache at scrape time.
| Metric | Labels | Meaning |
|---|---|---|
host_phase |
host, phase | 1 for the phase of each Host. |
host_blocked |
host, reason | 1 while a Host is blocked. |
operations |
phase, action | HostOperations by phase and action. |
operation_failed |
namespace, operation, host, reason | 1 for each failed operation that waits for a person. |
operation_awaiting_approval_seconds |
namespace, operation, host, reason | How long an operation waits for approval. |
operation_blocked |
namespace, operation, host, reason | 1 for each approved operation that did not start. |
bmc_reachable |
endpoint | 1 when the BMC answers Redfish. |
talosnode_ready |
node, cluster, role | 1 when a node is Ready. |
talosnode_info |
node, cluster, version | The Talos version of a node. |
taloscluster_available |
cluster | 1 when the API answers and all nodes are Ready. |
taloscluster_nodes |
cluster, role, ready | Nodes by role and readiness. |
credentials_expiry_timestamp_seconds |
cluster, kind | When a published credential expires. |
etcd_backup_last_success_timestamp_seconds |
cluster | Time of the newest verified snapshot. |
rollout_nodes_done, rollout_nodes_total |
rollout, cluster | Progress of a rollout. |
Permissions
Section titled “Permissions”The manager itself asks for these rules. The rules of each controller are on its page.
| API group | Resources | Verbs | Scope |
|---|---|---|---|
coordination.k8s.io | leases | getcreateupdate | namespace pk-metal |
core | events | createpatch | namespace pk-metal |
core | pods | get | namespace pk-metal |
authentication.k8s.io | tokenreviews | create | cluster |
authorization.k8s.io | subjectaccessreviews | create | cluster |
The full role is on the RBAC page.