|
| 1 | +--- |
| 2 | +title: Configure Azure Red Hat OpenShift clusters with Azure Monitor for containers | Microsoft Docs |
| 3 | +description: This article describes how you can configure Azure Monitor for containers to monitor Kubernetes clusters hosted on Azure Red Hat OpenShift. |
| 4 | +ms.service: azure-monitor |
| 5 | +ms.subservice: |
| 6 | +ms.topic: conceptual |
| 7 | +author: mgoedtel |
| 8 | +ms.author: magoedte |
| 9 | +ms.date: 11/18/2019 |
| 10 | +--- |
| 11 | + |
| 12 | +# Configure Azure Red Hat OpenShift clusters with Azure Monitor for containers |
| 13 | + |
| 14 | +Azure Monitor for containers provides rich monitoring experience for the Azure Kubernetes Service (AKS) and AKS Engine clusters. This article describes how to enable monitoring of Kubernetes clusters hosted on [Azure Red Hat OpenShift](../../openshift/intro-openshift.md) to achieve a similar monitoring experience. |
| 15 | + |
| 16 | +Azure Monitor for containers can be enabled for new, or one or more existing deployments of Azure Red Hat OpenShift using the following supported methods: |
| 17 | + |
| 18 | +- For an existing cluster from the Azure portal or using Azure Resource Manager template |
| 19 | +- For a new cluster using Azure Resource Manager template |
| 20 | + |
| 21 | +## Supported and unsupported features |
| 22 | + |
| 23 | +Azure Monitor for containers supports monitoring Azure Red Hat OpenShift as described in the [Overview](container-insights-overview.md) article, except for the following features: |
| 24 | + |
| 25 | +- Live data |
| 26 | +- Prometheus metrics scraping |
| 27 | +- Collecting metrics |
| 28 | +- Health feature |
| 29 | + |
| 30 | +## Prerequisites |
| 31 | + |
| 32 | +- To enable and access the features in Azure Monitor for containers, at a minimum you need to be a member of the Azure *Contributor* role in the Azure subscription, and a member of the [*Log Analytics Contributor*](../platform/manage-access.md#manage-access-using-azure-permissions) role of the Log Analytics workspace configured with Azure Monitor for containers. |
| 33 | + |
| 34 | +- To view the monitoring data, you are a member of the [*Log Analytics reader*](../platform/manage-access.md#manage-access-using-azure-permissions) role permission with the Log Analytics workspace configured with Azure Monitor for containers. |
| 35 | + |
| 36 | +## Enable for a new cluster using an Azure Resource Manager template |
| 37 | + |
| 38 | +Perform the following steps to deploy an Azure Red Hat OpenShift cluster with monitoring enabled. Before proceeding, review the tutorial [Create an Azure Red Hat OpenShift cluster](../../openshift/tutorial-create-cluster.md#prerequisites) to understand the dependencies that you need to configure so your environment is set up correctly. |
| 39 | + |
| 40 | +This method includes two JSON templates. One template specifies the configuration to deploy the cluster with monitoring enabled, and the other contains parameter values that you configure to specify the following: |
| 41 | + |
| 42 | +- The Azure Red Hat OpenShift cluster resource ID. |
| 43 | + |
| 44 | +- The resource group the cluster is deployed in. |
| 45 | + |
| 46 | +- [Azure Active Directory tenant ID](../../openshift/howto-create-tenant.md#create-a-new-azure-ad-tenant) noted after performing the steps to create one or one already created. |
| 47 | + |
| 48 | +- [Azure Active Directory client application ID](../../openshift/howto-aad-app-configuration.md#create-an-azure-ad-app-registration) noted after performing the steps to create one or one already created. |
| 49 | + |
| 50 | +- [Azure Active Directory Client secret](../../openshift/howto-aad-app-configuration.md#create-a-client-secret) noted after performing the steps to create one or one already created. |
| 51 | + |
| 52 | +- [Azure AD security group](../../openshift/howto-aad-app-configuration.md#create-an-azure-ad-security-group) noted after performing the steps to create one or one already created. |
| 53 | + |
| 54 | +- Resource ID of an existing Log Analytics workspace. |
| 55 | + |
| 56 | +- The number of master nodes to create in the cluster. |
| 57 | + |
| 58 | +- The number of compute nodes in the agent pool profile. |
| 59 | + |
| 60 | +- The number of infrastructure nodes in the agent pool profile. |
| 61 | + |
| 62 | +If you are unfamiliar with the concept of deploying resources by using a template, see: |
| 63 | + |
| 64 | +- [Deploy resources with Resource Manager templates and Azure PowerShell](../../azure-resource-manager/resource-group-template-deploy.md) |
| 65 | + |
| 66 | +- [Deploy resources with Resource Manager templates and the Azure CLI](../../azure-resource-manager/resource-group-template-deploy-cli.md) |
| 67 | + |
| 68 | +If you choose to use the Azure CLI, you first need to install and use the CLI locally. You must be running the Azure CLI version 2.0.65 or later. To identify your version, run `az --version`. If you need to install or upgrade the Azure CLI, see [Install the Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli). |
| 69 | + |
| 70 | +The Log Analytics workspace has to be created before you enable monitoring using Azure PowerShell or CLI. To create the workspace, you can set it up through [Azure Resource Manager](../../azure-monitor/platform/template-workspace-configuration.md), through [PowerShell](../scripts/powershell-sample-create-workspace.md?toc=%2fpowershell%2fmodule%2ftoc.json), or in the [Azure portal](../../azure-monitor/learn/quick-create-workspace.md). |
| 71 | + |
| 72 | +1. Download and save to a local folder, the Azure Resource Manager template and parameter file, to create a cluster with the monitoring add-on using the following commands: |
| 73 | + |
| 74 | + `curl -LO https://raw.githubusercontent.com/microsoft/OMS-docker/ci_feature/docs/aro/enable_monitoring_to_new_cluster/newClusterWithMonitoring.json` |
| 75 | + |
| 76 | + `curl -LO https://raw.githubusercontent.com/microsoft/OMS-docker/ci_feature/docs/aro/enable_monitoring_to_new_cluster/newClusterWithMonitoringParam.json` |
| 77 | + |
| 78 | +2. Sign in to Azure |
| 79 | + |
| 80 | + ```azurecli |
| 81 | + az login |
| 82 | + ``` |
| 83 | + |
| 84 | + If you have access to multiple subscriptions, run `az account set -s {subscription ID}` replacing `{subscription ID}` with the subscription you want to use. |
| 85 | + |
| 86 | +3. Create a resource group for your cluster if you don't already have one. For a list of Azure regions that supports OpenShift on Azure, see [Supported Regions](../../openshift/supported-resources.md#azure-regions). |
| 87 | +
|
| 88 | + ```azurecli |
| 89 | + az group create -g <clusterResourceGroup> -l <location> |
| 90 | + ``` |
| 91 | +
|
| 92 | +4. Edit the JSON parameter file **newClusterWithMonitoringParam.json** and update the following values: |
| 93 | +
|
| 94 | + - *location* |
| 95 | + - *clusterName* |
| 96 | + - *aadTenantId* |
| 97 | + - *aadClientId* |
| 98 | + - *aadClientSecret* |
| 99 | + - *aadCustomerAdminGroupId* |
| 100 | + - *workspaceResourceId* |
| 101 | + - *masterNodeCount* |
| 102 | + - *computeNodeCount* |
| 103 | + - *infraNodeCount* |
| 104 | +
|
| 105 | +5. The following step deploys the cluster with monitoring enabled by using the Azure CLI. |
| 106 | +
|
| 107 | + ```azurecli |
| 108 | + az group deployment create --resource-group <ClusterResourceGroupName> --template-file ./newClusterWithMonitoring.json --parameters @./newClusterWithMonitoringParam.json |
| 109 | + ``` |
| 110 | + |
| 111 | + The output resembles the following: |
| 112 | +
|
| 113 | + ```azurecli |
| 114 | + provisioningState : Succeeded |
| 115 | + ``` |
| 116 | +
|
| 117 | +## Enable for an existing cluster |
| 118 | +
|
| 119 | +Perform the following steps to enable monitoring of an Azure Red Hat OpenShift cluster deployed in Azure. You can accomplish this from the Azure portal or using the provided templates. |
| 120 | +
|
| 121 | +### From the Azure portal |
| 122 | + |
| 123 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 124 | +
|
| 125 | +2. On the Azure portal menu or from the Home page, select **Azure Monitor**. Under the **Insights** section, select **Containers**. |
| 126 | +
|
| 127 | +3. On the **Monitor - containers** page, select **Non-monitored clusters**. |
| 128 | +
|
| 129 | +4. From the list of non-monitored clusters, find the cluster in the list and click **Enable**. You can identify the results in the list by looking for the value **ARO** under the column **CLUSTER TYPE**. |
| 130 | +
|
| 131 | +5. On the **Onboarding to Azure Monitor for containers** page, if you have an existing Log Analytics workspace in the same subscription as the cluster, select it from the drop-down list. |
| 132 | + The list preselects the default workspace and location that the cluster is deployed to in the subscription. |
| 133 | +
|
| 134 | +  |
| 135 | +
|
| 136 | + >[!NOTE] |
| 137 | + >If you want to create a new Log Analytics workspace for storing the monitoring data from the cluster, follow the instructions in [Create a Log Analytics workspace](../../azure-monitor/learn/quick-create-workspace.md). Be sure to create the workspace in the same subscription that the RedHat OpenShift cluster is deployed to. |
| 138 | + |
| 139 | +After you've enabled monitoring, it might take about 15 minutes before you can view health metrics for the cluster. |
| 140 | +
|
| 141 | +### Enable using an Azure Resource Manager template |
| 142 | +
|
| 143 | +This method includes two JSON templates. One template specifies the configuration to enable monitoring, and the other contains parameter values that you configure to specify the following: |
| 144 | +
|
| 145 | +- The Azure RedHat OpenShift cluster resource ID. |
| 146 | +
|
| 147 | +- The resource group the cluster is deployed in. |
| 148 | +
|
| 149 | +- A Log Analytics workspace. |
| 150 | +
|
| 151 | +If you are unfamiliar with the concept of deploying resources by using a template, see: |
| 152 | +
|
| 153 | +- [Deploy resources with Resource Manager templates and Azure PowerShell](../../azure-resource-manager/resource-group-template-deploy.md) |
| 154 | +
|
| 155 | +- [Deploy resources with Resource Manager templates and the Azure CLI](../../azure-resource-manager/resource-group-template-deploy-cli.md) |
| 156 | +
|
| 157 | +If you choose to use the Azure CLI, you first need to install and use the CLI locally. You must be running the Azure CLI version 2.0.65 or later. To identify your version, run `az --version`. If you need to install or upgrade the Azure CLI, see [Install the Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli). |
| 158 | +
|
| 159 | +The Log Analytics workspace has to be created before you enable monitoring using Azure PowerShell or CLI. To create the workspace, you can set it up through [Azure Resource Manager](../../azure-monitor/platform/template-workspace-configuration.md), through [PowerShell](../scripts/powershell-sample-create-workspace.md?toc=%2fpowershell%2fmodule%2ftoc.json), or in the [Azure portal](../../azure-monitor/learn/quick-create-workspace.md). |
| 160 | +
|
| 161 | +1. Download the template and parameter file to update your cluster with the monitoring add-on using the following commands: |
| 162 | +
|
| 163 | + `curl -LO https://raw.githubusercontent.com/microsoft/OMS-docker/ci_feature/docs/aro/enable_monitoring_to_existing_cluster/existingClusterOnboarding.json` |
| 164 | +
|
| 165 | + `curl -LO https://raw.githubusercontent.com/microsoft/OMS-docker/ci_feature/docs/aro/enable_monitoring_to_existing_cluster/existingClusterParam.json` |
| 166 | +
|
| 167 | +2. Sign in to Azure |
| 168 | +
|
| 169 | + ```azurecli |
| 170 | + az login |
| 171 | + ``` |
| 172 | +
|
| 173 | + If you have access to multiple subscriptions, run `az account set -s {subscription ID}` replacing `{subscription ID}` with the subscription you want to use. |
| 174 | +
|
| 175 | +3. Specify the subscription of the Azure RedHat OpenShift cluster. |
| 176 | +
|
| 177 | + ```azurecli |
| 178 | + az account set --subscription "Subscription Name" |
| 179 | + ``` |
| 180 | +
|
| 181 | +4. Run the following command to identify the cluster location and resource ID: |
| 182 | +
|
| 183 | + ```azurecli |
| 184 | + az openshift show -g <clusterResourceGroup> -n <clusterName> |
| 185 | + ``` |
| 186 | +
|
| 187 | +5. Edit the JSON parameter file **existingClusterParam.json** and update the values *araResourceId* and *araResoruceLocation*. The value for **workspaceResourceId** is the full resource ID of your Log Analytics workspace, which includes the workspace name. |
| 188 | +
|
| 189 | +6. To deploy with Azure CLI, run the following commands: |
| 190 | +
|
| 191 | + ```azurecli |
| 192 | + az group deployment create --resource-group <ClusterResourceGroupName> --template-file ./ExistingClusterOnboarding.json --parameters @./existingClusterParam.json |
| 193 | + ``` |
| 194 | +
|
| 195 | + The output resembles the following: |
| 196 | +
|
| 197 | + ```azurecli |
| 198 | + provisioningState : Succeeded |
| 199 | + ``` |
| 200 | +
|
| 201 | +## Next steps |
| 202 | +
|
| 203 | +With monitoring enabled to collect health and resource utilization of your RedHat OpenShift cluster and workloads running on them, learn [how to use](container-insights-analyze.md) Azure Monitor for containers. |
0 commit comments