diff --git a/incubator/azuremonitor-containers/Chart.yaml b/incubator/azuremonitor-containers/Chart.yaml index b29d86e41f..afb2889668 100644 --- a/incubator/azuremonitor-containers/Chart.yaml +++ b/incubator/azuremonitor-containers/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 7.0.0-1 description: Helm chart for deploying Azure Monitor container monitoring agent in Kubernetes name: azuremonitor-containers -version: 2.4.0 +version: 2.5.0 kubeVersion: "^1.10.0-0" keywords: - monitoring diff --git a/incubator/azuremonitor-containers/README.md b/incubator/azuremonitor-containers/README.md index cbeb44fd3f..ae683af84b 100644 --- a/incubator/azuremonitor-containers/README.md +++ b/incubator/azuremonitor-containers/README.md @@ -4,7 +4,9 @@ ## Introduction -This article describes how to set up and use [Azure Monitor - Containers](https://docs.microsoft.com/en-us/azure/monitoring/monitoring-container-health) to monitor the health and performance of your workloads deployed to Kubernetes environments. Monitoring your Kubernetes cluster and containers is critical, especially when running a production cluster, at scale, with multiple applications. +This article describes how to set up and use [Azure Monitor - Containers](https://docs.microsoft.com/en-us/azure/monitoring/monitoring-container-health) to monitor the health and performance of your workloads deployed to Kubernetes environments. + +Monitoring your Kubernetes cluster and containers is critical, especially when running a production cluster, at scale, with multiple applications. --- @@ -27,13 +29,13 @@ This article describes how to set up and use [Azure Monitor - Containers](https: ## Installing the Chart +> Note: `--name` flag not required in Helm3 since this flag is deprecated ### To Use Azure Log Analytics Workspace in Public Cloud ```bash $ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ $ helm install --name myrelease-1 \ --set omsagent.secret.wsid=,omsagent.secret.key=,omsagent.env.clusterName= incubator/azuremonitor-containers - ``` ### To Use Azure Log Analytics Workspace in Azure China Cloud @@ -56,7 +58,7 @@ $ helm install --name myrelease-1 \ ## Uninstalling the Chart To uninstall/delete the `myrelease-1` release: - +> Note: `--purge` flag not required in Helm3 since this flag deprecated ```bash $ helm del --purge myrelease-1 @@ -77,7 +79,7 @@ The following table lists the configurable parameters of the MSOMS chart and the | `omsagent.image.pullPolicy`| `msoms` image pull policy. | IfNotPresent | | `omsagent.secret.wsid` | Azure Log analytics workspace id | Does not have a default value, needs to be provided | | `omsagent.secret.key` | Azure Log analytics workspace key | Does not have a default value, needs to be provided | -| `omsagent.domain` | Azure Log analytics cloud domain (public,china, us govt) | opinsights.azure.com (Public cloud as default), opinsights.azure.cn (China Cloud), opinsights.azure.us (US Govt Cloud) | +| `omsagent.domain` | Azure Log analytics cloud domain (public,china, us govt)| opinsights.azure.com (Public cloud as default), opinsights.azure.cn (China Cloud), opinsights.azure.us (US Govt Cloud) | | `omsagent.env.clusterName` | Name of your cluster | Does not have a default value, needs to be provided | | `omsagent.rbac` | rbac enabled/disabled | true (i.e enabled) | @@ -95,6 +97,7 @@ You can create a Azure Loganalytics workspace from portal.azure.com and get its Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + ```bash $ helm install --name myrelease-1 \ diff --git a/incubator/azuremonitor-containers/templates/NOTES.txt b/incubator/azuremonitor-containers/templates/NOTES.txt index d846c8124f..6179b6f1a1 100644 --- a/incubator/azuremonitor-containers/templates/NOTES.txt +++ b/incubator/azuremonitor-containers/templates/NOTES.txt @@ -14,7 +14,7 @@ {{- end }} -{{- if eq .Values.omsagent.env.clusterName "" }} +{{- if and (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId "") }} ############################################################################## #### ERROR: You did not provide cluster name #### @@ -22,7 +22,7 @@ {{- end }} -{{- if or (eq .Values.omsagent.secret.key "") (eq .Values.omsagent.secret.wsid "") (eq .Values.omsagent.env.clusterName "")}} +{{- if or (eq .Values.omsagent.secret.key "") (eq .Values.omsagent.secret.wsid "") (and (eq .Values.omsagent.env.clusterName "") (eq .Values.omsagent.env.clusterId ""))}} This deployment will not complete. To proceed, run helm upgrade {{ .Release.Name }} \ diff --git a/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml b/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml index c76730aeb8..833dc49e17 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml @@ -1,4 +1,4 @@ -{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (ne .Values.omsagent.env.clusterName "")}} +{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (or (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId ""))}} apiVersion: extensions/v1beta1 kind: DaemonSet metadata: @@ -34,8 +34,17 @@ spec: resources: {{ toYaml .Values.omsagent.resources.daemonset | indent 9 }} env: + {{- if ne .Values.omsagent.env.clusterId "" }} + - name: AKS_RESOURCE_ID + value: {{ .Values.omsagent.env.clusterId | quote }} + {{- if ne .Values.omsagent.env.clusterRegion "" }} + - name: AKS_REGION + value: {{ .Values.omsagent.env.clusterRegion | quote }} + {{- end }} + {{- else }} - name: ACS_RESOURCE_NAME value: {{ .Values.omsagent.env.clusterName | quote }} + {{- end }} - name: CONTROLLER_TYPE value: "DaemonSet" - name: NODE_IP diff --git a/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml b/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml index 77054ce2d0..36ae5238b7 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml @@ -1,4 +1,4 @@ -{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (ne .Values.omsagent.env.clusterName "")}} +{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (or (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId ""))}} apiVersion: extensions/v1beta1 kind: Deployment metadata: @@ -38,8 +38,17 @@ spec: resources: {{ toYaml .Values.omsagent.resources.deployment | indent 9 }} env: + {{- if ne .Values.omsagent.env.clusterId "" }} + - name: AKS_RESOURCE_ID + value: {{ .Values.omsagent.env.clusterId | quote }} + {{- if ne .Values.omsagent.env.clusterRegion "" }} + - name: AKS_REGION + value: {{ .Values.omsagent.env.clusterRegion | quote }} + {{- end }} + {{- else }} - name: ACS_RESOURCE_NAME value: {{ .Values.omsagent.env.clusterName | quote }} + {{- end }} - name: CONTROLLER_TYPE value: "ReplicaSet" - name: NODE_IP diff --git a/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml b/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml index 3eeb55112b..51d2bd06f8 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml @@ -1,4 +1,4 @@ -{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (ne .Values.omsagent.env.clusterName "")}} +{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (or (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId ""))}} kind: ConfigMap apiVersion: v1 data: diff --git a/incubator/azuremonitor-containers/templates/omsagent-secret.yaml b/incubator/azuremonitor-containers/templates/omsagent-secret.yaml index cdb15ec015..5923fb7776 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-secret.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-secret.yaml @@ -1,4 +1,4 @@ -{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (ne .Values.omsagent.env.clusterName "")}} +{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (or (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId ""))}} apiVersion: v1 kind: Secret metadata: @@ -13,4 +13,4 @@ data: WSID: {{ required "A valid workspace id is required!" .Values.omsagent.secret.wsid | b64enc | quote }} KEY: {{ required "A valid workspace key is required!" .Values.omsagent.secret.key | b64enc | quote }} DOMAIN: {{ .Values.omsagent.domain | b64enc | quote }} -{{- end }} +{{- end }} diff --git a/incubator/azuremonitor-containers/values.yaml b/incubator/azuremonitor-containers/values.yaml index bd3733d0b7..00779d2de8 100644 --- a/incubator/azuremonitor-containers/values.yaml +++ b/incubator/azuremonitor-containers/values.yaml @@ -19,6 +19,9 @@ omsagent: domain: opinsights.azure.com env: clusterName: +## Applicable for only managed clusters hosted in Azure + clusterId: + clusterRegion: rbac: true logsettings: logflushintervalsecs: ""