OpenShift on Azure: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 13: Line 13:
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
az aro list
az aro list
</syntaxhighlight>
==List Details about a Specific Cluster==
<syntaxhighlight lang='bash'>
az aro show --resource-group <rg-name> --name <cluster-name>
</syntaxhighlight>
</syntaxhighlight>



Revision as of 23:22, 19 November 2020

External

Internal

CLI Support

Azure CLI has an OpenShift extension, with subcommands aimed at managing Azure Red Hat OpenShift clusters.

az aro create|list|delete|list-credentials|show|update|wait

List OpenShift Clusters

az aro list

List Details about a Specific Cluster

az aro show --resource-group <rg-name> --name <cluster-name>

Installation

Prerequisites

Procedure

Create the Resource Group

The resource group can be created from the console or from command line. The resource group it will encapsulate resources required by, and dedicated to the OpenShift cluster. The name of the resource group should be derived from the name of the cluster by adding the "-rg" postfix. There will be a one-to-one relationship between the resource group, cluster and ancillary resources. Select the appropriate region and set the corresponding LOCATION environment variable.

export CLUSTER=platform-cloud-aro-02
export RESOURCEGROUP="${CLUSTER}-rg"
export LOCATION=eastus2

az group create --name $RESOURCEGROUP --location $LOCATION

Register Resource Providers

export SUBSCRIPTION_ID="..."
az account set --subscription ${SUBSCRIPTION_ID}

Register the Microsoft.RedHatOpenShift, Microsoft.Compute and Microsoft.Storage resource providers:

az provider register -n Microsoft.RedHatOpenShift --wait
az provider register -n Microsoft.Compute --wait
az provider register -n Microsoft.Storage --wait

Get a Red Hat Pull Secret

https://docs.microsoft.com/en-us/azure/openshift/tutorial-create-cluster#get-a-red-hat-pull-secret-optional

TODO

Prepare a Custom Domain

https://docs.microsoft.com/en-us/azure/openshift/tutorial-create-cluster#prepare-a-custom-domain-for-your-cluster-optional

TODO

Create a Virtual Network and associated Subnets

https://docs.microsoft.com/en-us/azure/openshift/tutorial-create-cluster#create-a-virtual-network-containing-two-empty-subnets

Azure Red Hat OpenShift clusters require a virtual network with two empty subnets, for the master and worker nodes. The virtual network can be created as such (for more details about networking operations, see Azure Networking Operations):

az network vnet create \
  --resource-group $RESOURCEGROUP \
  --name ${CLUSTER}-vnet \
  --address-prefixes 10.0.0.0/16

az network vnet subnet create \
  --resource-group $RESOURCEGROUP \
  --vnet-name ${CLUSTER}-vnet \
  --name ${CLUSTER}-master-subnet \
  --address-prefixes 10.0.0.0/17 \
  --service-endpoints Microsoft.ContainerRegistry

az network vnet subnet create \
  --resource-group $RESOURCEGROUP \
  --vnet-name ${CLUSTER}-vnet \
  --name ${CLUSTER}-worker-subnet \
  --address-prefixes 10.0.128.0/17 \
  --service-endpoints Microsoft.ContainerRegistry

Disable subnet private endpoint policies on the master subnet. This is required for the service to be able to connect to and manage the cluster:

az network vnet subnet update \
  --name ${CLUSTER}-master-subnet \
  --resource-group $RESOURCEGROUP \
  --vnet-name ${CLUSTER}-vnet \
  --disable-private-link-service-network-policies true

Create the Cluster

https://docs.microsoft.com/en-us/azure/openshift/tutorial-create-cluster#create-the-cluster
az aro create \
  --resource-group $RESOURCEGROUP \
  --name $CLUSTER \
  --vnet ${CLUSTER}-vnet \
  --master-subnet ${CLUSTER}-master-subnet \
  --worker-subnet ${CLUSTER}-worker-subnet \
  --ingress-visibility Public \
  --worker-count 3 \
  --worker-vm-disk-size-gb 200

It normally takes about 35 minutes to create a cluster.

TODO:

Organizatorium

az aro list-credentials --name ${CLUSTER} --resource-group ${RESOURCEGROUP}