Getting started with Microsoft Azure Red Hat OpenShift

Learn how to get started on Microsoft Azure Red Hat® OpenShift®, including how to prepare your environment, deploy a cluster, and connect to your cluster.

You can also watch this interactive demonstration on how to install Azure Red Hat OpenShift and create a cluster.

Learn how to get started on Microsoft Azure Red Hat® OpenShift®, including how to prepare your environment, deploy a cluster, and connect to your cluster.

You can also watch this interactive demonstration on how to install Azure Red Hat OpenShift and create a cluster.

Deploy a Microsoft Azure Red Hat OpenShift cluster

1 hr

In this resource, you’ll learn how to set up your Microsoft Azure Red Hat® OpenShift® environment to deploy your cluster. For this learning path, we will create a public cluster, but you can also create a private cluster. For more information on deploying a private cluster, see “Create an Azure Red Hat OpenShift 4 private cluster” on Microsoft Learn. 

What will you learn?

  • Setting environment variables and resource groups
  • Creating a virtual network with two empty subnets 
  • Creating your cluster

What do you need before starting?

  • Completed all prerequisites

Variables and resource groups

  1. Sign into the Azure CLI by running az login and following the steps to authorize your account. 
  2. Set the following environment variables. You can change the values to suit your environment, but these defaults should work.
    AZR_RESOURCE_LOCATION=eastus # the location of your cluster
    AZR_RESOURCE_GROUP=openshift # the name of the resource group where you want to create your cluster
    AZR_CLUSTER=cluster # the name of your cluster
    AZR_PULL_SECRET=~/Downloads/pull-secret.txt # the download file of your Red Hat pull secret
  3. Create an Azure resource group.
    az group create \
      --name $AZR_RESOURCE_GROUP \
      --location $AZR_RESOURCE_LOCATION

Networking

Create a virtual network with two empty subnets.

  1. Create the virtual network.
    az network vnet create \
      --address-prefixes 10.0.0.0/22 \
      --name "$AZR_CLUSTER-aro-vnet-$AZR_RESOURCE_LOCATION" \
      --resource-group $AZR_RESOURCE_GROUP
  2. Create the control plane subnet.
    az network vnet subnet create \
      --resource-group $AZR_RESOURCE_GROUP \
      --vnet-name "$AZR_CLUSTER-aro-vnet-$AZR_RESOURCE_LOCATION" \
      --name "$AZR_CLUSTER-aro-control-subnet-$AZR_RESOURCE_LOCATION" \
      --address-prefixes 10.0.0.0/23 \
      --service-endpoints Microsoft.ContainerRegistry
  3. Create the machine subnet.
    az network vnet subnet create \
      --resource-group $AZR_RESOURCE_GROUP \
      --vnet-name "$AZR_CLUSTER-aro-vnet-$AZR_RESOURCE_LOCATION" \
      --name "$AZR_CLUSTER-aro-machine-subnet-$AZR_RESOURCE_LOCATION" \
      --address-prefixes 10.0.2.0/23 \
      --service-endpoints Microsoft.ContainerRegistry
  4. Disable network policies on the control plane subnet. This is required for the service to be able to connect to and manage the cluster.
    az network vnet subnet update \
      --name "$AZR_CLUSTER-aro-control-subnet-$AZR_RESOURCE_LOCATION" \
      --resource-group $AZR_RESOURCE_GROUP \
      --vnet-name "$AZR_CLUSTER-aro-vnet-$AZR_RESOURCE_LOCATION" \
      --disable-private-link-service-network-policies true

Create the cluster

This process will take between 30 and 45 minutes to create the cluster.

  1. Create your cluster.
    az aro create \
      --resource-group $AZR_RESOURCE_GROUP \
      --name $AZR_CLUSTER \
      --vnet "$AZR_CLUSTER-aro-vnet-$AZR_RESOURCE_LOCATION" \
      --master-subnet "$AZR_CLUSTER-aro-control-subnet-$AZR_RESOURCE_LOCATION" \
      --worker-subnet "$AZR_CLUSTER-aro-machine-subnet-$AZR_RESOURCE_LOCATION" \
      --pull-secret @$AZR_PULL_SECRET
  2. Get the OpenShift console URL.
    az aro show \
      --name $AZR_CLUSTER \
      --resource-group $AZR_RESOURCE_GROUP \
      -o tsv --query consoleProfile
  3. Get your OpenShift credentials.
    az aro list-credentials \
      --name $AZR_CLUSTER \
      --resource-group $AZR_RESOURCE_GROUP \
      -o tsv
  4. Use the URL and the credentials provided by the output of the last two commands to log into OpenShift via a web browser. Here, you can monitor and update your cluster as needed.

Once these steps are complete, your cluster is ready for application deployment, which you can do in the OpenShift console or via the CLI. 

Next, however, we’ll show you how to delete your cluster and resource group so you aren’t surprised with any unnecessary charges.

Previous resource
Prerequisites
Next resource
Delete a cluster
Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Subscribe to our newsletter, Red Hat Shares

Sign up now