From d49c8d54fc7fb2e2ce36d8e28c6fd3b64474c437 Mon Sep 17 00:00:00 2001 From: ganga1980 Date: Fri, 4 Oct 2019 10:14:04 -0700 Subject: [PATCH] incubator/azuremonitor-containers - (set image repo corresponding cloud and doc updates) (#17277) * updates related to support for other azure clouds Signed-off-by: Ganga Mahesh Siddem * use latest agent image Signed-off-by: Ganga Mahesh Siddem * fix pr feedback Signed-off-by: Ganga Mahesh Siddem * use latest docker provider version Signed-off-by: Ganga Mahesh Siddem * improve notes.txt file Signed-off-by: Ganga Mahesh Siddem * improve readme and notes Signed-off-by: Ganga Mahesh Siddem * fix oms tags related to kube health Signed-off-by: Ganga Mahesh Siddem --- incubator/azuremonitor-containers/Chart.yaml | 4 +- incubator/azuremonitor-containers/README.md | 54 ++++++++++++++----- .../templates/NOTES.txt | 25 ++++++--- .../templates/omsagent-daemonset.yaml | 20 ++++--- .../templates/omsagent-deployment.yaml | 18 ++++--- .../templates/omsagent-rs-configmap.yaml | 8 +-- incubator/azuremonitor-containers/values.yaml | 6 +-- 7 files changed, 91 insertions(+), 44 deletions(-) diff --git a/incubator/azuremonitor-containers/Chart.yaml b/incubator/azuremonitor-containers/Chart.yaml index 1d6caf64ec..9ed61ffe68 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.0.0 +version: 2.1.0 keywords: - monitoring - azuremonitor @@ -16,6 +16,8 @@ keywords: - kubernetesmonitoring - acs-engine - aks-engine + - azurestack + - on-prem kubernetes monitoring - containerlogs - containerhealth - containermonitoring diff --git a/incubator/azuremonitor-containers/README.md b/incubator/azuremonitor-containers/README.md index bd072af65c..a7d4318934 100644 --- a/incubator/azuremonitor-containers/README.md +++ b/incubator/azuremonitor-containers/README.md @@ -20,12 +20,15 @@ This article describes how to set up and use [Azure Monitor - Containers](https: 2. [Add the 'AzureMonitor-Containers' Solution to your Log Analytics workspace.](http://aka.ms/coinhelmdoc) -3. [For AKS-Engine or ACS-Engine K8S cluster, add required tags on cluster resources, to be able to use Azure Container monitoring User experience (aka.ms/azmon-containers)](http://aka.ms/coin-acs-tag-doc) +3. [For AKS-Engine or ACS-Engine K8S cluster hosted in Azure, add required tags on cluster resources, to be able to use Azure Container monitoring User experience (aka.ms/azmon-containers)](http://aka.ms/coin-acs-tag-doc) + > Note: Pre-requisite #3 not applicable for the AKS-Engine or ACS-Engine clusters hosted in Azure Stack or On-premise. --- ## Installing the Chart +### 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 \ @@ -33,6 +36,23 @@ $ helm install --name myrelease-1 \ ``` +### To Use Azure Log Analytics Workspace in Azure China Cloud + +```bash +$ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ +$ helm install --name myrelease-1 \ +--set omsagent.domain=opinsights.azure.cn,omsagent.secret.wsid=,omsagent.secret.key=,omsagent.env.clusterName= incubator/azuremonitor-containers +``` + +### To Use Azure Log Analytics Workspace in Azure US Government Cloud + +```bash +$ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ +$ helm install --name myrelease-1 \ +--set omsagent.domain=opinsights.azure.us,omsagent.secret.wsid=,omsagent.secret.key=,omsagent.env.clusterName= incubator/azuremonitor-containers +``` + + ## Uninstalling the Chart To uninstall/delete the `myrelease-1` release: @@ -51,18 +71,21 @@ The following table lists the configurable parameters of the MSOMS chart and the The following table lists the configurable parameters of the MSOMS chart and their default values. -| Parameter | Description | Default | -| ----------------------- | ---------------------------------- | -------------------------------------------------------------------------------- | -| `omsagent.image.tag` | `msoms` image tag. | Most recent release | -| `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 / govt) | opinsights.azure.com (Public cloud as default), opinsights.azure.us (Govt Cloud) | -| `omsagent.env.clusterName` | Name of your cluster | Does not have a default value, needs to be provided. If AKS-Engine or ACS-Engine K8S cluster, it is recommended to provide either one of the below as cluster name, to be able to use Azure Container monitoring User experience (aka.ms/azmon-containers)

- Azure Resource group resource ID of ACS-Engine cluster
- Provide a friendly name here and ensure this name is used to 'tag' the cluster master node(s) - see step-3 in pre-requisites above | -| `omsagent.rbac` | rbac enabled/disabled | true (i.e enabled) | +| Parameter | Description | Default | +| ----------------------- | --------------------------------------------------------| -------------------------------------------------------------------------------- | +| `omsagent.image.tag` | `msoms` image tag. | Most recent release | +| `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.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) | ### Note -Parameter `omsagent.env.doNotCollectKubeSystemLogs` has been removed starting chart version 1.0.0. Refer to 'Agent data collection settings' section below to configure it using configmap. + +- Parameter `omsagent.env.doNotCollectKubeSystemLogs` has been removed starting chart version 1.0.0. Refer to 'Agent data collection settings' section below to configure it using configmap. +- onboarding of multiple clusters with the same cluster name to same log analytics workspace not supported. If need this configuration, use the cluster FQDN name rather than cluster dns prefix to avoid collision with clusterName + ## Agent data collection settings @@ -75,9 +98,9 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```bash $ helm install --name myrelease-1 \ ---set omsagent.secret.wsid=,omsagent.secret.key=,omsagent.env.clusterName= incubator/azuremonitor-containers +--set omsagent.secret.wsid=,omsagent.secret.key=,omsagent.env.clusterName= + incubator/azuremonitor-containers ``` - Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, ```bash @@ -86,7 +109,10 @@ $ helm install --name myrelease-1 -f values.yaml incubator/azuremonitor-containe ``` -After you successfully deploy the chart, you will be able to see your data in the [azure portal](aka.ms/azmon-containers) +After you successfully deploy the chart, you will be able to see your data in +- [azure public cloud portal](https://aka.ms/azmon-containers) for the clusters in Azure Public Cloud +- [azure china cloud portal](https://aka.ms/azmon-containers-mooncake) for the clusters in Azure China Cloud +- [azure us government cloud portal](https://aka.ms/azmon-containers-fairfax) for the clusters in Azure US Government Cloud If you need help with this chart, please reach us out through [this](mailto:askcoin@microsoft.com) email. diff --git a/incubator/azuremonitor-containers/templates/NOTES.txt b/incubator/azuremonitor-containers/templates/NOTES.txt index 27411afd1e..d846c8124f 100644 --- a/incubator/azuremonitor-containers/templates/NOTES.txt +++ b/incubator/azuremonitor-containers/templates/NOTES.txt @@ -24,17 +24,28 @@ {{- if or (eq .Values.omsagent.secret.key "") (eq .Values.omsagent.secret.wsid "") (eq .Values.omsagent.env.clusterName "")}} -This deployment will not complete. To proceed, run +This deployment will not complete. To proceed, run helm upgrade {{ .Release.Name }} \ --set omsagent.secret.wsid= \ - --set omsagent.secret.key= \ + --set omsagent.secret.key= \ --set omsagent.env.clusterName= \ incubator/azuremonitor-containers - + {{- else -}} -{{ .Release.Name }} deployment is complete. -Data should start flowing to the Log Analytics workspace shortly. -Proceed to https://aka.ms/azmon-containers if you would like to view this data. - +{{ .Release.Name }} deployment is complete. +{{ .Values.omsagent.domain}} is configured Azure Log Analytics Workspace Domain. +Data should start flowing to the Log Analytics workspace shortly. +Proceed to below link to view health and monitoring data of your clusters +{{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.com" }} +- Azure Public Cloud Portal URL : https://aka.ms/azmon-containers +{{- else if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} +- Azure China Cloud Portal URL: https://aka.ms/azmon-containers-mooncake +{{- else if eq (.Values.omsagent.domain | lower) "opinsights.azure.us" }} +- Azure US Government Cloud Portal URL: https://aka.ms/azmon-containers-fairfax +{{- else }} +######################################################################################## +#### ERROR: Provided omsagent.domain value either invalid or not supported #### +######################################################################################## +{{- end }} {{- end }} \ No newline at end of file diff --git a/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml b/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml index b3bb328871..aff3d2b648 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml @@ -24,8 +24,12 @@ spec: serviceAccountName: omsagent {{- end }} containers: - - name: omsagent + - name: omsagent + {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} + image: "dockerhub.azk8s.cn/microsoft/oms:{{ .Values.omsagent.image.tag }}" + {{- else }} image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" + {{- end }} imagePullPolicy: IfNotPresent resources: {{ toYaml .Values.omsagent.resources.daemonset | indent 9 }} @@ -54,7 +58,7 @@ spec: privileged: true ports: - containerPort: 25225 - protocol: TCP + protocol: TCP - containerPort: 25224 protocol: UDP volumeMounts: @@ -63,9 +67,9 @@ spec: readOnly: true - mountPath: /var/run/host name: docker-sock - - mountPath: /var/log + - mountPath: /var/log name: host-log - - mountPath: /var/lib/docker/containers + - mountPath: /var/lib/docker/containers name: containerlog-path - mountPath: /etc/kubernetes/host name: azure-json-path @@ -84,18 +88,18 @@ spec: initialDelaySeconds: 60 periodSeconds: 60 nodeSelector: - beta.kubernetes.io/os: linux + beta.kubernetes.io/os: linux # Tolerate a NoSchedule taint on master that ACS Engine sets. tolerations: - key: "node-role.kubernetes.io/master" operator: "Equal" value: "true" - effect: "NoSchedule" + effect: "NoSchedule" volumes: - name: host-root hostPath: path: / - - name: docker-sock + - name: docker-sock hostPath: path: /var/run - name: container-hostname @@ -117,4 +121,4 @@ spec: configMap: name: container-azm-ms-agentconfig optional: true -{{- end }} \ No newline at end of file +{{- end }} \ No newline at end of file diff --git a/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml b/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml index 7212e36ca9..377050b242 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml @@ -28,8 +28,12 @@ spec: serviceAccountName: omsagent {{- end }} containers: - - name: omsagent + - name: omsagent + {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} + image: "dockerhub.azk8s.cn/microsoft/oms:{{ .Values.omsagent.image.tag }}" + {{- else }} image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" + {{- end }} imagePullPolicy: IfNotPresent resources: {{ toYaml .Values.omsagent.resources.deployment | indent 9 }} @@ -41,12 +45,12 @@ spec: - name: NODE_IP valueFrom: fieldRef: - fieldPath: status.hostIP + fieldPath: status.hostIP securityContext: privileged: true ports: - containerPort: 25225 - protocol: TCP + protocol: TCP - containerPort: 25224 protocol: UDP - containerPort: 25227 @@ -55,9 +59,9 @@ spec: volumeMounts: - mountPath: /var/run/host name: docker-sock - - mountPath: /var/log + - mountPath: /var/log name: host-log - - mountPath: /var/lib/docker/containers + - mountPath: /var/lib/docker/containers name: containerlog-path - mountPath: /etc/kubernetes/host name: azure-json-path @@ -81,7 +85,7 @@ spec: beta.kubernetes.io/os: linux kubernetes.io/role: agent volumes: - - name: docker-sock + - name: docker-sock hostPath: path: /var/run - name: container-hostname @@ -106,4 +110,4 @@ spec: configMap: name: container-azm-ms-agentconfig optional: true -{{- end }} \ No newline at end of file +{{- end }} \ No newline at end of file diff --git a/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml b/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml index 43a23f581c..f1f7d004d7 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml @@ -61,7 +61,7 @@ data: #Kubernetes health type kubehealth - tag oms.api.KubeHealth.ReplicaSet + tag kubehealth.ReplicaSet run_interval 60s log_level debug @@ -89,7 +89,7 @@ data: #health model aggregation filter - + type filter_health_model_builder @@ -178,7 +178,7 @@ data: max_retry_wait 9m - + type out_oms log_level debug num_threads 5 @@ -258,4 +258,4 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- end }} \ No newline at end of file +{{- end }} \ No newline at end of file diff --git a/incubator/azuremonitor-containers/values.yaml b/incubator/azuremonitor-containers/values.yaml index acfa661d7e..3667de66ce 100644 --- a/incubator/azuremonitor-containers/values.yaml +++ b/incubator/azuremonitor-containers/values.yaml @@ -6,9 +6,9 @@ ## ref: https://github.com/Microsoft/OMS-docker/tree/ci_feature_prod omsagent: image: - tag: "ciprod09092019" + tag: "ciprod09262019" pullPolicy: IfNotPresent - dockerProviderVersion: "7.0.0-1" + dockerProviderVersion: "7.0.0-3" agentVersion: "1.10.0.1" ## To get your workspace id and key do the following ## You can create a Azure Loganalytics workspace from portal.azure.com and get its ID & PRIMARY KEY from 'Advanced Settings' tab in the Ux. @@ -18,7 +18,7 @@ omsagent: key: domain: opinsights.azure.com env: - clusterName: + clusterName: rbac: true logsettings: logflushintervalsecs: ""