Deploy a machine to a specific bare metal host¶
A Kubernetes machine requires a dedicated bare metal host for deployment.
The bare metal hosts are represented by the
in Kubernetes API. All
BareMetalHost objects are labeled by the Operator
when created. A label reflects the hardware capabilities of a host.
As a result of labeling, all bare metal hosts are divided into three types:
In some cases, you may need to deploy a machine to a specific bare metal host. This is especially useful when some of your bare metal hosts have different hardware configuration than the rest.
To deploy a machine to a specific bare metal host:
Log in to the host where your management cluster
kubeconfigis located and where kubectl is installed.
Identify the bare metal host that you want to associate with the specific machine. For example, host
kubectl get baremetalhost host-1 -o yaml
Add a label that will uniquely identify this host, for example, by the name of the host and machine that you want to deploy on it.
Do not remove any existing labels from the
BareMetalHostresource. For more details about labels, see BareMetalHost.
kubectl edit baremetalhost host-1
kind: BareMetalHost metadata: name: host-1 namespace: myProjectName labels: kaas.mirantis.com/baremetalhost-id: host-1-worker-HW11-cad5 ...
Create a new text file with the YAML definition of the
Machineobject, as defined in Machine.
Ubuntu 20.04 is used by default for greenfield deployments.
Add a label selector that matches the label you have added to the
BareMetalHostobject in the previous step.
kind: Machine metadata: name: worker-HW11-cad5 namespace: myProjectName spec: ... providerSpec: value: apiVersion: baremetal.k8s.io/v1alpha1 kind: BareMetalMachineProviderSpec ... hostSelector: matchLabels: kaas.mirantis.com/baremetalhost-id: host-1-worker-HW11-cad5 ...
Specify the details of the machine configuration in the object created in the previous step. For example:
Add a reference to a custom
BareMetalHostProfileobject, as defined in Machine.
Specify an override for the ordering and naming of the NICs for the machine. For details, see Override network interfaces naming and order.
If you use a specific L2 template for the machine, set the unique name or label of the corresponding L2 template in the
L2templateSelectorsection of the
Add the configured machine to the cluster:
kubectl create -f worker-HW11-cad5.yaml
Once done, this machine will be associated with the specified bare metal host.
The required minimum number of machines:
3 manager nodes for HA
3 worker storage nodes for a minimal Ceph cluster