Day 1
Install the operator
Run the operator in a management cluster, with the values of your site.
Before you start
Section titled “Before you start”- You have a clone of the repository, and mise with the pinned tools (
mise trust, thenmise install). - You have Docker Engine on the workstation. The image build uses it.
- You have a Kubernetes cluster for the operator, or you make one with kind in step 3. The operator is tested on Kubernetes 1.36. See Versions.
- You know the address at which the BMCs reach the cluster. See row 2 of Network checklist.
-
Build the command-line tool and the manager.
Terminal window mise run buildThe tool is
metal/bin/pk-metal. Put it on yourPATH. -
Build the operator image. The last line of the output is the image reference.
Terminal window mise run imagepk-metal:4f0c2d1a9b3eThe tag is the commit of your clone. A changed work tree gets a different tag.
Management cluster
Section titled “Management cluster”Use one of the two paths.
-
kind on a workstation. Copy
lab/kind.yamltokind.yaml. SetlistenAddressto the address of the workstation on the BMC network. Keep the cluster name and the node image.Terminal window kind create cluster --config kind.yamlkind load docker-image pk-metal:4f0c2d1a9b3e --name pk-metalThe file publishes port 30443 of the workstation. The BMCs get boot media from that port.
-
An existing cluster. Build the image with the name of your registry, and push it.
Terminal window PK_IMAGE_NAME=registry.example.org/platform/pk-metal mise run imagedocker push registry.example.org/platform/pk-metal:4f0c2d1a9b3eThe BMCs must reach NodePort 30443 on a node of the cluster.
Site overlay
Section titled “Site overlay”The overlay is a kustomize directory. It adds the values of your site to the base in metal/config/default.
-
Copy the sample overlay.
Terminal window cp -r metal/config/samples/site-overlay overlays/site -
In
overlays/site/kustomization.yaml, correct the path of the base. Fromoverlays/sitein the repository root, it is../../metal/config/default. -
In the same file, set
images:newNameandnewTagfrom the image reference of step 2 or step 4. -
In
manager_args.yaml, set--media-urltohttps://<address>:30443. The address is the one that the BMCs reach. -
In
ledger.yaml, write one line for each BMC that you know now. You can add lines later. See Enroll hosts. -
In
bindings.yaml, replace the example group of the approvers with a group of your site. See The admin group and the approvers. -
Replace
bmc-ca.crtwith the CA certificate of your BMCs. See BMC certificates. -
If a BMC has only one usable media slot, remove the comment marks from
componentsinkustomization.yaml. See One-slot BMCs. -
In
networkpolicy.yaml, set the CIDR of your BMC network. Only that network can fetch boot media. Until you set it, each mount fails with a connection error. Behind SNAT, add the node network too. See Media store › Network policy.
-
Show what the overlay makes. Read the Deployment at the end.
Terminal window kubectl kustomize overlays/site | less -
Apply the overlay. Server-side apply is necessary, because the CRDs are large.
Terminal window kubectl apply --server-side -k overlays/site -
Wait for the manager.
Terminal window kubectl -n pk-metal rollout status deployment/pk-metal-manager --timeout=180s
The files of the overlay
Section titled “The files of the overlay”| File | What it sets | Reference |
|---|---|---|
kustomization.yaml |
The base, the image, the ledger ConfigMap, the CA Secret, the optional media store | Manager |
manager_args.yaml |
The flags --media-url and --bmc-ca-secret |
Flags |
ledger.yaml |
BMC MAC address to BMC URL | Ledger |
bmc-ca.crt |
The CA of the BMC certificates | BMC certificates |
bindings.yaml |
The rights of the admin group and of the approvers | RBAC |
approval.yaml |
Whether a person can approve their own proposal (selfApproval) |
Set up approval permissions |
networkpolicy.yaml |
The BMC network, the only one that can fetch boot media | Media store › Network policy |
The ledger ConfigMap has a name that changes with its content. Thus an apply of a new ledger restarts the manager.
BMC certificates
Section titled “BMC certificates”The manager checks the HTTPS certificate of each BMC. It checks the signature against the CA in the Secret bmc-ca. It checks the name or address against the URL in the ledger.
A BMC from the factory usually has a self-signed certificate. The CA check refuses it, and the endpoint shows Unreachable.
Without --bmc-ca-secret, the manager pins the key of each BMC on first use instead. See Trust the BMC certificate.
pk-metal check --insecure does not make this check. A BMC that passes the check can still fail in the manager.
-
Show the certificate that a BMC sends.
Terminal window openssl s_client -connect 192.0.2.21:443 </dev/null 2>/dev/null \| openssl x509 -noout -subject -issuer -ext subjectAltName -
Select one of the paths in the table.
| Path | What you do | State |
|---|---|---|
| Certificates from your CA | Give each BMC a certificate from your CA. Its subject alternative name is the address or name of the ledger URL. Put the CA certificate into bmc-ca.crt. |
The recommended path. |
| Key pinned on first use | Remove --bmc-ca-secret=bmc-ca from manager_args.yaml. The manager trusts the key that each BMC shows at the first contact. It refuses a different key until a person approves it. Enroll on a BMC network that you control. |
Tested with simulated BMCs only. |
| Certificates from cert-manager | Let the operator put a certificate on each BMC. See the tls lane of EndpointProfile. The first connection needs one of the other paths, for example the key pin. |
Tested with simulated BMCs only. |
| Factory certificates | Put the certificate of each BMC into bmc-ca.crt. This works only if each certificate has the address of the ledger URL as a subject alternative name. |
Not tested on real hardware. |
| No check | Replace --bmc-ca-secret=bmc-ca with --bmc-insecure in manager_args.yaml. |
For a lab with simulated BMCs only. |
The admin group and the approvers
Section titled “The admin group and the approvers”Two groups of persons have special rights. A ClusterRoleBinding gives rights to a group. It does not make a person a member.
The API server gets the groups of a person from the login. The source is the O= fields of a client certificate, or a claim of your identity provider.
| Group | What only its members can do | Default name |
|---|---|---|
| Admin group | Apply a HostClaim that installs a node, set automatic approval, move a claim to a different machine | pk-metal:admins |
| Approvers | Approve an operation or a rollout. Also their own proposal, if selfApproval is Allowed. |
No default. bindings.yaml binds a group to the role pk-metal-approver. |
- The admission policies ask for the admin group by name. A cluster admin is not a member.
- The name of the admin group is in the ConfigMap
hostoperation-approval, keyadminGroup. - RBAC and Admission policies have the rules. Set up approval permissions helps you choose the groups and the setting.
On a kind cluster for a test, you can act as a member with impersonation. The kind admin has the right to do that.
kubectl apply --as="$USER" --as-group=pk-metal:admins --as-group=system:authenticated -f claim.yamlOne-slot BMCs
Section titled “One-slot BMCs”A BMC with one usable media slot gets one install image with the machine config inside. The manager keeps these images in the media store.
- Check a BMC shows how to count the slots of a BMC.
- The component
metal/config/media-storeadds a claim for a 10 GiB volume. The cluster needs a storage class. kind has one. - The manager builds the image in a Job. The cluster must pull
ghcr.io/siderolabs/imager, or a mirror that you set with--imager-repository. - The images hold the machine config, which has secrets. Use storage with encryption if your Secrets are encrypted.
Without the media store, the install of such a machine waits with the reason BuilderUnavailable. See One-slot BMC.
Verify
Section titled “Verify”kubectl -n pk-metal get podsThe pod pk-metal-manager-... is Running and 1/1.
kubectl -n pk-metal get deployment pk-metal-manager -o jsonpath='{..image}{"\n"}'pk-metal versionThe first line shows the image. The second line shows the version of the tool. Both show the same tag when you built them from one commit.
If it fails
Section titled “If it fails”| What you see | Cause | Do this |
|---|---|---|
Pod ImagePullBackOff |
The cluster cannot pull the image. | kind: do kind load docker-image again. Registry: push the image, and make sure that images names it. |
Pod ErrImagePull for pk-metal:unset |
The overlay has no images entry. |
Do step 7. |
kubectl apply says metadata.annotations: Too long |
The apply was not server-side. | Use --server-side. |
Pod CrashLoopBackOff |
A flag is wrong. | Read the log: kubectl -n pk-metal logs deployment/pk-metal-manager. Each message names the fix. |
Endpoints show Unreachable after you enroll the hosts |
The BMC certificate does not pass the check, or a firewall blocks the path. | BMC certificates, then BMC unreachable |
The API server refuses a claim: only an admin ... may name the TalosNode |
You are not in the admin group. | The admin group and the approvers |
Related
Section titled “Related”- Manager has all flags.
- Network checklist has the ports.
- Enroll hosts is the next task.
- Architecture shows what the operator talks to.