Skip to content

Controller · manager

Endpoint convergence controller

The endpoint convergence controller configures the BMC itself from the EndpointProfile objects that match a ManagementEndpoint. Nothing here disrupts the machine, so there is no operation and no approval. To merge a profile is to approve it.

Reconciles
ManagementEndpoint (For). Controller name endpointconvergence.
Writes
The BMC (accounts, NTP, HTTPS certificate), the managed credential Secret endpoint-creds-<name>, a cert-manager request, and the Configured condition.
Talks to
The BMC, through a write session. cert-manager, through a CertificateRequest in pk-metal.
Requeue
After --poll-interval while a profile matches. None when no profile matches.
Reads
The endpoint from the API server, not from the cache. See the note under Writes.
Kind Relation Why a change starts a pass
ManagementEndpoint For The endpoint changed or the poll interval ended.
Secret Owns The managed credential Secret changed.
EndpointProfile Watches, all endpoints A profile changed. Matching is per endpoint.
The endpoint convergence loop: match profiles, check verification, then credentials, NTP and identity in order.Read the endpoint (uncached)1Stopgone, or being deletedMatch the profiles2Withdraw identity materialno profile: remove ConfiguredMerge the stanzas3Configured = FalseProfileConflictIs the endpoint Verified?4noConfigured = UnknownAwaitingVerificationCredentialspark, set, test, promote5Configured = FalseRotationFailedNTP6Configured = FalseNTPFailedIdentitycertificate from cert-manager7Configured = TrueInSync8next pass: --poll-interval
Each stanza must be in sync before the next one starts.
  1. Read the endpoint from the API server.
  2. Select the matching profiles. If none matches, withdraw the in-flight identity material and remove Configured. A rotated account stays as it is.
  3. Merge the profiles stanza by stanza. Two profiles that set the same stanza differently are a ProfileConflict.
  4. Do not write to a BMC that is not Verified. The wrong-box guard holds every lane that writes.
  5. Credentials: rotate the account of the operator when it is due (see below).
  6. NTP: set the time servers if they differ.
  7. Identity: get a certificate for bmc-<endpoint>.<domain> from cert-manager and push it to the BMC. It goes last, because a certificate needs a correct clock.
  8. Set Configured to True with a summary and apply the share of this lane.

The lane rotates the account of the operator. The factory credentials in spec.credentialsRef stay as a break-glass login.

  1. Generate a new password. Park it in the managed Secret as a candidate, next to the working one.
  2. Set it on the BMC, through the managed login or the factory login.
  3. Log in with the candidate.
  4. If the login works, promote the candidate. If not, the working password stays.

The annotation metal.platform-kit.org/rotated-at on the managed Secret records the time of the last rotation. Each crash window heals on a later pass. See Rotate BMC credentials.

Unmatched is unmanaged
When no profile matches, the controller stops. It does not undo a rotation.
A key never outlives its push
A transient Secret carries the certificate request and, for some vendors, the private key. The controller deletes it when the BMC serves the new certificate.
Push once
status.identityPushed records that the BMC accepted a certificate and restarted. The controller does not push the same material twice.
Object or field When Field manager
BMC accounts, NTP, HTTPS certificate When they differ from the profile Redfish
Secret endpoint-creds-<name> (owned by the endpoint) Rotation manager
In-flight identity Secret and CertificateRequest Identity push manager
Endpoint Configured and status.identityPushed When they changed pk-metal-endpoint-convergence (server-side apply)
Condition Status Reasons
Configured True InSync
Configured False ProfileConflict, RotationFailed, NTPFailed, and the reasons of the identity lane
Configured Unknown AwaitingVerification
You see Cause Do this
Configured=False, RotationFailed The BMC refused the new password. The old password still works. See Rotate BMC credentials.
Configured=Unknown, AwaitingVerification The endpoint is not verified. Use Host in Mismatch.
API groupResourcesVerbsScopeMarker in
metal.platform-kit.orgmanagementendpointsgetlistwatchclusterendpointprofile_controller.go
metal.platform-kit.orgmanagementendpoints/statuspatchclusterendpointprofile_controller.go
metal.platform-kit.orgmanagementendpoints/finalizersupdateclusterendpointprofile_controller.go
metal.platform-kit.orgendpointprofilesgetlistwatchclusterendpointprofile_controller.go
coresecretsgetlistwatchcreateupdatedeletenamespace pk-metalendpointprofile_controller.go
cert-manager.iocertificaterequestsgetcreatedeletenamespace pk-metalendpointprofile_controller.go
metal.platform-kit.orghostshostoperationsgetlistwatchclusteridentity.go