Create a Cluster on Bare Metal
ACP CLI (ac) renders the cluster objects from one install-config.yaml and applies them to the global cluster. The Bare Metal provider then builds the cluster from the hosts in your pools. First, collect available hosts into one MachineInventoryPool for each node group, because ac does not register hosts or create pools. All objects are in the cpaas-system namespace of the global cluster.
TOC
PrerequisitesProcedure1. Create the PoolsPool Capacity2. Writeinstall-config.yaml3. Create the Cluster4. Monitor the Creation5. Verify the ClusterHosts and PoolsSelf-built VIPExternal Load BalancerRun create AgainNext StepsPrerequisites
- You meet the Bare Metal prerequisites.
- Enough available hosts of the cluster's OS: one host for each node, that is,
controlPlane.replicasplus thereplicasof every node group incomputes. - The image catalog has a key for the Kubernetes version of the
globalcluster, for the architecture and OS of these hosts; see Add the Image Catalog Keys. acis logged in to the platform as a platform administrator (ac login https://<platform-address> --name <session-name>).- You have chosen the cluster name. It must not be
globalor start withglobal-. Use it as the prefix of the pool names.
Procedure
1. Create the Pools
List the available hosts with the command on that page, and pick the hosts of each node group from them. All hosts of a cluster run the same OS. Alauda OS M55 hosts are amd64. An Alauda OS KU cluster can mix amd64 and arm64 hosts, even within one pool.
Create one pool for the control plane and one pool for each worker node group. Two node groups cannot share a pool, and a MachineInventory must not appear in two active pools.
clusterName: the workload cluster this pool serves.name: the exactMachineInventoryname.hostname: optional. The host gets this name each time it is reinstalled. Defaults to the inventory name.
Continue when each pool shows READY True and its TOTAL equals the number of inventories that it lists. Otherwise, read the MembersValid condition of the pool, and see Provider Conditions.
Give each pool at least as many hosts as the replicas of its node group, because an upgrade replaces each node with a host from the same pool.
Pool Capacity
status.available must be at least the target replica count. To add capacity, register more hosts as described in Register Hosts, and add the names of the available hosts to spec.machineInventories.
2. Write install-config.yaml
Create an installation directory for the cluster and write install-config.yaml in it. ac writes manifests/ and logs/ac.log into the same directory.
Copy the following template and fill in the placeholders. The numbered lines are specific to Bare Metal, and the table below the template describes them. For the other fields, see Common install-config.yaml Fields. For the objects that ac renders from this file, see Rendered Manifests.
On Bare Metal, a node group takes only replicas and baremetal.machineInventoryPool, because the hosts determine the size, network, and disks of every node. If you set cpuCore, memoryGiB, network, disks, or hosts in a node group, or set provider.baremetal or credentialRef, you get an error that names the field.
You do not set the Kubernetes version. The cluster gets the version of the global cluster.
3. Create the Cluster
Run the following command from a machine where ac is logged in to the platform:
ac first checks the provider CRDs on the global cluster, the pools and their size, and the registry. If a check fails, nothing is changed, and the error names the failed item. Make sure that each pool has enough Available inventories; see Pool Capacity.
create returns as soon as the objects are applied, and the cluster continues to build after that. To wait until all stages are ready, add --wait. --timeout (default 2h) limits only the wait. To render the objects without applying them, run ac adm alpha cluster manifests with the same flags.
4. Monitor the Creation
Continue when all four stages are ready; otherwise see Troubleshooting.
5. Verify the Cluster
Run the following commands from a machine where ac is logged in to the platform:
Continue when every node is Ready; otherwise see Troubleshooting.
Hosts and Pools
Continue when every BaremetalMachine reports Running and each pool shows READY True; otherwise see Provider Conditions.
Self-built VIP
Applies to: type: internal. Skip it for an external load balancer.
Continue when an Alive Pod is Running on each control plane node; otherwise see Provider Conditions.
Log in to a control plane node of the cluster as the boot user (ssh boot@<control-plane-node-ip>). Use the private key that matches an SSH public key in cluster.sshKeys. Run curl with sudo, because only root can read the cluster CA file:
Continue when it prints ok; otherwise see Provider Conditions.
External Load Balancer
Applies to: type: external. Skip it for a Self-built VIP.
On the load balancer, check the frontend and every backend against the External Load Balancer requirements. Continue when every current control plane node is registered as a backend and HTTPS /healthz returns HTTP 200 on each backend. Otherwise, fix the load balancer configuration.
Run create Again
create only creates a cluster. Do not run it on a cluster that already exists. To change a running cluster, see Manage Nodes.
If create stops before the cluster is created, run the same command again. It skips the work that is already done. When you run create again on the same directory:
- It recreates objects that were deleted. Secrets are the exception:
accreates them once and then leaves them as they are. - It does not overwrite a field that another tool changed. When the rendered value differs,
createreports that the fields are owned by another manager and stops. Do not delete the object that the error names. - When
manifests/already exists,createasks whether to reuse it. Press Enter to reuse it, or answernto render again after you changeinstall-config.yaml. When standard input is not a terminal, pass--reuse-manifests=trueor--reuse-manifests=false. Reusingmanifests/ignoresinstall-config.yamland skips every check.
Do not edit the files in manifests/.
Keep <install-dir>/manifests/, or set cluster.encryptionProviderConfig. A generated encryption key is stored only in manifests/. If you render again without either of them, a new key is generated, and manifests/ no longer records the key that the cluster uses.