Creating an Azure OpenShift Cluster

Prerequisites

Ensure that you have satisfied the requirements in the Other Prerequisites section.

Procedure

  1. Enter the following parameters for for the Azure CLI.
    • Subscription : the Azure sub ID
    • Location: name of the zone where the resource is to be created
    • Resource group: Group name which contains the resources specific to the cluster
    • Cluster name: name of the cluster.
    SUBSCRIPTIONID=abcd-1234
     
    LOCATION=northsouth  
     
    RESOURCEGROUP=ops
     
    CLUSTER=output
  2. Set Account subscription as follows.
    az account set --subscription $SUBSCRIPTIONID
  3. Register the Azure providers for Openshift as per your requirement.
    az provider register -n Microsoft.RedHatOpenShift --wait
    az provider register -n Microsoft.Compute --wait
    az provider register -n Microsoft.Storage --wait
    az provider register -n Microsoft.Authorization --wait
  4. Create a resource group.
    az group create \
      --name $RESOURCEGROUP \
      --location $LOCATION
  5. Create a network aro-vnet and add the the master and worker subnets.
    az network vnet create \
       --resource-group $RESOURCEGROUP \
       --name aro-vnet \
       --address-prefixes nn.n.n.n/nn
  6. Create master and worker subnets on the newly created vnet.
    az network vnet subnet create \
      --resource-group $RESOURCEGROUP \
      --vnet-name aro-vnet \
      --name master-subnet \
      --address-prefixes 10.0.0.0/23 \
      --service-endpoints Microsoft.ContainerRegistry
     
    az network vnet subnet create \
      --resource-group $RESOURCEGROUP \
      --vnet-name aro-vnet \
      --name worker-subnet \
      --address-prefixes 10.0.2.0/23 \
      --service-endpoints Microsoft.ContainerRegistry
  7. Update subnets to disable private links.
    az network vnet subnet update \
      --name master-subnet \
      --resource-group $RESOURCEGROUP \
      --vnet-name aro-vnet \
      --disable-private-link-service-network-policies true
  8. Create Azure OpenShift cluster.
    az aro create \
      --resource-group $RESOURCEGROUP \
      --name $CLUSTER \
      --vnet aro-vnet \
      --master-subnet master-subnet \
      --worker-subnet worker-subnet \
      --worker-count 3
     [--master-vm-size]
     [--worker-vm-size]
     
    Note: [--master-vm-size] and [--worker-vm-size] are optional and may be included for modifying the VM size.

What to do next

  • Once the cluster creation is complete, list all cluster details as follows.
    az aro show --name $CLUSTER --resource-group $RESOURCEGROUP
    {
      "appId": "5781f9a3-b292-48b4-b597-f85872793a6c",
      "displayName": "mlocsp",
      "name": "http://mlocsp",
      "password": "Masherylocal007",
      "tenant": "cde6fa59-abb3-4971-be01-2443c417cbda" 
    }
  • List Cluster credentials to login into OpenShift cluster and fetch the kubeconfig details.
    az aro list-credentials \
      --name $CLUSTER \
      --resource-group $RESOURCEGROUP