From b9ae121ae858bd923a6db0caea9fb42bfbbf21a8 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Fri, 29 Nov 2024 17:13:45 +0000 Subject: [PATCH 1/2] Update to the latest CRC versions and add an openshift 4.17 option Signed-off-by: Richard Wall --- Makefile | 2 +- README.md | 8 ++++---- hack/crc.mk | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0dc08d2..5cd4e3c 100644 --- a/Makefile +++ b/Makefile @@ -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 ?= diff --git a/README.md b/README.md index 0238f41..a6f78b8 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ 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`. @@ -135,13 +135,13 @@ The `crc` installation, setup and start are performed by a `startup-script` whic 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 @@ -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`. diff --git a/hack/crc.mk b/hack/crc.mk index 5b3f9a6..632705b 100755 --- a/hack/crc.mk +++ b/hack/crc.mk @@ -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 From 355b9bd196a7dc8054a1141a870d3687e1988c0e Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Wed, 4 Dec 2024 12:32:29 +0000 Subject: [PATCH 2/2] Use a named VM machine type and explain what the cost is expected to be Signed-off-by: Richard Wall --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5cd4e3c..92f8df7 100644 --- a/Makefile +++ b/Makefile @@ -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