-
Notifications
You must be signed in to change notification settings - Fork 20
Start adding 03_create_cluster.sh. #35
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,58 @@ | ||
| #!/bin/bash | ||
| set -xe | ||
|
|
||
| source logging.sh | ||
| source common.sh | ||
|
|
||
| export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE:-registry.svc.ci.openshift.org/ocp/release:4.2}" | ||
|
|
||
| function extract_installer() { | ||
| local release_image | ||
| local outdir | ||
|
|
||
| release_image="$1" | ||
| outdir="$2" | ||
|
|
||
| extract_dir=$(mktemp -d "installer--XXXXXXXXXX") | ||
| pullsecret_file=$(mktemp "pullsecret--XXXXXXXXXX") | ||
|
|
||
| echo "${PULL_SECRET}" > "${pullsecret_file}" | ||
| # FIXME: Find the pullspec for baremetal-installer image and extract the image, until | ||
| # https://github.com/openshift/oc/pull/57 is merged | ||
| baremetal_image=$(oc adm release info --registry-config "${pullsecret_file}" $OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE -o json | jq -r '.references.spec.tags[] | select(.name == "baremetal-installer") | .from.name') | ||
| oc image extract --registry-config "${pullsecret_file}" $baremetal_image --path usr/bin/openshift-install:${extract_dir} | ||
|
|
||
| chmod 755 "${extract_dir}/openshift-install" | ||
| mv "${extract_dir}/openshift-install" "${outdir}" | ||
| export OPENSHIFT_INSTALLER="${outdir}/openshift-install" | ||
|
|
||
| rm -rf "${extract_dir}" | ||
| rm -rf "${pullsecret_file}" | ||
| } | ||
|
|
||
| # TODO - Provide scripting to help generate install-config.yaml. | ||
| # - https://github.com/openshift-kni/install-scripts/issues/19 | ||
| if [ ! -f install-config.yaml ] ; then | ||
| echo "Please create install-config.yaml" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Do some PULL_SECRET sanity checking | ||
| if [[ "${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" == *"registry.svc.ci.openshift.org"* ]]; then | ||
| if [[ "${PULL_SECRET}" != *"registry.svc.ci.openshift.org"* ]]; then | ||
| echo "Please get a valid pull secret for registry.svc.ci.openshift.org." | ||
| exit 1 | ||
| fi | ||
| fi | ||
| if [[ "${PULL_SECRET}" != *"cloud.openshift.com"* ]]; then | ||
| echo "Please get a valid pull secret for cloud.openshift.com." | ||
| exit 1 | ||
| fi | ||
|
|
||
| mkdir -p ocp | ||
| extract_installer "${OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE}" ocp/ | ||
| cp install-config.yaml ocp/ | ||
| ${OPENSHIFT_INSTALLER} --dir ocp create manifests | ||
| # TODO - Add custom install time manifests here: | ||
| # - https://github.com/openshift-kni/install-scripts/issues/30 | ||
|
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. See my comment in #30 - I'm unclear whether using 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. It's something we have to live with during 4.2, because a couple of things (most notably the ConfigMap required to start the BMO/Ironic containers via the MAO, and the BaremetalHost CRD) need to be added which aren't currently integrated into the installer. We expect that integration work to be completed in the 4.3 timeframe, but for now I think we've got no option than to inject these pieces via manifests.
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. Russell suggested re-looking at the BMO config map issue - #30 (comment)
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 can drop it from this script for now while we sort it out. The install won't work successfully without it though. The machine-api-operator will fail to come up, because the metal3 deployment it manages will be busted without its config. |
||
| ${OPENSHIFT_INSTALLER} --dir ocp create cluster | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When openshift/oc#57 merges, we'll no longer set
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDEso you could do e.g.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just copied the current version of what's done in dev-scripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern indeed looks nicer 👍