-
Notifications
You must be signed in to change notification settings - Fork 228
USHIFT-1280: Document multinode environment setup and runtime #1844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # MicroShift on RHEL for Edge | ||
| Review the [Install MicroShift on RHEL for Edge](../rhel4edge_iso.md) | ||
| document to understand the process of building MicroShift ISO images in the | ||
| MicroShift development environment. | ||
|
|
||
| ## Prerequisites | ||
| A `development host` (either virtual or physical) configured according to the | ||
| instructions in the [MicroShift Development Environment](../devenv_setup.md) | ||
| document. | ||
|
|
||
| > While it is possible to configure the MicroShift development environment on | ||
| > your hypervisor host, it is recommended to use a dedicated virtual machine | ||
| > to simplify the installation and configuration process. | ||
|
|
||
| ## Create ISO Image | ||
| Log into the `development host` and run the following commands to download | ||
| the released MicroShift RPMs to be included in the ISO image. | ||
| ``` | ||
| MICROSHIFT_VERSION=4.14 | ||
| MICROSHIFT_RPMS_DIR=$(mktemp -d /tmp/microshift-rpms.XXXXXXXXXX) | ||
| OCP_REPO_NAME="rhocp-${MICROSHIFT_VERSION}-for-rhel-9-$(uname -m)-rpms" | ||
|
|
||
| sudo subscription-manager repos --enable ${OCP_REPO_NAME} | ||
| sudo dnf download --downloaddir "${MICROSHIFT_RPMS_DIR}" microshift\* | ||
| chmod go+rx "${MICROSHIFT_RPMS_DIR}" | ||
| ``` | ||
|
|
||
| > Until the MicroShift 4.14 software is released, it is necessary to compile the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If these are the developer instructions, why don't we have them always build the RPMs instead of downloading them?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two reasons I see for keeping the existing RPM option:
|
||
| > MicroShift RPMs from the latest sources on the `development host` and copy them | ||
| > into the `${MICROSHIFT_RPMS_DIR}` directory. | ||
| > | ||
| > See the [RPM Packages](../devenv_setup.md#rpm-packages) documentation | ||
| > for more information on building MicroShift RPMs. | ||
|
|
||
| Proceed by building the ISO image with your pull secret, the downloaded MicroShift | ||
| RPMS, your SSH authorized keys and the firewall configuration necessary for the | ||
| multiple nodes to access each other. | ||
| ``` | ||
| cd ~/microshift/ | ||
| ./scripts/image-builder/build.sh \ | ||
| -pull_secret_file ~/.pull-secret.json \ | ||
| -microshift_rpms "${MICROSHIFT_RPMS_DIR}" \ | ||
| -authorized_keys_file ~/.ssh/authorized_keys \ | ||
| -open_firewall_ports 6443:tcp,9642:tcp | ||
| rm -rf "${MICROSHIFT_RPMS_DIR}" | ||
| ``` | ||
|
|
||
| > The multinode configuration procedure uses SSH for copying files among the | ||
| > nodes and remotely running scripts on the primary and secondary hosts. | ||
| > Having your SSH keys authorized in the image would make the node configuration | ||
| > procedure more convenient and streamlined. | ||
|
|
||
| ## Install Virtual Machines | ||
| Log into the `hypervisor host` and follow the instructions described in the | ||
| [Install MicroShift for Edge](../rhel4edge_iso.md#install-microshift-for-edge) | ||
| section to create the `microshift-pri` and `microshift-sec` virtual machines | ||
| for running primary and secondary instances. | ||
|
|
||
| After the virtual machines are up and running, use the `virsh` command to determine their IP addresses. | ||
| ``` | ||
| sudo virsh domifaddr microshift-pri | ||
| sudo virsh domifaddr microshift-sec | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # RHEL with MicroShift RPMs | ||
| Log into the `hypervisor host` and follow the instructions described in the | ||
| [Getting Started with MicroShift](../getting_started.md) document to create | ||
| and configure the `microshift-pri` and `microshift-sec` virtual machines for | ||
| running primary and secondary instances. | ||
|
|
||
| > Until the MicroShift 4.14 software is released, it is necessary to compile the | ||
| > MicroShift RPMs from the latest sources on the `development host` and copy | ||
| > them to the `microshift-pri` and `microshift-sec` virtual machines. | ||
| > | ||
| > See the [RPM Packages](../devenv_setup.md#rpm-packages) documentation | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this part of the documentation needs some fleshing out. After following the instructions up to this point, I had two working microshift systems running an older build of microshift. First, I wiped away the old microshift via
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. I will add more information here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated the instruction - please see if this is better now. |
||
| > for more information on building MicroShift RPMs. | ||
| > | ||
| > Run the following command on the `microshift-pri` and `microshift-sec` | ||
| > virtual machines to upgrade the software. | ||
| > ``` | ||
| > sudo dnf localinstall -y microshift*.rpm | ||
| > ``` | ||
|
|
||
| After the virtual machines are up and running, use the `virsh` command to determine their IP addresses. | ||
| ``` | ||
| sudo virsh domifaddr microshift-pri | ||
| sudo virsh domifaddr microshift-sec | ||
| ``` | ||
|
|
||
| The multinode configuration procedure uses SSH for copying files among the | ||
| nodes and remotely running scripts on the primary and secondary hosts. | ||
| Having your SSH keys authorized in the nodes would make their configuration | ||
| procedure more convenient and streamlined. | ||
| ``` | ||
| PRI_ADDR=192.168.122.118 | ||
| SEC_ADDR=192.168.122.70 | ||
|
|
||
| # Use 'redhat' without quotes as a password when prompted | ||
| ssh-copy-id redhat@${PRI_ADDR} | ||
| ssh-copy-id redhat@${SEC_ADDR} | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Multinode Testing Environment for MicroShift | ||
| This document describes an opinionated, non-production setup of a two-node MicroShift | ||
| setup to facilitate running tests. | ||
|
|
||
| MicroShift does **not** support a multinode mode of operation, while some of | ||
| the tests require it to run successfully. The instructions in this document are | ||
| the recommended way to configure a non-production two-node setup to be used | ||
| **only** for running tests. | ||
|
|
||
| ## Prerequisites | ||
| A physical `hypervisor host` with the [libvirt](https://libvirt.org/) virtualization | ||
| platform to be used for bootstrapping MicroShift primary and secondary hosts for | ||
| running tests. | ||
|
|
||
| Depending on the desired MicroShift installation method, follow the instructions | ||
| to set up one of the configurations for the primary and secondary hosts: | ||
| * [RHEL with MicroShift RPMs](./config_rpm.md) | ||
| * [MicroShift on RHEL for Edge](./config_r4e.md) | ||
|
|
||
| Log into the `hypervisor host` and set the environment variables that denote | ||
| primary and secondary host names and IP addresses to be used in the subsequent | ||
| commands. | ||
| ``` | ||
| PRI_HOST=microshift-pri | ||
| PRI_ADDR=192.168.122.118 | ||
|
|
||
| SEC_HOST=microshift-sec | ||
| SEC_ADDR=192.168.122.70 | ||
| ``` | ||
|
|
||
| ## Configure Primary and Secondary Hosts | ||
| Run the following commands to copy the configuration script to the primary host | ||
| and run it remotely. | ||
| ``` | ||
| git clone https://github.com/openshift/microshift.git ~/microshift | ||
| cd ~/microshift/ | ||
| scp -o StrictHostKeyChecking=no ./scripts/multinode/configure-pri.sh redhat@${PRI_ADDR}: | ||
| ssh redhat@${PRI_ADDR} ./configure-pri.sh "${PRI_HOST}" "${PRI_ADDR}" "${SEC_HOST}" "${SEC_ADDR}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This command fails for me: Need to add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is because you used the merged getting started kickstart, and not the one from the PR. |
||
| ``` | ||
|
|
||
| If the configuration script runs successfully, it prints the list of the | ||
| `kubelet` configuration files that need to be copied to the secondary host. | ||
|
|
||
| Copy the `kubelet` configuration files from the primary to the secondary host. | ||
| ``` | ||
| scp -3 -o StrictHostKeyChecking=no \ | ||
| redhat@${PRI_ADDR}:/home/redhat/kubelet-${SEC_HOST}.{key,crt} \ | ||
| redhat@${PRI_ADDR}:/home/redhat/kubeconfig-${PRI_HOST} \ | ||
| redhat@${SEC_ADDR}: | ||
| ``` | ||
|
|
||
| Run the following commands to copy the configuration script to the secondary host | ||
| and run it remotely. | ||
| ``` | ||
| cd ~/microshift/ | ||
| scp -o StrictHostKeyChecking=no ./scripts/multinode/configure-sec.sh redhat@${SEC_ADDR}: | ||
| ssh redhat@${SEC_ADDR} ./configure-sec.sh "${PRI_HOST}" "${PRI_ADDR}" "${SEC_HOST}" "${SEC_ADDR}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is because you used the merged getting started kickstart, and not the one from the PR. |
||
| ``` | ||
|
|
||
| ## Run Tests | ||
| Before running tests, make sure that the `microshift-pri` host name is resolved | ||
| and accessible from the `hypervisor host`. | ||
|
|
||
| Set the `KUBECONFIG` variable using the configuration file from the primary host. | ||
| ``` | ||
| export KUBECONFIG=$(mktemp /tmp/microshift-kubeconfig.XXXXXXXXXX) | ||
| scp redhat@${PRI_ADDR}:/home/redhat/kubeconfig-${PRI_HOST} ${KUBECONFIG} | ||
| ``` | ||
|
|
||
| Verify that the cluster has **two** nodes in the `Ready` status and wait until | ||
| all the pods are in the `Running` status. | ||
| ``` | ||
| oc get nodes | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accessing the microshift cluster from the VM host fails if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you clarify what you mean by "VM host"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the hypervisor, these names should be resolved by libvirt. |
||
| watch oc get pods -A | ||
| ``` | ||
|
|
||
| Run your test suite of choice using the primary and secondary MicroShift instances. | ||
Uh oh!
There was an error while loading. Please reload this page.