OpenShift 4.0 libvirt on GCP
Create an OpenShift 4.0 cluster in a single GCP instance.
Create a cluster
If the images are built and available in your project/zone, all you need to get started is the gcloud
CLI tool.
First, launch an instance.
$ gcloud compute instances create $INSTANCE \
--image-family openshift4-libvirt \
--zone us-east1-c \
--min-cpu-platform "Intel Haswell" \
--machine-type n1-standard-8 \
--boot-disk-type pd-ssd --boot-disk-size 256GB \
--metadata-from-file openshift-pull-secret=openshift-pull-secret.json
Connect to the instance using SSH and create a cluster named nested
.
$ create-cluster nested
Interact with your cluster with oc
.
Updating the installer
Tools can be updated right from the instance itself.
Update the OpenShift installer from https://github.com/openshift/installer.git
master
using:
$ update-installer
Update the OpenShift installer from https://github.com/repo-owner/installer.git
branch
using:
$ update-installer repo-owner branch
Update the RHCOS image using:
$ update-rhcos-image
Images
Images are built with Packer. Override variables as necessary.
Source image
The source image is centos-7
with nested virtualization enabled.
$ packer build openshift4-libvirt-source.json
To override any default variable value, for example, Google Project ID:
$ packer build -var 'project=your-google-project-id' openshift4-libvirt-source.json
Provisioned image
The provisioned image implements all the OpenShift libvirt HOWTO requirements.
$ packer build openshift4-libvirt.json
To override any default variable value, for example, Google Project ID:
$ packer build -var 'project=your-google-project-id' openshift4-libvirt.json
Advanced usage
It's possible to ignore all the defaults and helpers and simply use the image as a stable base for libvirt installer development.