|
| 1 | +--- |
| 2 | +title: Create a private cluster with Azure Red Hat OpenShift 3.11 | Microsoft Docs |
| 3 | +description: Create a private cluster with Azure Red Hat OpenShift 3.11 |
| 4 | +author: sakthi-vetrivel |
| 5 | +ms.author: suvetriv |
| 6 | +ms.service: container-service |
| 7 | +ms.topic: conceptual |
| 8 | +ms.date: 03/02/2020 |
| 9 | +keywords: aro, openshift, private cluster, red hat |
| 10 | +#Customer intent: As a customer, I want to create a private cluster on ARO OpenShift. |
| 11 | +--- |
| 12 | + |
| 13 | +# Create a private cluster with Azure Red Hat OpenShift 3.11 |
| 14 | + |
| 15 | +> [!IMPORTANT] |
| 16 | +> Azure Red Hat OpenShift (ARO) private clusters are currently only available in private preview in East US 2. Private preview acceptance is by invitation only. Please be sure to register your subscription before attempting to enable this feature. |
| 17 | +
|
| 18 | +Private clusters provide the following benefits: |
| 19 | + |
| 20 | +* Private clusters don't expose cluster control plane components (such as the API servers) on a public IP address. |
| 21 | +* The virtual network of a private cluster is configurable by customers, allowing you to set up networking to allow peering with other virtual networks, including ExpressRoute environments. You can also configure custom DNS on the virtual network to integrate with internal services. |
| 22 | + |
| 23 | +## Before you begin |
| 24 | + |
| 25 | +> [!NOTE] |
| 26 | +> This feature requires version 2019-10-27-preview of the ARO HTTP API. It is not yet supported in the Azure CLI. |
| 27 | +
|
| 28 | +The fields in the following configuration snippet are new and must be included in your cluster configuration. `managementSubnetCidr` must be within the cluster virtual network and is used by Azure to manage the cluster. |
| 29 | + |
| 30 | +```json |
| 31 | +properties: |
| 32 | + networkProfile: |
| 33 | + managementSubnetCidr: 10.0.1.0/24 |
| 34 | + masterPoolProfile: |
| 35 | + apiProperties: |
| 36 | + privateApiServer: true |
| 37 | +``` |
| 38 | + |
| 39 | +A private cluster can be deployed using the sample scripts provided below. Once the cluster is deployed, execute the `cluster get` command and view the `properties.FQDN` property to determine the private IP address of the OpenShift API server. |
| 40 | + |
| 41 | +The cluster virtual network will have been created with permissions so that you can modify it. You can then set up networking to access the virtual network (ExpressRoute, VPN, virtual network peering) as required for your needs. |
| 42 | + |
| 43 | +If you change the DNS nameservers on the cluster virtual network, then you will need to issue an update on the cluster with the `properties.RefreshCluster` property set to `true` so that the VMs can be reimaged. This update will allow them to pick up the new nameservers. |
| 44 | + |
| 45 | +## Sample configuration scripts |
| 46 | + |
| 47 | +Use the sample scripts in this section to set up and deploy your private cluster. |
| 48 | + |
| 49 | +### Environment |
| 50 | + |
| 51 | +Fill in the environment variables below as using your own values. |
| 52 | + |
| 53 | +> [!NOTE] |
| 54 | +> The location must be set to `eastus2` as this is currently the only supported location for private clusters. |
| 55 | +
|
| 56 | +``` bash |
| 57 | +export CLUSTER_NAME= |
| 58 | +export LOCATION=eastus2 |
| 59 | +export TOKEN=$(az account get-access-token --query 'accessToken' -o tsv) |
| 60 | +export SUBID= |
| 61 | +export TENANT_ID= |
| 62 | +export ADMIN_GROUP= |
| 63 | +export CLIENT_ID= |
| 64 | +export SECRET= |
| 65 | +``` |
| 66 | + |
| 67 | +### private-cluster.json |
| 68 | + |
| 69 | +Using the environment variables defined above, here is a sample cluster configuration with private cluster enabled. |
| 70 | + |
| 71 | +```json |
| 72 | +{ |
| 73 | + "location": "$LOCATION", |
| 74 | + "name": "$CLUSTER_NAME", |
| 75 | + "properties": { |
| 76 | + "openShiftVersion": "v3.11", |
| 77 | + "networkProfile": { |
| 78 | + "vnetCIDR": "10.0.0.0/8", |
| 79 | + "managementSubnetCIDR" : "10.0.1.0/24" |
| 80 | + }, |
| 81 | + "authProfile": { |
| 82 | + "identityProviders": [ |
| 83 | + { |
| 84 | + "name": "Azure AD", |
| 85 | + "provider": { |
| 86 | + "kind": "AADIdentityProvider", |
| 87 | + "clientId": "$CLIENT_ID", |
| 88 | + "secret": "$SECRET", |
| 89 | + "tenantId": "$TENANT_ID", |
| 90 | + "customerAdminGroupID": "$ADMIN_GROUP" |
| 91 | + } |
| 92 | + } |
| 93 | + ] |
| 94 | + }, |
| 95 | + "masterPoolProfile": { |
| 96 | + "name": "master", |
| 97 | + "count": 3, |
| 98 | + "vmSize": "Standard_D4s_v3", |
| 99 | + "osType": "Linux", |
| 100 | + "subnetCIDR": "10.0.0.0/24", |
| 101 | + "apiProperties": { |
| 102 | + "privateApiServer": true |
| 103 | + } |
| 104 | + }, |
| 105 | + "agentPoolProfiles": [ |
| 106 | + { |
| 107 | + "role": "compute", |
| 108 | + "name": "compute", |
| 109 | + "count": 1, |
| 110 | + "vmSize": "Standard_D4s_v3", |
| 111 | + "osType": "Linux", |
| 112 | + "subnetCIDR": "10.0.0.0/24" |
| 113 | + }, |
| 114 | + { |
| 115 | + "role": "infra", |
| 116 | + "name": "infra", |
| 117 | + "count": 3, |
| 118 | + "vmSize": "Standard_D4s_v3", |
| 119 | + "osType": "Linux", |
| 120 | + "subnetCIDR": "10.0.0.0/24" |
| 121 | + } |
| 122 | + ], |
| 123 | + "routerProfiles": [ |
| 124 | + { |
| 125 | + "name": "default" |
| 126 | + } |
| 127 | + ] |
| 128 | + } |
| 129 | +} |
| 130 | +``` |
| 131 | + |
| 132 | +## Deploy a private cluster |
| 133 | + |
| 134 | +After configuring your private cluster with the sample scripts above, run the following command to deploy your private cluster. |
| 135 | + |
| 136 | +``` bash |
| 137 | +az group create --name $CLUSTER_NAME --location $LOCATION |
| 138 | +cat private-cluster.json | envsubst | curl -v -X PUT \ |
| 139 | +-H 'Content-Type: application/json; charset=utf-8' \ |
| 140 | +-H 'Authorization: Bearer '$TOKEN'' -d @- \ |
| 141 | + https://management.azure.com/subscriptions/$SUBID/resourceGroups/$CLUSTER_NAME/providers/Microsoft.ContainerService/openShiftManagedClusters/$CLUSTER_NAME?api-version=2019-10-27-preview |
| 142 | +``` |
| 143 | + |
| 144 | +## Next steps |
| 145 | + |
| 146 | +To learn about how to access the OpenShift console, see [Web Console Walkthrough](https://docs.openshift.com/container-platform/3.11/getting_started/developers_console.html). |
0 commit comments