|
1 | 1 | # Openshift deployment with OAS - On Bare Metal
|
2 |
| -work in progress... |
| 2 | +This guide contains all the sections regarding Bare Metal deployment method, like iPXE/PXE, VirtualMedia, etc... let's get started |
| 3 | + |
| 4 | +## General |
| 5 | + |
| 6 | +This section is generic for the most of the cases: |
| 7 | + |
| 8 | +- DHCP/DNS running on the network you wanna deploy the OCP cluster. |
| 9 | +- Assisted Installer up & running (It's ok if you're working with cloud version). |
| 10 | +- Typical DNS entries for API VIP and Ingress VIP. |
| 11 | +- Pull Secret to reach the OCP Container Images. |
| 12 | +- SSH Key pair. |
| 13 | + |
| 14 | +_*Note*: This method could be used also in Virtual environment_ |
| 15 | + |
| 16 | +- With that we could start, first step is create the cluster |
| 17 | +- Fill the Cluster name and Pull Secret fields, also select the version you wanna deploy: |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +- Now fill the Base Domain field and the SSH Host Public Key |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +- Click on _Download Discovery ISO_ |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +- Fill again the SSH public key and click on _Generate Discovery ISO_ |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +- Wait for ISO generation to finish and you will reach this checkpoint |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +## iPXE |
| 40 | + |
| 41 | +iPXE deployment method |
| 42 | + |
| 43 | +*NOTE1*: We use a sample URL, please change to fit your use case accordingly |
| 44 | +*NOTE2*: We've set the live_url as the node hostname on 8080 port , please change to fit your use case accordingly |
| 45 | + |
| 46 | +### Automatic |
| 47 | + |
| 48 | +The automatic way is done using podman, just follow this steps: |
| 49 | + |
| 50 | +```shell |
| 51 | +export IPXE_DIR=/tmp/ipxe/ai |
| 52 | +mkdir -p ${IPXE_DIR} |
| 53 | + |
| 54 | +# This command will download the ISO, extract the Images and create the ignition config files |
| 55 | +podman run -e BASE_URL=http://devscripts2ipv6.e2e.bos.redhat.com:8080 -e ISO_URL=http://devscripts2ipv6.e2e.bos.redhat.com:6008/api/assisted-install/v1/clusters/33ffb056-ee65-4fee-91c9-f60e5ebea4a3/downloads/image -v /tmp/ipxe/ai:/data:Z --net=host -it --rm quay.io/ohadlevy/ai-ipxe |
| 56 | + |
| 57 | +# This command will host the iPXE files on an podman container |
| 58 | +podman run -v ${IPXE_DIR}:/app:ro -p 8080:8080 -d --rm bitnami/nginx:latest |
| 59 | +``` |
| 60 | + |
| 61 | +To ensure if your container is working fine, check the url with a `curl` command |
| 62 | + |
| 63 | +```shell |
| 64 | +curl http://$(hostname):8080/ipxe/ipxe |
| 65 | +``` |
| 66 | + |
| 67 | +### Manual |
| 68 | + |
| 69 | +The manual way is explained here. You need at least to have the Discovery ISO already generated |
| 70 | + |
| 71 | +Now let's download that ISO in the provisioning machine, where the iPXE files will be hosted (use the _Command to download the ISO_ button from the Assisted Service website |
| 72 | + |
| 73 | +```shell |
| 74 | +export IPXE_DIR=/tmp/ipxe/ai |
| 75 | +export IMAGE_PATH=/tmp/discovery_image_ocp.iso |
| 76 | + |
| 77 | +wget -O ${IMAGE_PATH} 'http://cloud.redhat.com/api/assisted-install/v1/clusters/<cluster_id>/downloads/image' |
| 78 | +``` |
| 79 | + |
| 80 | +- Now we need to create the folder and the _ipxe_ file definition |
| 81 | + |
| 82 | +```shell |
| 83 | +mkdir -p ${IPXE_DIR} |
| 84 | + |
| 85 | +cat > $IPXE_DIR/ipxe << EOF |
| 86 | +#!ipxe |
| 87 | +set live_url $(hostname):8080 |
| 88 | +kernel \${live_url}/vmlinuz ignition.config.url=\${live_url}/config.ign coreos.live.rootfs_url=\${live_url}/rootfs.img ${KERNEL_OPTS} |
| 89 | +initrd \${live_url}/initrd.img |
| 90 | +boot |
| 91 | +EOF |
| 92 | +``` |
| 93 | + |
| 94 | +- We also need to extract the images from the ISO |
| 95 | + |
| 96 | +```shell |
| 97 | +export PXE_IMAGES=`isoinfo -i $IMAGE_PATH -f | grep -i images/pxeboot` |
| 98 | + |
| 99 | +for img in $PXE_IMAGES; do |
| 100 | + export name=`basename ${img,,} | sed 's/\;1//' | sed 's/\.$//'` |
| 101 | + echo extracting $name |
| 102 | + isoinfo -i $IMAGE_PATH -x $img > $IPXE_DIR/$name |
| 103 | +done |
| 104 | +``` |
| 105 | + |
| 106 | +- And as a last step, write the Ignition files for the deployment |
| 107 | + |
| 108 | +```shell |
| 109 | +echo writing custom user ignition |
| 110 | +echo '{' > $IPXE_DIR/config.ign |
| 111 | +isoinfo -i $IMAGE_PATH -x '/IMAGES/IGNITION.IMG;1' | xz -dc - | sed '1d; $d' >> $IPXE_DIR/config.ign |
| 112 | +echo '}' >> $IPXE_DIR/config.ign |
| 113 | +``` |
| 114 | + |
| 115 | +- After the Ignition files creation we need to host the files, for that we will use a podman contianer based on nginx |
| 116 | + |
| 117 | +```shell |
| 118 | +podman run -v ${IPXE_DIR}:/app:ro -p 8080:8080 -d --rm bitnami/nginx:latest |
| 119 | +``` |
| 120 | + |
| 121 | +- To ensure if your container is working fine, check the url with a `curl` command |
| 122 | + |
| 123 | +```shell |
| 124 | +curl http://$(hostname):8080/ipxe/ipxe |
| 125 | +``` |
| 126 | + |
| 127 | +### Booting the nodes from iPXE |
| 128 | + |
| 129 | +- First step, we need to set up the boot mode on the iDrac's as `boot once` for iPXE, this will depend on the steps on every Bare Metal Manufacturer/Version/Hardware. |
| 130 | +- When you are booting the nodes, stay tuned to press `crtl-b` when the prompt say that: |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +- Now we need to get a correct IP and point to the right iPXE file |
| 135 | +- And we just need to wait until the boot was finished, and the nodes start appearing on the Assisted Service interface |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +- Then we will modify the nodename to use a right name for Openshift |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | +- Create another 2 more nodes and repeat this step |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +- Now fill the _API Virtual IP_ and _Ingress Virtual IP_ fields |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | +- Now you just need to click on _Install Cluster_ button and wait for the installation to finish. |
| 154 | + |
| 155 | + |
0 commit comments