Assigning a bootstrap VM an IP address on the baremetal network without a DHCP server
Updated
This procedure enables adding an IP address from the baremetal network to the bootstrap VM. Execute this procedure after the step of Creating the OpenShift Container Platform manifests.
Procedure
Step 1 - Generate the ignition configuration files, replacing <directory> with the installation directory path:
$ openshift-baremetal-install --dir <directory> create ignition-configs
Step 2 - Create environment variables with the desired network bootstrap configuration:
- Replace
<interface_name>with the name of the NIC (example: ens3). - Replace
<ip_address>/<CIDR>with the IP address and CIDR of the IP address for the boorstrap NIC (example: 10.0.0.2/32). - Replace
<gateway_IP_address>with the IP address of the gateway on thebaremetalnetwork (example: 10.0.0.254). - Replace
<dns_IP_address>with the IP address of the DNS server on thebaremetalnetwork (example: 10.0.0.1).
export BOOTSTRAP_NIC_NAME=<interface_name>
export BOOTSTRAP_CONFIG="[connection]
type=ethernet
interface-name=$BOOTSTRAP_NIC_NAME
[ethernet]
[ipv4]
method=manual
addresses=<ip_address>/<CIDR>
gateway=<gateway_IP_address>
dns=<dns_IP_address>"
Step 3 - Create the bootstrap configuration ignition file with the bootstrap network configuration:
$ cat > bootstrap_network_config.ign << EOF
{
"path": "/etc/NetworkManager/system-connections/${BOOTSTRAP_NIC_NAME}.nmconnection",
"mode": 384,
"contents": {
"source": "data:text/plain;charset=utf-8;base64,$(echo "${BOOTSTRAP_CONFIG}" | base64 -w 0)"
}
}
EOF
Step 4 - Rename the original generated bootstrap ignition file:
$ mv <directory>/bootstrap.ign <directory>/bootstrap.ign.orig
Step 5 - Merge the bootstrap_network_config.ign file with the bootstrap.ign file:
$ jq '.storage.files += $input' <directory>/bootstrap.ign.orig --slurpfile input bootstrap_network_config.ign > <directory>/bootstrap.ign
Step 6 - Continue with the creation of the cluster:
$ openshift-baremetal-install --dir <directory> create cluster
Product(s)
Category
Tags
Article Type