Installing OpenShift using GCP Marketplace
Red Hat OpenShift Container Platform is now available through the GCP Cloud Marketplace. This allows you to create self-managed OpenShift Container Platform cluster deployments which are billed on pay-per-use basis (hourly, per core) through GCP while still being supported directly by Red Hat. Control plane nodes and infrastructure nodes do not incur OpenShift subscription costs. This document explains how to install such a cluster and take advantage of this billing model.
Understanding the installation process
This guide assumes basic familiarity with the overall design concepts and installation procedure of Red Hat OpenShift Container Platform. For a general introduction, please refer to our product documentation.
The deployment of OpenShift Container Platform via the GCP Marketplace is conducted using the same utilities and procedures as a regular self-managed OpenShift Container Platform installation. The setup process using the GCP Marketplace image is identical to a regular GCP installation; both installer-provisioned infrastructure and user-provisioned infrastructure scenarios are supported.
If you have never deployed OpenShift Container Platform on GCP before, you can explore the Install OpenShift on GCP quickly chapter in the installation guide. Customized installations are also supported; in fact, this guide requires that you customize installation parameters to take advantage of the billing integration/benefits.
Limitations
The following scenarios are not supported for installing OpenShift Container Platform using the GCP Marketplace:
- Single-node deployments
- Three-node deployments
Setting up an OpenShift Container Platform cluster using GCP Marketplace
For the cluster to use the GCP marketplace images, you must have the following utilities available:
- OpenShift installation program (
openshift-install)
Selecting the appropriate image
There are three different OpenShift image options available:
- OCP - OpenShift Container Platform
- OPP - OpenShift Platform Plus
- OKE - OpenShift Kubernetes Engine
In the following steps you should use only one of these options consistently throughout the install process.
Note: 4.13 clusters should use a different image, which is specified separately, than earlier clusters due to the addition of UEFI support.
Modifying the installation manifests to use GCP Marketplace images
These steps demonstrate how to use openshift-install to provision a cluster with compute nodes using marketplace images. If you plan on provisioning nodes using Deployment Manager templates, you can skip ahead to the section Using Deployment Manager Templates to Provision Nodes with GCP Marketplace Images.
-
Generate the installation manifests:
$ openshift-install create manifests --dir <installation_dir> -
Edit the compute machine set definitions with the appropriate value from the previous section. These are the three files that must be updated:
<installation_dir>/openshift/99_openshift-cluster-api_worker-machineset-0.yaml<installation_dir>/openshift/99_openshift-cluster-api_worker-machineset-1.yaml<installation_dir>/openshift/99_openshift-cluster-api_worker-machineset-2.yaml
-
In each file, set
.spec.template.spec.providerSpec.value.disks[0].imageto the relative path of the image. For each of the offers the relative paths are:# For OCP 4.12 & earlier projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-48-x86-64-202210040145 # For OPP 4.12 & earlier projects/redhat-marketplace-public/global/images/redhat-coreos-opp-48-x86-64-202206140145 # For OKE 4.12 & earlier projects/redhat-marketplace-public/global/images/redhat-coreos-oke-48-x86-64-202206140145 # For OCP 4.13 & later projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-413-x86-64-202305021736 # For OPP 4.13 & later projects/redhat-marketplace-public/global/images/redhat-coreos-opp-413-x86-64-202305021736 # For OKE 4.13 & later projects/redhat-marketplace-public/global/images/redhat-coreos-oke-413-x86-64-202305021736~~~
Using the first machine set as an example; the .spec.template.spec.providerSpec.value.disks section should look like this when done:
~~~
$ cat <installation_dir>/openshift/99_openshift-cluster-api_worker-machineset-0.yaml | grep -A7 -B1 disks
# For OCP 4.12 & earlier
deletionProtection: false
disks:
- autoDelete: true
boot: true
image: projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-48-x86-64-202210040145
labels: null
sizeGb: 128
type: pd-ssd
kind: GCPMachineProviderSpec
# For OPP 4.12 & earlier
deletionProtection: false
disks:
- autoDelete: true
boot: true
image: projects/redhat-marketplace-public/global/images/redhat-coreos-opp-48-x86-64-202206140145
labels: null
sizeGb: 128
type: pd-ssd
kind: GCPMachineProviderSpec
# For OKE 4.12 & earlier
deletionProtection: false
disks:
- autoDelete: true
boot: true
image: projects/redhat-marketplace-public/global/images/redhat-coreos-oke-48-x86-64-202206140145
labels: null
sizeGb: 128
type: pd-ssd
kind: GCPMachineProviderSpec
# For OCP 4.13 & later, the image value should be:
image: projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-413-x86-64-202305021736
# For OPP 4.13 & later, the image value should be:
image: projects/redhat-marketplace-public/global/images/redhat-coreos-opp-413-x86-64-202305021736
# For OKE 4.13 & later, the image value should be:
image: projects/redhat-marketplace-public/global/images/redhat-coreos-oke-413-x86-64-202305021736
~~~
Completing the Cluster Creation
There are two ways to complete the cluster installation; what way you choose depends on what functionality or method of installation you are using.
Using installer resource provisioning
If you are planning on letting the OpenShift Container Platform manage machines with machine sets, and not manage machines manually, you can complete a typical installation with the following command:
$ openshift-install create cluster --dir <installation_dir>
Using Deployment Manager Templates to Provision Nodes with GCP Marketplace Images
To provision an OpenShift Container Platform cluster using GCP Marketplace images with Deployment Manager templates, you can follow the product documentation and update the 06_worker.yaml Deployment Template.
The ${CLUSTER_IMAGE} to use with 06_worker.yaml should be the selfLink for the image:
Example:
# For OCP 4.12 & earlier
image: https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-48-x86-64-202210040145
# For OPP 4.12 & earlier
image: https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-opp-48-x86-64-202206140145
# For OKE 4.12 & earlier
image: https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-oke-48-x86-64-202206140145
# For OCP 4.13 & later
image: https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-413-x86-64-202305021736
# For OPP 4.13 & later
image: https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-opp-413-x86-64-202305021736
# For OKE 4.13 & later
image: https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-oke-413-x86-64-202305021736
Post-cluster creation verification
When the deployment finishes, you have a cluster running with compute nodes using the GCP Marketplace images, and are thus now being billed as they are used through the GCP Marketplace.
Changing machine sets in a running cluster
To change the compute nodes in an existing cluster to use OpenShift Container Platform images from the GCP Marketplace, follow the steps for Modifying a machine set. The values to change in the cluster machine sets are the same as in the Modifying the installation manifests to use GCP Marketplace images step.
Comments