2장. Setting up the environment for an OpenShift Container Platform installation
2.1. Preparing the provisioner node on IBM Cloud® Bare Metal (Classic) infrastructure 링크 복사링크가 클립보드에 복사되었습니다!
Perform the following steps to prepare the provisioner node.
Procedure
-
Log in to the provisioner node via
ssh. Create a non-root user (
kni) and provide that user withsudoprivileges:# useradd kni# passwd kni# echo "kni ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/kni# chmod 0440 /etc/sudoers.d/kniCreate an
sshkey for the new user:# su - kni -c "ssh-keygen -f /home/kni/.ssh/id_rsa -N ''"Log in as the new user on the provisioner node:
# su - kniUse Red Hat Subscription Manager to register the provisioner node:
$ sudo subscription-manager register --username=<user> --password=<pass> --auto-attach$ sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms \ --enable=rhel-8-for-x86_64-baseos-rpms참고For more information about Red Hat Subscription Manager, see Registering a RHEL system with command-line tools.
Install the following packages:
$ sudo dnf install -y libvirt qemu-kvm mkisofs python3-devel jq ipmitoolModify the user to add the
libvirtgroup to the newly created user:$ sudo usermod --append --groups libvirt kniStart
firewalld:$ sudo systemctl start firewalldEnable
firewalld:$ sudo systemctl enable firewalldStart the
httpservice:$ sudo firewall-cmd --zone=public --add-service=http --permanent$ sudo firewall-cmd --reloadStart and enable the
libvirtdservice:$ sudo systemctl enable libvirtd --nowSet the ID of the provisioner node:
$ PRVN_HOST_ID=<ID>You can view the ID with the following
ibmcloudcommand:$ ibmcloud sl hardware listSet the ID of the public subnet:
$ PUBLICSUBNETID=<ID>You can view the ID with the following
ibmcloudcommand:$ ibmcloud sl subnet listSet the ID of the private subnet:
$ PRIVSUBNETID=<ID>You can view the ID with the following
ibmcloudcommand:$ ibmcloud sl subnet listSet the provisioner node public IP address:
$ PRVN_PUB_IP=$(ibmcloud sl hardware detail $PRVN_HOST_ID --output JSON | jq .primaryIpAddress -r)Set the CIDR for the public network:
$ PUBLICCIDR=$(ibmcloud sl subnet detail $PUBLICSUBNETID --output JSON | jq .cidr)Set the IP address and CIDR for the public network:
$ PUB_IP_CIDR=$PRVN_PUB_IP/$PUBLICCIDRSet the gateway for the public network:
$ PUB_GATEWAY=$(ibmcloud sl subnet detail $PUBLICSUBNETID --output JSON | jq .gateway -r)Set the private IP address of the provisioner node:
$ PRVN_PRIV_IP=$(ibmcloud sl hardware detail $PRVN_HOST_ID --output JSON | \ jq .primaryBackendIpAddress -r)Set the CIDR for the private network:
$ PRIVCIDR=$(ibmcloud sl subnet detail $PRIVSUBNETID --output JSON | jq .cidr)Set the IP address and CIDR for the private network:
$ PRIV_IP_CIDR=$PRVN_PRIV_IP/$PRIVCIDRSet the gateway for the private network:
$ PRIV_GATEWAY=$(ibmcloud sl subnet detail $PRIVSUBNETID --output JSON | jq .gateway -r)Set up the bridges for the
baremetalandprovisioningnetworks:$ sudo nohup bash -c " nmcli --get-values UUID con show | xargs -n 1 nmcli con delete nmcli connection add ifname provisioning type bridge con-name provisioning nmcli con add type bridge-slave ifname eth1 master provisioning nmcli connection add ifname baremetal type bridge con-name baremetal nmcli con add type bridge-slave ifname eth2 master baremetal nmcli connection modify baremetal ipv4.addresses $PUB_IP_CIDR ipv4.method manual ipv4.gateway $PUB_GATEWAY nmcli connection modify provisioning ipv4.addresses 172.22.0.1/24,$PRIV_IP_CIDR ipv4.method manual nmcli connection modify provisioning +ipv4.routes \"10.0.0.0/8 $PRIV_GATEWAY\" nmcli con down baremetal nmcli con up baremetal nmcli con down provisioning nmcli con up provisioning init 6 "참고For
eth1andeth2, substitute the appropriate interface name, as needed.If required, SSH back into the
provisionernode:# ssh kni@provisioner.<cluster-name>.<domain>Verify the connection bridges have been properly created:
$ sudo nmcli con showExample output
NAME UUID TYPE DEVICE baremetal 4d5133a5-8351-4bb9-bfd4-3af264801530 bridge baremetal provisioning 43942805-017f-4d7d-a2c2-7cb3324482ed bridge provisioning virbr0 d9bca40f-eee1-410b-8879-a2d4bb0465e7 bridge virbr0 bridge-slave-eth1 76a8ed50-c7e5-4999-b4f6-6d9014dd0812 ethernet eth1 bridge-slave-eth2 f31c3353-54b7-48de-893a-02d2b34c4736 ethernet eth2Create a
pull-secret.txtfile:$ vim pull-secret.txtIn a web browser, navigate to Install on Bare Metal with user-provisioned infrastructure. In step 1, click Download pull secret. Paste the contents into the
pull-secret.txtfile and save the contents in thekniuser’s home directory.