openshift / installer

Install an OpenShift 4.x cluster
https://try.openshift.com
Apache License 2.0
1.42k stars 1.38k forks source link

air gap installation. point to local cached .iso to use as base iso rather than download via the internet. #8587

Open sycbarry opened 3 months ago

sycbarry commented 3 months ago

Hi!

I just wanted to ask if it would be possible to get insight on how to point the openshift-install cli to use the locally cached .iso image when running

./openshift-install agent create image --dir=.

We basically need to be able to run this command within an air gapped env that has absolutely no access to the internet. We would have the rhcos iso downloaded prior and moved to the private network where we would configure the install-configs from there.

There is no way around this.

dmc5179 commented 1 month ago

@sycbarry The agent installer will actually use the information in your install-config.yaml to extract the base ISO from the container images that are mirrored into your air-gapped/offline environment. The docs do not really cover this at all.

in the install-config.yaml you'll have something like this:

pullSecret: 'my secret'
imageContentSources:
- mirrors:
  - privateregistry.com:8443/openshift/release
  source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
- mirrors:
  - privateregistry.com:8443/openshift/release-images
  source: quay.io/openshift-release-dev/ocp-release

When those are present in your install-config.yaml you'll actually be able to see the oc extract subcommands of the agent installer look like this:

level=debug msg=Fetching image from OCP release (oc adm release info --image-for=machine-os-images --filter-by-os=linux/amd64 --insecure=true --icsp-file=/tmp/icsp-file765915509 quay.io/openshift-release-dev/ocp-release@sha256:8032c4248d7ae032d5e79debf975d08683cc34d5f08ab2e937ce2d1e940c007b)

The --iscp-file will cause the oc extract commands to pull the ISO out of your private repo containers and not from the internet.

dmc5179 commented 1 month ago

Added comment: This is really a missing component of the agent installer docs. I've submitted a JIRA to the openshift docs team to address this missing information.

sycbarry commented 1 month ago

Awesome, I appreciate it Dan.