Skip to content

Instantly share code, notes, and snippets.

@mkol5222
Forked from sabbour/aro-create.sh
Last active February 10, 2025 10:07
Show Gist options
  • Save mkol5222/a290522c6aaaaa92f29424b7b28773b7 to your computer and use it in GitHub Desktop.
Save mkol5222/a290522c6aaaaa92f29424b7b28773b7 to your computer and use it in GitHub Desktop.
Create an Azure Red Hat OpenShift cluster
LOCATION=northeurope # the location of your cluster
RESOURCEGROUP=aro-rg # the name of the resource group where you want to create your cluster
CLUSTER=aro # the name of your cluster
az group create \
--name $RESOURCEGROUP \
--location $LOCATION
az network vnet create \
--resource-group $RESOURCEGROUP \
--name aro-vnet \
--address-prefixes 10.0.0.0/22
az network vnet subnet create \
--resource-group $RESOURCEGROUP \
--vnet-name aro-vnet \
--name master-subnet \
--address-prefixes 10.0.0.0/23
az network vnet subnet create \
--resource-group $RESOURCEGROUP \
--vnet-name aro-vnet \
--name worker-subnet \
--address-prefixes 10.0.2.0/23
time az aro create \
--resource-group $RESOURCEGROUP \
--name $CLUSTER \
--vnet aro-vnet \
--master-subnet master-subnet \
--worker-subnet worker-subnet
az aro list-credentials \
--name $CLUSTER \
--resource-group $RESOURCEGROUP
az aro show \
--name $CLUSTER \
--resource-group $RESOURCEGROUP \
--query "consoleProfile.url" -o tsv
# via https://learn.microsoft.com/en-us/azure/openshift/connect-cluster
cd ~
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz
mkdir openshift
tar -zxvf openshift-client-linux.tar.gz -C openshift
echo 'export PATH=$PATH:~/openshift' >> ~/.bashrc && source ~/.bashrc
export PATH=$PATH:~/openshift
which oc
az group delete --name $RESOURCEGROUP --yes --no-wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment