This repo includes the development az aro
extension. If you have a
whitelisted subscription, it can be used against the pre-GA Azure Red Hat
OpenShift v4 service, or (by setting RP_MODE=development
) it can be used
against a development RP running at https://localhost:8443/.
-
Install a supported version of Python, if you don't have one installed already. The
az
client supports Python 2.7 and Python 3.5+. A recent Python 3.x version is recommended. -
Install the
az
client, if you haven't already. -
Log in to Azure:
az login
-
Git clone this repository to your local machine:
git clone https://github.com/jim-minter/rp cd rp
Note: you will be able to update the
az aro
extension in the future by simply runninggit pull
. -
Build the development
az aro
extension:make az
-
Add the ARO extension path to your
az
configuration:cat >>~/.azure/config <<EOF [extension] dev_sources = $PWD/python EOF
-
Verify the ARO extension is registered:
az -v ... Extensions: aro 0.1.0 (dev) /path/to/rp/python/az/aro ... Development extension sources: /path/to/rp/python ...
If using the pre-GA Azure Red Hat OpenShift v4 service with a whitelisted
subscription, ensure that the Microsoft.RedHatOpenShift
resource provider is
registered:
az provider register -n Microsoft.RedHatOpenShift --wait
You will need the following in order to create an Azure Red Hat OpenShift v4 cluster:
-
A vnet containing two empty subnets, each with no network security group attached. Your cluster will be deployed into these subnets.
RESOURCEGROUP=cluster-rg CLUSTER=cluster az group create -g "$RESOURCEGROUP" -l eastus az network vnet create -g "$RESOURCEGROUP" -n vnet --address-prefixes 10.0.0.0/9 for subnet in "$CLUSTER-master" "$CLUSTER-worker"; do az network vnet subnet create -g "$RESOURCEGROUP" --vnet-name vnet -n "$subnet" --address-prefixes 10.$((RANDOM & 127)).$((RANDOM & 255)).0/24 done
-
A cluster AAD application (client ID and secret) and service principal, or sufficient AAD permissions for
az aro create
to create these for you automatically. -
The RP service principal and cluster service principal must each have the Contributor role on the cluster vnet. If you have the "User Access Administrator" role on the vnet,
az aro create
will set up the role assignments for you automatically.
-
Create a cluster:
az aro create -g "$RESOURCEGROUP" -n "$CLUSTER" --vnet vnet --master-subnet "$CLUSTER-master" --worker-subnet "$CLUSTER-worker"
Note: cluster creation takes about 45 minutes.
-
Access the cluster console:
You can find the cluster console URL (of the form
https://console-openshift-console.apps.<random>.eastus.aroapp.io/
) in the Azure Red Hat OpenShift v4 cluster resource:az aro list -o table
You can log into the cluster using the
kubeadmin
user. The password for thekubeadmin
user can be found as follows:az aro get-credentials -g "$RESOURCEGROUP" -n "$CLUSTER"
Note: the cluster console certificate is not yet signed by a CA: expect a security warning in your browser.
-
Scale the number of cluster VMs:
COUNT=4 az aro update -g "$RESOURCEGROUP" -n "$CLUSTER" --worker-count "$COUNT"
-
Delete a cluster:
az aro delete -g "$RESOURCEGROUP" -n "$CLUSTER" # (optionally) for subnet in "$CLUSTER-master" "$CLUSTER-worker"; do az network vnet subnet delete -g "$RESOURCEGROUP" --vnet-name vnet -n "$subnet" done