Skip to content

Commit

Permalink
try using a custom image for lab04.adoc
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsimcall committed May 2, 2024
1 parent 8fe9725 commit 3c26412
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 25 additions & 18 deletions content/modules/ROOT/pages/lab04.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image::disco-3.svg[disco diagram,800]

Here's a diagram describing the inputs and outputs of the installation configuration process:

image::install-overview.png[Install Overview]
image::install-overview-disco.png[Install Overview]

{counter:install}. Let's start by creating a workspace on the [.highside]#*highside* system# to house our installation materials:

Expand All @@ -23,24 +23,21 @@ Create an initial `install-config.yaml`:
[.highside,source,yaml,role=execute,subs="attributes"]
----
cat << EOF > /mnt/high-side-data/install/install-config.yaml
additionalTrustBundlePolicy: Always
---
apiVersion: v1
metadata:
name: disco
baseDomain: lab
compute:
- architecture: amd64
hyperthreading: Enabled
name: worker
platform: {}
replicas: 0
controlPlane:
architecture: amd64
hyperthreading: Enabled
name: master
platform: {}
replicas: 1
metadata:
creationTimestamp: null
name: disco
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
Expand All @@ -56,19 +53,20 @@ platform:
subnets:
- {PrivateSubnet1}
publish: Internal
additionalTrustBundlePolicy: Always
EOF
----

{counter:install}. Generate an SSH key pair for access to cluster nodes and add it to the `install-config.yaml`

[.highside,source,bash,role=execute,subs="attributes"]
----
ssh-keygen -C "Cluster Debug Key" -N "" -f /mnt/high-side-data/id_rsa
ssh-keygen -C "OpenShift Debug" -N "" -f /mnt/high-side-data/id_rsa
echo "sshKey: $(cat /mnt/high-side-data/id_rsa.pub)" >> /mnt/high-side-data/install/install-config.yaml
----

[NOTE]
The SSH key will be installed on all cluster nodes but is primarily for troubleshooting.
The SSH key for OpenShift is only used for troubleshooting.

{counter:install}. Use `jq` to minify your container registry pull secret and add it to the `install-config.yaml`

Expand All @@ -79,16 +77,23 @@ echo "pullSecret: '$(jq -c . $XDG_RUNTIME_DIR/containers/auth.json)'" >> /mnt/hi

[NOTE]
--
For connected installations, you would use the secret from the Hybrid Cloud Console, but for our use case, the mirror registry is the only one OpenShift will need to authenticate to.
For connected installations, you would use your _pull secret_ from the Hybrid Cloud Console, but for our use case, the `mirror-registry` is the only _image registry_ OpenShift will need to authenticate to.
--

=== Add the `imageContentSources` that `oc mirror` produced to ensure image mappings happen correctly.

*Before continuing*, make sure the second stage of your mirror is done by checking that the `imageContentSourcePolicy.yaml` file exists on disk.

// while true ; do if (test -e /mnt/high-side-data/oc-mirror-workspace/results-*/imageContentSourcePolicy.yaml) ; then break; fi; sleep 5; done

[.highside,source,bash,role=execute,subs="attributes"]
----
while true ; do if (test -e /mnt/high-side-data/oc-mirror-workspace/results-*/imageContentSourcePolicy.yaml) ; then break; fi; sleep 5; done
if (test -e /mnt/high-side-data/oc-mirror-workspace/results-*/imageContentSourcePolicy.yaml)
then
echo "Looks good, go ahead!"
else
echo "Uh oh, something is wrong..."
fi
----

Then you can append the relevant snippet to your `install-config.yaml` by running this command:
Expand All @@ -106,9 +111,6 @@ They'll look something like this:
[source,yaml]
----
imageContentSources:
- mirrors:
- ip-10-0-51-206.ec2.internal:8443/ubi8/ubi
source: registry.redhat.io/ubi8/ubi
- mirrors:
- ip-10-0-51-206.ec2.internal:8443/openshift/release-images
source: quay.io/openshift-release-dev/ocp-release
Expand All @@ -117,7 +119,7 @@ imageContentSources:
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
----

** Add the root CA of our mirror registry to the trust bundle using the `additionalTrustBundle` field by running this command:
Add the root CA of our mirror registry to the trust bundle using the `additionalTrustBundle` field by running this command:

[.highside,source,bash,role=execute]
----
Expand All @@ -137,11 +139,14 @@ additionalTrustBundle: |
-----END CERTIFICATE-----
----

. Then make a backup of your `install-config.yaml` since the installer will consume (and delete) it:
Then make a backup of your `install-config.yaml` since the installer will consume (and delete) it:

//TODO - the command block below wasn't rendering properly for jcall

[.highside,source,bash,role=execute,subs="attributes"]
----
cd /mnt/high-side-data/install
cp install-config.yaml install-config.yaml.backup
cp -v install-config.yaml install-config.yaml.backup
----

== Running the Installation
Expand All @@ -151,7 +156,9 @@ Let's kick off the cluster installation:

[NOTE]
--
The OpenShift tooling is built for every release and version data is encoded in each binary.
The OpenShift Installer (`openshift-install`) is rebuilt for every release (`{openshift_version}`).

This means that you can't use `openshift-install` version `{openshift_min_version}` to install OpenShift `{openshift_max_version}`.
--


Expand Down

0 comments on commit 3c26412

Please sign in to comment.