|
| 1 | +// This module is included in the following assemblies: |
| 2 | +// |
| 3 | +// installing_sno/install-sno-installing-sno.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="setting-up-bastion-for-sno_{context}"] |
| 7 | += Setting up basion for {sno} with {ibmpowerProductName} |
| 8 | + |
| 9 | +Prior to installing {sno} on {ibmpowerProductName}, you must set up bastion. Setting up a bastion server for {sno} on {ibmpowerProductName} requires the configuration of the following services: |
| 10 | + |
| 11 | +* PXE is used for the {sno} cluster installation. PXE requires the following services to be configured and run: |
| 12 | +** DNS to define api, api-int, and *.apps |
| 13 | +** DHCP service to enable PXE and assign an IP address to {sno} node |
| 14 | +** HTTP to provide ignition and {op-system} rootfs image |
| 15 | +** TFTP to enable PXE |
| 16 | +* You must install `dnsmasq` to support DNS, DHCP and PXE, httpd for HTTP. |
| 17 | +
|
| 18 | +Use the following procedure to configure a bastion server that meets these requirements. |
| 19 | + |
| 20 | +.Procedure |
| 21 | + |
| 22 | +. Use the following command to install `grub2`, which is required to enable PXE for PowerVM: |
| 23 | ++ |
| 24 | +[source,terminal] |
| 25 | +---- |
| 26 | +grub2-mknetdir --net-directory=/var/lib/tftpboot |
| 27 | +---- |
| 28 | ++ |
| 29 | +.Example `/var/lib/tftpboot/boot/grub2/grub.cfg` file |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +default=0 |
| 33 | +fallback=1 |
| 34 | +timeout=1 |
| 35 | +if [ ${net_default_mac} == fa:b0:45:27:43:20 ]; then |
| 36 | +menuentry "CoreOS (BIOS)" { |
| 37 | + echo "Loading kernel" |
| 38 | + linux "/rhcos/kernel" ip=dhcp rd.neednet=1 ignition.platform.id=metal ignition.firstboot coreos.live.rootfs_url=http://192.168.10.5:8000/install/rootfs.img ignition.config.url=http://192.168.10.5:8000/ignition/sno.ign |
| 39 | + echo "Loading initrd" |
| 40 | + initrd "/rhcos/initramfs.img" |
| 41 | +} |
| 42 | +fi |
| 43 | +---- |
| 44 | + |
| 45 | +. Use the following commands to download {op-system} image files from the mirror repo for PXE. |
| 46 | + |
| 47 | +.. Enter the following command to assign the `RHCOS_URL` variable the follow 4.12 URL: |
| 48 | ++ |
| 49 | +[source,terminal] |
| 50 | +---- |
| 51 | +$ export RHCOS_URL=https://mirror.openshift.com/pub/openshift-v4/ppc64le/dependencies/rhcos/4.12/latest/ |
| 52 | +---- |
| 53 | + |
| 54 | +.. Enter the following command to navigate to the `/var/lib/tftpboot/rhcos` directory: |
| 55 | ++ |
| 56 | +[source,terminal] |
| 57 | +---- |
| 58 | +$ cd /var/lib/tftpboot/rhcos |
| 59 | +---- |
| 60 | + |
| 61 | +.. Enter the following command to download the specified {op-system} kernel file from the URL stored in the `RHCOS_URL` variable: |
| 62 | ++ |
| 63 | +[source,terminal] |
| 64 | +---- |
| 65 | +$ wget ${RHCOS_URL}/rhcos-live-kernel-ppc64le -o kernel |
| 66 | +---- |
| 67 | + |
| 68 | +.. Enter the following command to download the {op-system} `initramfs` file from the URL stored in the `RHCOS_URL` variable: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ wget ${RHCOS_URL}/rhcos-live-initramfs.ppc64le.img -o initramfs.img |
| 73 | +---- |
| 74 | + |
| 75 | +.. Enter the following command to navigate to the `/var//var/www/html/install/` directory: |
| 76 | ++ |
| 77 | +[source,terminal] |
| 78 | +---- |
| 79 | +$ cd /var//var/www/html/install/ |
| 80 | +---- |
| 81 | + |
| 82 | +.. Enter the following command to download, and save, the {op-system} `root filesystem` image file from the URL stored in the `RHCOS_URL` variable: |
| 83 | ++ |
| 84 | +[source,terminal] |
| 85 | +---- |
| 86 | +$ wget ${RHCOS_URL}/rhcos-live-rootfs.ppc64le.img -o rootfs.img |
| 87 | +---- |
| 88 | + |
| 89 | +. To create the ignition file for a {sno} cluster, you must create the `install-config.yaml` file. |
| 90 | + |
| 91 | +.. Enter the following command to create the work directory that holds the file: |
| 92 | ++ |
| 93 | +[source,terminal] |
| 94 | +---- |
| 95 | +$ mkdir -p ~/sno-work |
| 96 | +---- |
| 97 | + |
| 98 | +.. Enter the following command to navigate to the `~/sno-work` directory: |
| 99 | ++ |
| 100 | +[source,terminal] |
| 101 | +---- |
| 102 | +$ cd ~/sno-work |
| 103 | +---- |
| 104 | + |
| 105 | +.. Use the following sample file can to create the required `install-config.yaml` in the `~/sno-work` directory: |
| 106 | ++ |
| 107 | +[source,yaml] |
| 108 | +---- |
| 109 | +apiVersion: v1 |
| 110 | +baseDomain: <domain> <1> |
| 111 | +compute: |
| 112 | +- name: worker |
| 113 | + replicas: 0 <2> |
| 114 | +controlPlane: |
| 115 | + name: master |
| 116 | + replicas: 1 <3> |
| 117 | +metadata: |
| 118 | + name: <name> <4> |
| 119 | +networking: <5> |
| 120 | + clusterNetwork: |
| 121 | + - cidr: 10.128.0.0/14 |
| 122 | + hostPrefix: 23 |
| 123 | + machineNetwork: |
| 124 | + - cidr: 10.0.0.0/16 <6> |
| 125 | + networkType: OVNKubernetes |
| 126 | + serviceNetwork: |
| 127 | + - 172.30.0.0/16 |
| 128 | +platform: |
| 129 | + none: {} |
| 130 | +bootstrapInPlace: |
| 131 | + installationDisk: /dev/disk/by-id/<disk_id> <7> |
| 132 | +pullSecret: '<pull_secret>' <8> |
| 133 | +sshKey: | |
| 134 | + <ssh_key> <9> |
| 135 | +---- |
| 136 | +<1> Add the cluster domain name. |
| 137 | +<2> Set the `compute` replicas to `0`. This makes the control plane node schedulable. |
| 138 | +<3> Set the `controlPlane` replicas to `1`. In conjunction with the previous `compute` setting, this setting ensures that the cluster runs on a single node. |
| 139 | +<4> Set the `metadata` name to the cluster name. |
| 140 | +<5> Set the `networking` details. OVN-Kubernetes is the only allowed network plugin type for single-node clusters. |
| 141 | +<6> Set the `cidr` value to match the subnet of the {sno} cluster. |
| 142 | +<7> Set the path to the installation disk drive, for example, `/dev/disk/by-id/wwn-0x64cd98f04fde100024684cf3034da5c2`. |
| 143 | +<8> Copy the {cluster-manager-url-pull} and add the contents to this configuration setting. |
| 144 | +<9> Add the public SSH key from the administration host so that you can log in to the cluster after installation. |
| 145 | + |
| 146 | +. Download the `openshift-install` image to create the ignition file and copy it to the `http` directory. |
| 147 | + |
| 148 | +.. Enter the following command to download the `openshift-install-linux-4.12.0` .tar file: |
| 149 | ++ |
| 150 | +[source,terminal] |
| 151 | +---- |
| 152 | +$ wget https://mirror.openshift.com/pub/openshift-v4/ppc64le/clients/ocp/4.12.0/openshift-install-linux-4.12.0.tar.gz |
| 153 | +---- |
| 154 | + |
| 155 | +.. Enter the following command to unpack the `openshift-install-linux-4.12.0.tar.gz` archive: |
| 156 | ++ |
| 157 | +[source,terminal] |
| 158 | +---- |
| 159 | +$ tar xzvf openshift-install-linux-4.12.0.tar.gz |
| 160 | +---- |
| 161 | + |
| 162 | +.. Enter the following command to |
| 163 | ++ |
| 164 | +[source,terminal] |
| 165 | +---- |
| 166 | +$ ./openshift-install --dir=~/sno-work create create single-node-ignition-config |
| 167 | +---- |
| 168 | + |
| 169 | +.. Enter the following command to create the ignition file: |
| 170 | ++ |
| 171 | +[source,terminal] |
| 172 | +---- |
| 173 | +$ cp ~/sno-work/single-node-ignition-config.ign /var/www/html/ignition/sno.ign |
| 174 | +---- |
| 175 | + |
| 176 | +.. Enter the following command to restore SELinux file for the `/var/www/html` directory: |
| 177 | ++ |
| 178 | +[source,terminal] |
| 179 | +---- |
| 180 | +$ restorecon -vR /var/www/html || true |
| 181 | +---- |
| 182 | ++ |
| 183 | +Bastion now has all the required files and is properly configured in order to install {sno}. |
0 commit comments