Skip to content

Commit

Permalink
Merge pull request #112 from cert-manager/latest-crc-versions
Browse files Browse the repository at this point in the history
Update to the latest CRC versions and add an OpenShift 4.17 option
  • Loading branch information
cert-manager-prow[bot] authored Dec 10, 2024
2 parents b7d7258 + 355b9bd commit 2f6ccc9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ clean-bundle-test: ${kind}
# on your laptop, and the version you supply will then be added to the metadata
# of the VM so that it can be downloaded from the metadata API by the crc setup
# scripts that run inside the VM.
OPENSHIFT_VERSION ?= 4.14
OPENSHIFT_VERSION ?= 4.17

# The path to the pull-secret which you download from https://console.redhat.com/openshift/create/local
PULL_SECRET ?=
Expand All @@ -303,20 +303,26 @@ CRC_INSTANCE_NAME ?= crc-$(subst .,-,${OPENSHIFT_VERSION})
startup_script := hack/crc-instance-startup-script.sh
crc_makefile := hack/crc.mk

# According to Copilot: The approximate cost of running a preemptible
# c3-standard-8 machine VM in the europe-west1-b region of Google Cloud is
# around $88.31 per month. Preemptible VMs are significantly cheaper than
# standard VMs because they can be terminated by Google Cloud at any time if the
# resources are needed elsewhere.
# https://cloud.google.com/compute/vm-instance-pricing
#
# To get a list of suitable machine types:
# gcloud compute machine-types list --filter="zone:europe-west1-b AND guestCpus=8 AND memoryMb=32768"
.PHONY: crc-instance
crc-instance: ## Create a Google Cloud Instance with a crc OpenShift cluster
crc-instance: ${PULL_SECRET} ${startup_script} ${crc_makefile}
: $${PULL_SECRET:?"Please set PULL_SECRET to the path to the pull-secret downloaded from https://console.redhat.com/openshift/create/local"}
gcloud compute instances create ${CRC_INSTANCE_NAME} \
--enable-nested-virtualization \
--min-cpu-platform="Intel Haswell" \
--custom-memory 32GiB \
--custom-cpu 8 \
--image-family=rhel-8 \
--image-project=rhel-cloud \
--preemptible \
--machine-type=c3-standard-8 \
--boot-disk-size=200GiB \
--boot-disk-type=pd-ssd \
--metadata-from-file=make-file=${crc_makefile},pull-secret=${PULL_SECRET},startup-script=${startup_script} \
--metadata=openshift-version=${OPENSHIFT_VERSION}
until gcloud compute ssh crc@${CRC_INSTANCE_NAME} -- sudo systemctl is-system-running --wait; do sleep 2; done >/dev/null
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ which is more than is available on most laptops.
Download your pull secret from the [crc-download] page and supply the path in the command line below:

```sh
make crc-instance OPENSHIFT_VERSION=4.13 PULL_SECRET=${HOME}/Downloads/pull-secret
make crc-instance OPENSHIFT_VERSION=4.17 PULL_SECRET=${PWD}/pull-secret
```

This will create a VM and automatically install the chosen version of OpenShift, using a suitable version of `crc`.
The `crc` installation, setup and start are performed by a `startup-script` which is run when the VM boots.
You can monitor the progress of the script as follows:

```sh
gcloud compute instances tail-serial-port-output crc-4-13
gcloud compute instances tail-serial-port-output crc-4-17
```

You can log in to the VM and interact with the cluster as follows:

```sh
gcloud compute ssh crc@crc-4-13 -- -D 8080
gcloud compute ssh crc@crc-4-17 -- -D 8080
sudo journalctl -u google-startup-scripts.service --output cat
eval $(bin/crc-2.28.0 oc-env)
oc get pods -A
Expand All @@ -151,7 +151,7 @@ oc get pods -A

Log in to the VM using SSH and enable socks proxy forwarding so that you will be able to connect to the Web UI of `crc` when it starts.
```
gcloud compute ssh crc@crc-4-13 -- -D 8080
gcloud compute ssh crc@crc-4-17 -- -D 8080
```

Now configure your web browser to use the socks5 proxy at `localhost:8080`.
Expand Down
3 changes: 3 additions & 0 deletions hack/crc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ crc_version_4.11 := 2.12.0
crc_version_4.12 := 2.19.0
crc_version_4.13 := 2.28.0
crc_version_4.14 := 2.32.0
crc_version_4.15 := 2.28.0
crc_version_4.16 := 2.41.0
crc_version_4.17 := 2.44.0
crc_version = ${crc_version_${OPENSHIFT_VERSION}}

# Download the crc tarball
Expand Down

0 comments on commit 2f6ccc9

Please sign in to comment.