OpenShift mirror registry setup
In the following, we will run a container registry without hostname (only IP address) and self-signed CA and certificate. We need a virtual machine that serves as the container registry and a host that serves as the OpenShift install server. These can both be on the same machine, to simplify things further.
All steps below clarify and should give an easy walkthrough of the OpenShift restricted network installation guide.
Follow the OpenShift documentation. The documentation isn't very detailed (at least at the moment), so I'm going through the documentation with an example deployment.
Setting up a private registry server
Follow https://andreaskaris.github.io/blog/openshift/private-registry/
Mirroring OpenShift container images into private registry and preparing openshift-install
Connect to the installation server and follow steps from the installation guide: https://docs.openshift.com/container-platform/4.5/installing/install_config/installing-restricted-networks-preparations.html
Merging the pull secrets
Download your pull-secret from https://cloud.redhat.com/openshift/install/pull-secret.
At time of this writing, a bug makes this procedure a bit more clumsy: https://bugzilla.redhat.com/show_bug.cgi?id=1866588
1 2 3 4 5 6 7 8 9 |
|
Instead, either follow: https://docs.openshift.com/container-platform/4.2/installing/install_config/installing-restricted-networks-preparations.html#installation-adding-registry-pull-secret_installing-restricted-networks-preparations
Or, more elegantly, create a pull secret with podman:
1 2 3 4 5 6 7 8 9 10 |
|
Install jq
1 |
|
Then, merge both secrets:
1 |
|
Mirroring the container images
Get $OCP_RELEASE
from https://quay.io/repository/openshift-release-dev/ocp-release?tag=latest&tab=tags and export required env variables, e.g.:
1 2 3 4 5 6 7 8 9 |
|
If you want to simulate the removable media steps, create a directory to simulate removable media and export the variable:
1 2 |
|
Now, continue with the rest of the instructions from https://docs.openshift.com/container-platform/4.5/installing/install_config/installing-restricted-networks-preparations.html#installation-mirror-repository_installing-restricted-networks-preparations
For example:
1 |
|
After mirroring the images, the following instructions will be presented:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
Make sure to save these instructions for later.
Verify contents of the local registry:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
Now, extract the new openshift-install
command:
1 |
|
The resulting file can be found in the current working directory:
1 2 |
|
Installing a disconnected cluster
Once the new openshift-install client was created, continue with the actual cluster installation.
For example, on AWS, use https://docs.openshift.com/container-platform/4.5/installing/installing_aws/installing-restricted-networks-aws.html#installing-restricted-networks-aws
Create and then modify the install-config.yaml
file on the installation server. Make sure to add imageContentSources
(from the output of the last command) and also add the rootCA to the additionalTrustBundle
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Also, make sure to modify the pullSecret
section in install-config.yaml to include the credentials for the custom registry:
1 |
|
Steps for modifying install-config.yaml
can be found in https://docs.openshift.com/container-platform/4.5/installing/installing_aws/installing-restricted-networks-aws.html#installation-generate-aws-user-infra-install-config_installing-restricted-networks-aws
Follow any further steps from the restricted installation documentation. Finally, run the installation. Use the custom openshift-install
binary that was generated earlier:
1 |
|