- Access to an GCP Account (to create an account go here: https://console.cloud.google.com/freetrial)
- A GCP project created in the console. A guide can be found here: https://cloud.google.com/resource-manager/docs/creating-managing-projects
- The relevant API services enabled in GCP, listed below:
- Compute Engine API (compute.googleapis.com) (This requires a service account which should be an owner of the project. This can be used for authenticating with the CLI be sure to save a json file of the service secret after the account is created)
- Google Cloud APIs (cloudapis.googleapis.com)
- Cloud Resource Manager API (cloudresourcemanager.googleapis.com)
- Google DNS API (dns.googleapis.com)
- IAM Service Account Credentials API (iamcredentials.googleapis.com)
- Identity and Access Management (IAM) API (iam.googleapis.com)
- Service Management API (servicemanagement.googleapis.com)
- Service Usage API (serviceusage.googleapis.com)
- Google Cloud Storage JSON API (storage-api.googleapis.com)
- Cloud Storage (storage-component.googleapis.com)
- A registered domain within the Google Domain system. If you would prefer to use a separate domain you can delegate a 3rd party domain name to your Google account.
- Once you have a Domain registered with Google make sure to setup a DNS Zone within GCP.
- One key thing to note is that the current guide calls out the GCP project quotas and states there is no issue with this. This is false, the Persistent storage quota should be increased to at least 800GBs. The Regional ComputeCPUs are technically ok but the general gist is that the regional cpus quota is for 25 and the installer uses 24, therefore it is recommended to increase this quota.
- Download the Openshift Installer from try.openshift.com for the appropriate operating system (Currently MacOS and Linux are the only supported operating systems).
- Be sure to download the Openshift CLI tools for your operating system (when extracting this binary file be sure to place it in a location that is included in your PATH variable in order to use these in the command line).
- A saved copy of the Pull Secret that is provided on try.openshift.com
- Navigate to a directory on your local machine where you would like the installer to save log information as well as install files.
- Open up a terminal instance and run the following command in the above directory:
- openshift-install create cluster
- If the Openshift Installer file was not added to your Path variable then run the command: /<directory>/openshift-install create cluster where <directory> is the directory that the Openshift Installer file was extracted to.
- The installer will ask you if you would like to use a public SSH key or if you would like to skip this step. Select an SSH key if you would like to have the configured in your cluster.
- The next step is to select the platform you would like the cluster installed to. The options are:
Select GCP. That is not to say these are the only options that OCP can be run on. These are the options currently supporting the IPI installer method.
- If this is not your first time running the installer then skip this step and proceed to the next one. The installer will ask you for your GCP Service Account Json File (this should have been downloaded when setting up the GCP APIs). These credentials will be stored in a .gcp directory on your home directory. The directory is hidden but you can navigate to it and modify it in the terminal if there is an issue with your credentials or your need to change the file.
- The next step is to select the region that you would like your cluster hosted on. If there are no known limitations to the closest Region then select this one. If you would prefer the cluster to be located in a different region then select that region.
- The installer will then ask you for your registered base domain. This is what you registered in GCP Public Zone during the prerequisites section. Enter that domain exactly as it shows up in GCP Public Zone.
- Next, you will be asked to name your cluster. This will be used when generating hostnames for your 3 masters and 3 worker nodes. If you would like more information then type ? on the command line and helpful information will be provided to you regarding naming.
- The final step will be to enter the Pull Secret that you copied from try.openshift.com. Once you have entered the Pull Secret you can hit enter and the installer will begin creating the cluster.
- Once the installer completes there will be some credential information displayed in the terminal. This information will include:
- The API URL for accessing your cluster via CLI
- The console URL for accessing your cluster via a browser
- A command to export the KUBEADMIN variable to your local system which will display the location of the kubeadmin account information
- The kubeadmin account information for first login either via the CLI or Console.
These are some common issues that I have encountered and how to avoid them:
- It is also important to note that once created, the cluster should not be shut down for at least 24 hours. This post explains the reasoning: https://access.redhat.com/solutions/4218311
- The installer should complete without any issues provided the networking things were setup correctly.
- I have seen a few errors with destroying the cluster.
- If openshift-install destroy cluster --log-level=debug is run then I have noticed that the installer cannot destroy my VM nodes. This has happened every time. I find that going in and deleting the Compute Engine instances manually via the console solves this error
- The next error I get is the inability to delete the VPC network. This can be remedied by deleting the VPC network, however there may be an issue with network policies still relying on the network. I find it's best to run the destroy cluster command and watch until the network error comes up.
- The last issue I have is to delete the instance group. The install fails on this as well and I find it's easier to delete it in the console. Once this has been done you need to rerun the destroy cluster command and ensure it successfully deletes all of the files and other resources.
Please note this is my experience when installing OpenShift on GCP. Any opinions in this post are expressly my own and do not reflect Red Hat's opinions on this installation process.