Kind · metal.platform-kit.org/v1alpha1
EndpointProfile
An EndpointProfile tells the operator how to configure a set of BMCs: the account of the operator, the time servers and the HTTPS certificate. You write it. The operator applies it to each BMC that the profile selects.
At a glance
Section titled “At a glance”- Group and version
metal.platform-kit.org/v1alpha1- Scope
- Cluster.
- Written by
- You. Keep it in git.
- Reconciled by
- Endpoint convergence controller
- Selects
- ManagementEndpoints, by label.
- Approval
- None. The profile does not disturb the machine, thus the merge of the profile is the approval.
- Status
- None. Read the condition
Configuredof each ManagementEndpoint. - Source
- endpointprofile_types.go
How it connects
Section titled “How it connects”The controller finds the profiles whose spec.match selects the labels of an endpoint.
It writes to the BMC only when the endpoint has the condition Verified. Thus the operator does not configure a wrong machine.
The result is the condition Configured on the ManagementEndpoint.
A profile is one of the three types of convergence. A BiosProfile and a FirmwareProfile change the machine, and they need an approved HostOperation. An EndpointProfile does not. Credential rotation shows the credentials lane step by step.
The three lanes
Section titled “The three lanes”Each part of the spec is one lane. A lane is active only when the profile has that part.
credentials- The operator makes its own account on the BMC and keeps the password in a Secret,
endpoint-creds-<endpoint>. It makes a new password when the Secret is older thanmaxAge, 90 days by default. When the username changes, it disables the old account after the new one logs in. ntp- The operator sets the time servers of the BMC. Then it reads them again to make sure that the BMC has them.
tls- The operator gets a certificate for
bmc-<endpoint>.<domain>from cert-manager and puts it on the BMC. It gets a new certificate before the old one expires.
How a password changes
Section titled “How a password changes”- The operator makes a new password and keeps it in the Secret, with the keys
next-usernameandnext-password. - It sets the password on the BMC. It uses the managed account first, and the factory account second.
- It does a login with the new password.
- If the login works, the new password replaces the old one in the Secret.
If the BMC refuses the password, the old password stays in the Secret and continues to work. The operator does not change the factory account. That account is the way back to the BMC.
More than one profile
Section titled “More than one profile”More than one profile can select the same endpoint. The operator merges them one part at a time.
- The operator sorts the profiles by
spec.layer. Profiles on one layer are in the order of their names. - A profile on a higher layer replaces the full part (
credentials,ntportls) of a lower layer. - Two profiles on the same layer must agree on a part. If they do not,
Configuredis False with the reasonProfileConflict, and the operator writes nothing to that BMC. - An empty
spec.matchselects all endpoints.
| Field | Type | Description |
|---|---|---|
credentials | object | Credentials makes the operator run its own account on the manager: created through the asset's factory credentials, password kept in a managed Secret, rotated on cadence. A new password is kept beside the working one (keys next-username, next-password) and replaces it only after a login with it succeeds, so a manager that refuses it leaves the working password in place. When the username changes, the account it replaces is disabled once the new one logs in. The factory account is left untouched: it is the way back in after the managed password was changed behind the operator's back, and the way in at adoption. |
maxAge | string | MaxAge rotates the managed password when the Secret grows older than this; 90 days when unset. A copy of the Secret therefore stops working at the latest after this time. A rotation sets the new password through the managed account's own session first, so it works when the factory login no longer does. |
usernamerequired | string | Username of the operator's managed account (role Administrator — the executor flashes firmware and resets the manager over it). |
layer | integer (int32) | Layer orders overlapping profiles: higher layers override lower ones, stanza by stanza. Profiles on the same layer must agree. |
matchrequired | object | Match selects ManagementEndpoints by label. Endpoints carry only discovered facts (vendor, model, vlan) — there is no claim, hence no intent axis. An empty selector matches every endpoint. |
matchExpressions | []object | Label requirements that the object must meet. All must match. |
keyrequired | string | The label key. |
operatorrequired | string | In, NotIn, Exists or DoesNotExist. |
values | []string | The values for In and NotIn. Exists and DoesNotExist take no values. |
matchLabels | map[string]string | Labels that the object must have, as key and value pairs. All must match. |
ntp | object | NTP converges the manager's own clock sources. A skewed BMC clock is not cosmetic: it rejects freshly-issued certificates (NotBefore in its future) and mistimes every log line. |
serversrequired | []string | Servers, in preference order. At most three — the iBMC carries exactly three server slots. |
tls | object | TLS runs the manager's HTTPS identity: a cert-manager-signed certificate for bmc-<endpoint>.<domain>, pushed over the vendor's dialect and renewed on cadence. The factory certificate is replaced and cannot be restored — a CA-signed identity is strictly better and the intended end state. A push restarts the manager, which drops its virtual media, so it waits while an approved operation on a machine behind the endpoint has not finished (reason IdentityPushHeld). |
domain | string | Domain completes the identity: CN and DNS SAN are bmc-<endpoint>.<domain>; the endpoint address, when an IP literal, is added as an IP SAN (clients often reach BMCs by IP address). |
duration | string | Duration of issued certificates. |
issuerRefrequired | object | IssuerRef names the cert-manager issuer (group cert-manager.io) that signs the identity. |
kind | string | The kind of the object.IssuerClusterIssuer |
namerequired | string | The name of the object. |
renewBefore | string | RenewBefore re-issues when less than this remains on the served certificate. Must stay below duration. |
subject | object | Subject carries the organizational attributes of the identity. The iBMC's on-manager CSR generation requires country; everything else is cosmetic. |
country | string | |
locality | string | |
organization | string | |
organizationalUnit | string | |
state | string |
An EndpointProfile has no status.
Reasons of Configured
Section titled “Reasons of Configured”The condition is on the ManagementEndpoint. It is absent when no profile selects the endpoint.
| Status | Reason | Meaning |
|---|---|---|
| True | InSync |
The BMC has the configuration of all lanes. |
| Unknown | AwaitingVerification |
A profile selects the endpoint, but the endpoint is not Verified. |
| False | ProfileConflict |
Two profiles on the same layer do not agree. |
| False | RotationFailed |
The operator could not set a password that works. The old password stays. |
| False | NTPFailed |
The operator could not set the time servers. |
| False | NoIdentityTransport |
The BMC has no method to replace its certificate. |
| False | AwaitingIssuance |
The certificate request has no signature yet. |
| False | IdentityPushed |
The certificate is on the BMC, and the BMC restarts. |
| False | IdentityPushHeld |
An operation runs on a machine of this BMC. The certificate waits for its end. |
| False | IdentityPushFailed |
The BMC does not use the certificate that the operator sent, or the issued certificate does not carry the key of the request. |
| False | AccountRetireFailed |
The account that a new username replaced still logs in. The operator tries again. |
| False | TLSNotVerified |
The BMC takes a private key (key-upload dialect), and insecureSkipVerify checks nothing. The operator makes no key. |
| False | TLSKeyNotPinned |
No key of the BMC is pinned yet. The observation of the endpoint pins it. |
Conditions and reasons has the full text of each reason.
Example
Section titled “Example”apiVersion: metal.platform-kit.org/v1alpha1kind: EndpointProfilemetadata: name: managed-bmcsspec: match: matchLabels: metal.platform-kit.org/vlan: "100" credentials: username: pk-metal maxAge: 2160h ntp: servers: ["ntp.example.org"] tls: issuerRef: name: internal-ca subject: country: XX organization: Example Org organizationalUnit: MetalThe labels that you can select are metal.platform-kit.org/vendor, metal.platform-kit.org/model and metal.platform-kit.org/vlan.
Apply a profile and examine the result
Section titled “Apply a profile and examine the result”-
Apply the profile.
Terminal window kubectl apply -f profile.yaml -
Make sure that the endpoints go to the phase Ready.
Terminal window $ kubectl get mepNAME ADDRESS VENDOR PHASE AGEasset-07 https://[2001:db8:0:100::14] Huawei Ready 3dasset-08 https://[2001:db8:0:100::15] Huawei Configuring 3d -
If an endpoint stays in Configuring, read the reason of
Configured.Terminal window kubectl describe mep asset-08