For the registry of the global cluster, run ac config use-cluster global, then ac -n cpaas-system get secret public-registry-credential -o jsonpath='{.data.registry}' | base64 -d.
An OS image tag is the file name of its OS archive without .tar, and the tag of both images of the archive.
ac -n cpaas-system patch configmap elemental-image-catalog --type merge --patch-file /dev/stdin <<'EOF'
{
"data": {
"v1.36.4-acp.3": "tkestack/baremetal-base-image:<os-image-tag-for-v4.5.0>",
"v1.36.4-acp.3_etcd": "acp/k8s/etcd:v3.6.13-acp.5"
}
}
EOF
ac -n cpaas-system get configmap elemental-image-catalog -o yaml
Registration file
alaudaos-m55-amd64.yaml
apiVersion: elemental.cattle.io/v1beta1
kind: MachineRegistration
metadata:
name: alaudaos-m55-amd64
namespace: cpaas-system
labels:
app.kubernetes.io/part-of: cluster-api-provider-baremetal
spec:
# ${...} placeholders are expanded by elemental-register from SMBIOS data.
machineName: "alaudaos-m55-amd64-${System Information/UUID}"
machineInventoryLabels:
app.kubernetes.io/part-of: cluster-api-provider-baremetal
pool.baremetal.alauda.io/eligible: "true"
elemental.cattle.io/serial-number: "${System Information/Serial Number}"
# Architecture of the host, reported by elemental-register. Keep the value as is.
os.baremetal.alauda.io/arch: "${Runtime/Architecture}"
# OS identifier of the image this registration installs.
os.baremetal.alauda.io/id: alaudaos.m.55
machineInventoryAnnotations:
elemental.cattle.io/machine-uuid: "${System Information/UUID}"
config:
elemental:
install:
# Each host reports its disks and waits until you select its system disk.
device-selection: inventory
eject-cd: true
reboot: true
snapshotter:
type: btrfs
maxSnaps: 4
registration:
# Each host uses its hardware TPM when usable, otherwise an emulated one.
tpm-mode: auto
emulated-tpm-seed: -1
---
apiVersion: elemental.cattle.io/v1beta1
kind: SeedImage
metadata:
name: alaudaos-m55-amd64-iso
namespace: cpaas-system
labels:
app.kubernetes.io/part-of: cluster-api-provider-baremetal
spec:
type: iso
baseImage: <registry-address>/tkestack/baremetal-base-image-iso:<os-image-tag-for-v4.5.0>
registrationRef:
apiVersion: elemental.cattle.io/v1beta1
kind: MachineRegistration
name: alaudaos-m55-amd64
namespace: cpaas-system
targetPlatform: linux/amd64
size: 20Gi
cleanupAfterMinutes: 120
cloud-config:
stages:
boot:
- name: "Size COS_STATE for reprovisioning"
files:
- path: /etc/elemental/config.d/partitions.yaml
permissions: 0644
content: |
install:
partitions:
state:
size: 20480
Create the registration and build the ISO
alaudaos-m55-amd64
ac config use-cluster global
ac apply -f alaudaos-m55-amd64.yaml
ac -n cpaas-system wait --for=condition=SeedImageReady=True \
seedimage/alaudaos-m55-amd64-iso --timeout=30m
ac -n cpaas-system get seedimage alaudaos-m55-amd64-iso \
-o jsonpath='{.status.conditions[?(@.type=="SeedImageReady")].reason}{"\n"}{.status.downloadURL}{"\n"}{.status.checksumURL}{"\n"}'