OpenShift Disconnected Installs – Part 4

Now that we have built our cluster in Part 3, it is time to do the final configuration steps to tell it to use our offline, mirrored Operator installs. This is a fairly simple procedure to finish, and will lead to this being one of the shortest posts I’ve made yet but the information is still important to cover. As you recall from part 2 we setup the offline mirror file and then ran the oc mirror command to stage all the content in our mirrored container repository.

So, how do we tell our OpenShift cluster to use these mirrored Operators instead of the default Operator Hub sources? It is really simple and only requires two commands in total. The first command you need to run is to tell OpenShift to load the manifests from your oc mirror command. When you ran that command, it created a folder called results-<random numbers>. To apply these to your cluster you will need to either A. Login to the cluster via oc login or B.) use your system:admin kubeconfig file to authenticate against your new cluster. For the sake of ease, I’m going to use the kubeconfig option to demonstrate the command: KUBECONFIG=/home/username/.kube/config oc apply -f /home/username/results-123456789

After you run that command, you have told OpenShift to use your mirrored OperatorHub sources, but if you try to install from them right now, you will get an error. This error is because OpenShift is still looking at all the default OperatorHub sources so we need to disable that behavior. This is, again, and single command that you can run via either method I previously mentioned, for my example I’m going to stay with using the kubeconfig option. The command you need to run at this point is KUBECONFIG=/home/username/.kube/config oc patch OperatorHub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'

After running both these commands, you have told your cluster how to install your mirrored Operators and are ready to start working on the day 2 configuration of your cluster (certs, operator installation, etc). This will complete all the steps needed to do a manual installation of an offline cluster.

In the next, and final part of this blog series we will consolidate the cluster provisioning process into an Ansible playbook that I think you will find useful.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *