Prerequisites:

  1. Access to an GCP Account (to create an account go here: https://console.cloud.google.com/freetrial)
  2. A GCP project created in the console. A guide can be found here: https://cloud.google.com/resource-manager/docs/creating-managing-projects
  3. The relevant API services enabled in GCP, listed below:
  4. 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)
  5. Google Cloud APIs (cloudapis.googleapis.com)
  6. Cloud Resource Manager API (cloudresourcemanager.googleapis.com)
  7. Google DNS API (dns.googleapis.com)
  8. IAM Service Account Credentials API (iamcredentials.googleapis.com)
  9. Identity and Access Management (IAM) API (iam.googleapis.com)
  10. Service Management API (servicemanagement.googleapis.com)
  11. Service Usage API (serviceusage.googleapis.com)
  12. Google Cloud Storage JSON API (storage-api.googleapis.com)
  13. Cloud Storage (storage-component.googleapis.com)
  14. 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.
  15. Once you have a Domain registered with Google make sure to setup a DNS Zone within GCP.
  16. 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.
  17. Download the Openshift Installer from try.openshift.com for the appropriate operating system (Currently MacOS and Linux are the only supported operating systems).
  18. 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).
  19. A saved copy of the Pull Secret that is provided on try.openshift.com

Installation Procedure:

  1. Navigate to a directory on your local machine where you would like the installer to save log information as well as install files.
  2. Open up a terminal instance and run the following command in the above directory:
  3. openshift-install create cluster
  4. 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.
  5. 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.
  6. The next step is to select the platform you would like the cluster installed to. The options are:
  7. AWS
  8. Azure
  9. GCP
  10. OpenStack

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Once the installer completes there will be some credential information displayed in the terminal. This information will include:
  7. The API URL for accessing your cluster via CLI
  8. The console URL for accessing your cluster via a browser
  9. A command to export the KUBEADMIN variable to your local system which will display the location of the kubeadmin account information
  10. The kubeadmin account information for first login either via the CLI or Console.

Troubleshooting:

These are some common issues that I have encountered and how to avoid them:

  1. 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
  2. The installer should complete without any issues provided the networking things were setup correctly.
  3. I have seen a few errors with destroying the cluster.
  4. 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
  5. 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.
  6. 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.