// Module included in the following assemblies:
//
// IPI
// * installing/installing_bare_metal/ipi/ipi-install-installation-workflow.adoc
// UPI
// * installing/installing_bare_metal/upi/installing-bare-metal-network-customizations.adoc
// * installing/installing_bare_metal/upi/installing-restricted-networks-bare-metal.adoc
// * installing/installing_bare_metal/upi/installing-bare-metal.adoc

:_mod-docs-content-type: PROCEDURE
[id="creating-scaling-machine-sets-compute-nodes-networking_{context}"]
= Scaling each machine set to compute nodes

[role="_abstract"]
To scale each machine set to compute nodes, you must apply a customized `br-ex` bridge configuration to all compute nodes in your {product-title} cluster. You must then edit your `MachineConfig` custom resource (CR) and modify its roles. 

Additionally, you must create a `BareMetalHost` CR that defines information for your bare-metal machine, such as hostname, credentials, and your other required parameters. After you configure these resources, you must scale machine sets, so that the machine sets can apply the resource configuration to each compute node and reboot the nodes.

.Prerequisites

* You created a `MachineConfig` manifest object that includes a customized `br-ex` bridge configuration.

.Procedure

. Edit the `MachineConfig` CR by entering the following command:
+
[source,terminal]
----
$ oc edit mc <machineconfig_custom_resource_name>
----

. Add each compute node configuration to the CR, so that the CR can manage roles for each defined compute node in your cluster.

. Create a `Secret` object named `extraworker-secret` that has a minimal static IP configuration.

. Apply the `extraworker-secret` secret to each node in your cluster by entering the following command. This step provides each compute node access to the Ignition config file.
+
[source,terminal]
----
$ oc apply -f ./extraworker-secret.yaml
----

. Create a `BareMetalHost` resource and specify the network secret in the `preprovisioningNetworkDataName` parameter:
+
.Example `BareMetalHost` resource with an attached network secret
[source,yaml]
----
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
spec:
# ...
  preprovisioningNetworkDataName: ostest-extraworker-0-network-config-secret
# ...
----

. To manage the `BareMetalHost` object within the `openshift-machine-api` namespace of your cluster, change to the namespace by entering the following command:
+
[source,terminal]
----
$ oc project openshift-machine-api
----

. Get the machine sets:
+
[source,terminal]
----
$ oc get machinesets
----

. Scale each machine set by entering the following command. You must run this command for each machine set.
+
[source,terminal]
----
$ oc scale machineset <machineset_name> --replicas=<n>
----
* <n>: Where `<machineset_name>` is the name of the machine set and `<n>` is the number of compute nodes.

