This repo contains bash scripts to help automate creation of OpenShift clusters across cloud providers. (Note: it has functionality very similar to that of Cluster Bot except it can just run out of the box to help create IPI (installer-provisioned-infrastructure) clusters).
Pre-requisites:
oc
cli installed and available in$PATH
- cloud provider cli setup with necessary authentication for eg. AWS credentials available to be inferred from current environment or GCP credentials gcloud default auth setup
- necessary cloud provider quota required for spinning up cluster resources for OpenShift
~/.docker/config.json
file on your system to contain the necessary pull secrets required for cluster creation- or any other location would work for the pull secrets file, however you would need to set
PULL_SECRET_PATH
environment variable explicitly
- or any other location would work for the pull secrets file, however you would need to set
- either
~/.ssh/google_compute_engine.pub
(for GCP) or~/.ssh/id_rsa.pub
(for AWS, Azure) to be present on your system
You can download all these binaries either from: https://console.redhat.com/openshift/downloads or from our OpenShift CI: https://amd64.ocp.releases.ci.openshift.org/
Before running each of the .sh
scripts consider taking a look over the initial block of code in each of the script preceeding # --------------------
, should contains description for each environment variable necessary for the cluster creation to run. They have been filled with default values (yet wont work out of the box), instead you need to set those variables in your environment (i.e. either before calling the script or by creating a wrapper script which contains exact values of the required variables) especially, the cloud provider resource ids eg. cloud project, cloud region, base domain, etc.
./create-cluster-aws.sh
: create an IPI provisioned OpenShift cluster on AWS./create-cluster-aws-sts.sh
: create an IPI provisioned OpenShift cluster on AWS with STS authentication through Manual mode cloud credentials.
./create-cluster-gcp.sh
: create an IPI provisioned OpenShift cluster on GCP./create-cluster-gcp-sts.sh
: create an IPI provisioned OpenShift cluster on GCP with Google Workload Identity through Manual mode cloud credentials
./create-cluster-az.sh
: create an IPI provisioned OpenShift cluster on Azure public cloud./create-cluster-az-sts.sh
: create an IPI provisioned OpenShift cluster on Azure with short-term credentials with Active Directory (AD) Workload Identity
All the clusters created using this script will have a prefix that is determined by running whoami
from the shell. At the time of destroying the clusters, be mindful to use the same username or the cleanup won't work the way as desired. ./destroy-clusters.sh N
will attempt cleanup (a.k.a openshift-install destroy cluster
) of all but the last N
clusters. If the value of N
is omitted, the script will attempt to cleanup all the clusters from the directories that can it can find.
Additional references: