Creating the Red Hat OpenShift cluster on Azure

Procedure

  1. Generate an SSH private key and add it to the agent:
    1. Create or use an SSH key that is configured for authentication without a password.
      For example, on a computer that uses a Linux® operating system, run this command to create this type of SSH key:
      # ssh-keygen -t ed25519 -N '' -f <path>/<file_name>
    2. Start the ssh-agent process as a background task:
      # eval "$(ssh-agent -s)"

      The following example shows a successful output:

      Agent pid 31874
    3. Add your SSH private key to the ssh-agent:
      # ssh-add <path>/<file_name>
  2. Obtain the installation program:
    1. Access the Red Hat OpenShift Cluster Manager.
    2. Obtain a pull secret.
    3. Download the OpenShift installation program for your operating system and place the file in the directory where you store the installation configuration files.
    4. Open the OpenShift installer tar file by running this command:
      # tar xvf openshift-install-linux.tar.gz
    5. From the Pull Secret page, download your installation pull secret as a .txt file.
  3. Create the install-config.yaml file.
    # ./openshift-install create install-config --dir=<Directory>

    When you create the file, use these parameters:

    Parameter Value
    SSH Public Key Select an SSH key to use to access your cluster machines.
    Platform AZURE
    Azure Subscription ID 297d75cf-……..
    Azure Tenant ID 32bfacf3-8eb1-……
    Azure Service Principal Client ID 12ea9986-…..
    Azure Service Principal Client Secret Enter the password that was specified when you created the service principal output.
    Region eastus
    Public Zone Name gi.priv.test (this name is the pseudo-DNS zone name)
    Cluster Name gi3120
    Pull Secret Paste the pull secret that you obtained in this step.
  4. Edit the file (issue the cat install-config.yaml command) according to the System requirements and prerequisites and Hardware cluster requirements.
    Tip: The install-config.yaml file is consumed during the installation process, so create a backup of the file so that it can be used to install multiple clusters.
  5. Deploy the cluster:
    $ ./openshift-install create cluster --dir=<installation_directory> \ --log-level=info

    The following example shows a successful output:

    ~]# ./openshift-install create cluster --dir gi3100-on-azure --log-level=info
    INFO Credentials loaded from file "/root/.azure/osServicePrincipal.json" 
    INFO Consuming Install Config from target directory 
    INFO Creating infrastructure resources...         
    INFO Waiting up to 20m0s for the Kubernetes API at https://api.gi3100.gi.priv.test:6443... 
    INFO API v1.20.0+bbbc079 up                       
    INFO Waiting up to 30m0s for bootstrapping to complete... 
    INFO Destroying the bootstrap resources...        
    INFO Waiting up to 40m0s for the cluster at https://api.gi3100.gi.priv.test:6443 to initialize... 
    INFO Waiting up to 10m0s for the openshift-console route to be created... 
    INFO Install complete!                            
    INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/root/gi3100-on-azure/auth/kubeconfig' 
    INFO Access the OpenShift web-console here: https://console-openshift-console.apps.gi3100.gi.priv.test 
    INFO Login to the console with user: "kubeadmin", and password: "2cVbo-4xsEq-s5Frc-tsxZN" 
    INFO Time elapsed: 36m49s

What to do next

For more information, see https://docs.openshift.com/container-platform/4.12/installing/installing_azure/installing-azure-account.html.