- Install CentOS8/RHEL8 on the assisted installer host1
- This host will run minikube and the UI for deploying OpenShift on Bare Metal
- Setup DHCP/DNS records for the following OpenShift nodes and VIPs. List includes
- Ensure these values are properly set via nslookup and dig commands from your assisted installer host
- Download your Pull Secret from https://cloud.redhat.com/openshift/install/metal/user-provisioned
Procedure
As $USER
user with sudo privileges ,
-
Generate an SSH key if not already available (
ssh_key/key
)[$USER@assisted_installer ~]# ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ''
-
Install git and make on your CentOS assisted installer host if not already present
[$USER@assisted_installer ~]# dnf install -y make git
-
Create a directory under
~/
labeledassisted-installer
andgit clone
thetest-infra
git repository[$USER@assisted_installer ~]# mkdir ~/assisted-installer [$USER@assisted installer assisted-installer]# cd ~/assisted-installer/ [$USER@assisted_installer assisted-installer]# git clone https://github.com/openshift/assisted-test-infra [$USER@assisted_installer assisted-installer]# cd assisted-test-infra
-
Setup the assisted installer's environment by running the
install_environment.sh
script[$USER@assisted_installer assisted-test-infra]# ./scripts/install_environment.sh
-
Once complete, run the
create_full_environment
usingmake
[$USER@assisted_installer assisted-test-infra]# make create_full_environment
-
(Optional) Currently the Installer defaults to deploying OpenShift 4.5. If you wish to change this value, set
OPENSHIFT_VERSION
to a different value, e.g. 4.6[$USER@assisted_installer assisted-test-infra]# export OPENSHIFT_VERSION=4.6
-
Once complete, run the "run" using make that creates the bm-inventory and deploys the UI
[$USER@assisted_installer assisted-test-infra]# make run . . . deploy_ui.sh: OCP METAL UI can be reached at http://<host-ip>:6008 deploy_ui.sh: Done
-
Once the UI has finished deploying, on a browser, access it via your host's IP and use port 6008, URL will be something like
http://<host-ip>:6008
-
Within the browser, select the
Create New Cluster
blue button -
A popup window labeled
New Bare Metal OpenShift Cluster
opens and requests a Cluster Name and OpenShift Version. Enter an appropriate Cluster Name.NOTE: The OpenShift Version selected is the value assigned to
OPENSHIFT_VERSION
(defaults to 4.5) -
On the next screen, enter the Base DNS Domain, Pull Secret, and SSH Public Key. Once complete, click on the button Validate & Save Changes.
- The Base DNS Domain would be something like example.com.
- The pull secret would be the file contents you captured as a prerequisite.
- The SSH public key would be the file contents of
~/.ssh/id_rsa.pub
NOTE: This screen also shows Available subnets, API Virtual IP and Ingress VIP VIP but these do not need to be set at this time of the install.
NOTE: If you get
Value must be valid JSON
for your pull secret, make sure you are not surrounding your pull secret in tick marks' '
NOTE: Make sure to delete any extra whitespaces when entering your pull secret and SSH key.
-
Once Validate & Save Changes has been clicked, click on the blue button labeled Download discovery ISO , and enter the HTTP Proxy URL (if required) and SSH public key using the host that is serving out the assisted installer UI. Click Download Discovery ISO. This will prepare the ISO and start the download
NOTE: If you wish not to download the ISO on your current system but on a separate system, after you've initiated the download by clicking the button, you can cancel the download and run the following wget command.
NOTE: This example installs ISO on the assisted installer host that will serve out the ISO via HTTP for the OpenShift cluster nodes.
[$USER@assisted_installer ~]# mkdir ~/assisted-installer/images [$USER@assisted_installer ~]# wget http://$(hostname):6008/api/assisted-install/v1/clusters/<cluster-id>/downloads/image -O ~/assisted-installer/images/live.iso
NOTE: When the ISO starts the initial download the cluster ID will show up on your browser address bar. Use that value and replace
<cluster-id>
with it. -
The next step uses Juan Parrilla's git repository for simplicity to do the following:
- Create a
podman
container that will setupiDRAC
on DELL servers to boot from ISO
NOTE: Steps 14-18 only work on DELL hardware. A different method would need to be used if using a different vendor to mount your live ISO.
- Create a
-
Create a webserver container labeled mywebserver that is to serve the
live.iso
from the~/assisted-installer/images
directory serving out of port 8080 as follows[$USER@assisted_installer ~]# firewall-cmd --add-port=8080/tcp --zone=public --permanent [$USER@assisted_installer ~]# firewall-cmd --reload [$USER@assisted_installer ~]# podman run -d --name mywebserver -v ~assisted-installer/images/:/var/www/html:Z -p 8080:8080/tcp registry.centos.org/centos/httpd-24-centos7:latest
NOTE: Verify you can access the live.iso link as such http://:8080/live.iso
-
Clone the repository as follows
~~~sh [$USER@assisted_installer ~]# cd ~/assisted-installer [$USER@assisted_installer assisted-installer]# git clone https://github.com/jparrill/racadm-image.git ~~~
-
Change into the
racadm-image
directory and build the Dockerfile usingpodman
. This will create an podman container that will be used to mount the live.iso to your baremetal nodes via iDRAC.[$USER@assisted_installer assisted-installer]# cd racadm-image [$USER@assisted_installer racadm-image]# podman build . -t idracbootfromiso
NOTE: Ignore any errors and just ensure your
idracbootfromiso
image is created and exists under the command podman images. If it failed, please attempt to re-run the command above. -
With the
idracbootfromiso
image created, we will now use it to mount thelive.iso
on all of our OpenShift nodes. For simplicity, this example shows 3 servers (3 masters, 0 workers) but can be extended to X number of servers requiring thelive.iso
[$USER@assisted_installer ~]# for i in <master0-idrac-ip> <master1-idrac-ip> <master2-idrac-ip>; do podman run --net=host idracbootfromiso -r $i -u <idrac-user> -p "<idrac-pw>" -i http:// <host-ip>:8080/live.iso; done
NOTE1: Ensure to include the proper host iDRAC IPs, iDRAC user and iDRAC password. This for loop assumes iDRAC user and iDRAC password are the same, if different adjust the shell command accordingly.
NOTE2: Also make sure to remove/eject the older ISO which were mounted using
racadm
command as shown belowsshpass -p '*****' ssh root@<iDRAC-IP> racadm remoteimage -d
-
The
live.iso
should reboot the nodes and boot them into a Fedora Live image. Once it has done this, shortly you will notice the nodes becoming discoverable for your cluster via thehttp://<host-ip>:6008/clusters/<cluster-id>
dashboard. -
Once the nodes are now available on the dashboard, select the appropriate role for each OpenShift cluster node.
-
Enter the API Virtual VIP that you assigned via DNS.
-
Enter the Ingress VIP that you assigned via DNS.
NOTE: More Network Configuration changes can be made such as changing Cluster Network CIDR, Cluster Network Host Prefix, Service Network CIDR if you change the Network Configuration from Basic to Advanced.
-
Click the Validate & Save Changes button.
-
The blue button to Install Cluster should now be made available. Select it.
-
Wait for the installation to complete.
-
Once the installation completes, copy download the
kubeconfig
file and copy it to your host running the assisted service UI or a system that has theoc
binary installed. -
Export the kubeconfig
[$USER@assisted_installer ~]# export KUBECONFIG=/path/to/kubeconfig
-
Verify everything is running as expected with your install
[$USER@assisted_installer ~]# oc get nodes [$USER@assisted_installer ~]# oc get co [$USER@assisted_installer ~]# oc get pods --all-namespaces | grep -iv running | grep -iv complete
NOTE: Currently there is an issue with the metal3 pod. The Assisted Installer team is aware of this.
1 It can also be a VM running CentOS8 or RHEL8 and able to do `nested` virtualization as it will run minikube inside. VM should have NICs for connecting to the hosts being installed over bridges at the physical host. [↩](#a1)