From 5a17da286f19aef36beec70bcf47ad57d237b8e7 Mon Sep 17 00:00:00 2001 From: ganga1980 Date: Thu, 23 Jan 2020 16:56:32 -0800 Subject: [PATCH] update to december agent with 1.16 support (#20309) Signed-off-by: Ganga Mahesh Siddem --- incubator/azuremonitor-containers/Chart.yaml | 2 +- incubator/azuremonitor-containers/README.md | 6 +- .../templates/omsagent-daemonset.yaml | 21 ++-- .../templates/omsagent-deployment.yaml | 10 +- .../templates/omsagent-rbac.yaml | 4 +- .../templates/omsagent-rs-configmap.yaml | 117 +++++++----------- incubator/azuremonitor-containers/values.yaml | 46 +++++-- 7 files changed, 105 insertions(+), 101 deletions(-) diff --git a/incubator/azuremonitor-containers/Chart.yaml b/incubator/azuremonitor-containers/Chart.yaml index afb2889668..4a4be930ef 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.5.0 +version: 2.6.0 kubeVersion: "^1.10.0-0" keywords: - monitoring diff --git a/incubator/azuremonitor-containers/README.md b/incubator/azuremonitor-containers/README.md index ae683af84b..26a040bed9 100644 --- a/incubator/azuremonitor-containers/README.md +++ b/incubator/azuremonitor-containers/README.md @@ -54,6 +54,10 @@ $ helm install --name myrelease-1 \ --set omsagent.domain=opinsights.azure.us,omsagent.secret.wsid=,omsagent.secret.key=,omsagent.env.clusterName= incubator/azuremonitor-containers ``` +## Upgrading an existing Release to a new version + +If the previous version of the chart installed with Helm2, it can be upgraded successfully to current version using Helm2. +But, if the previous version of chart installed with the Helm3 or release migrated to Helm3,then chart can’t be upgraded to latest version due to issues in Helm3 with regards to upgrading the existing release to new version, as described in [Helm issue #6850](https://github.com/helm/helm/issues/6850) ## Uninstalling the Chart @@ -64,7 +68,6 @@ To uninstall/delete the `myrelease-1` release: $ helm del --purge myrelease-1 ``` - The command removes all the Kubernetes components associated with the chart and deletes the release. ## Configuration @@ -88,7 +91,6 @@ The following table lists the configurable parameters of the MSOMS chart and the - 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 Staring with chart version 1.0.0, agent data collection settings are controlled thru a config map. Refer to documentation about agent data collection settings [here](https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-agent-config) diff --git a/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml b/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml index 833dc49e17..5417a43f25 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-daemonset.yaml @@ -1,5 +1,5 @@ {{- 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 +apiVersion: apps/v1 kind: DaemonSet metadata: name: omsagent @@ -8,9 +8,14 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + component: oms-agent + tier: node spec: updateStrategy: type: RollingUpdate + selector: + matchLabels: + dsName: "omsagent-ds" template: metadata: labels: @@ -98,14 +103,12 @@ spec: periodSeconds: 60 nodeSelector: beta.kubernetes.io/os: linux - # Tolerate below taints on nodes of k8s clusters to schedule ds pod. - tolerations: - - operator: "Exists" - effect: "NoSchedule" - - operator: "Exists" - effect: "NoExecute" - - operator: "Exists" - effect: "PreferNoSchedule" + {{- with .Values.omsagent.affinity }} + affinity: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.omsagent.tolerations }} + tolerations: {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: host-root hostPath: diff --git a/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml b/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml index 36ae5238b7..2cd63aac83 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-deployment.yaml @@ -1,5 +1,5 @@ {{- 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 +apiVersion: apps/v1 kind: Deployment metadata: name: omsagent-rs @@ -8,6 +8,8 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + component: oms-agent + tier: node spec: replicas: 1 selector: @@ -92,6 +94,12 @@ spec: periodSeconds: 60 nodeSelector: beta.kubernetes.io/os: linux + {{- with .Values.omsagent.affinity }} + affinity: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.omsagent.tolerations }} + tolerations: {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: docker-sock hostPath: diff --git a/incubator/azuremonitor-containers/templates/omsagent-rbac.yaml b/incubator/azuremonitor-containers/templates/omsagent-rbac.yaml index 6a446e061e..2a261d7d3d 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-rbac.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-rbac.yaml @@ -19,9 +19,9 @@ metadata: heritage: {{ .Release.Service }} rules: - apiGroups: [""] - resources: ["pods", "events", "nodes", "namespaces", "services"] + resources: ["pods", "events", "nodes", "nodes/stats", "nodes/metrics", "namespaces", "services"] verbs: ["list", "get", "watch"] -- apiGroups: ["extensions"] +- apiGroups: ["apps", "extensions"] resources: ["replicasets"] verbs: ["list"] - apiGroups: ["azmon.container.insights"] diff --git a/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml b/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml index 51d2bd06f8..60edab0659 100644 --- a/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml +++ b/incubator/azuremonitor-containers/templates/omsagent-rs-configmap.yaml @@ -9,13 +9,14 @@ data: type forward port "#{ENV['HEALTHMODEL_REPLICASET_SERVICE_SERVICE_PORT']}" bind 0.0.0.0 + chunk_size_limit 4m #Kubernetes pod inventory type kubepodinventory tag oms.containerinsights.KubePodInventory - run_interval 60s + run_interval 60 log_level debug @@ -23,46 +24,23 @@ data: type kubeevents tag oms.containerinsights.KubeEvents - run_interval 60s + run_interval 60 log_level debug - - - #Kubernetes logs - - type kubelogs - tag oms.api.KubeLogs - run_interval 60s - - - #Kubernetes services - - type kubeservices - tag oms.containerinsights.KubeServices - run_interval 60s - log_level debug - + #Kubernetes Nodes type kubenodeinventory tag oms.containerinsights.KubeNodeInventory - run_interval 60s + run_interval 60 log_level debug - - - #Kubernetes perf - - type kubeperf - tag oms.api.KubePerf - run_interval 60s - log_level debug - + #Kubernetes health type kubehealth tag kubehealth.ReplicaSet - run_interval 60s + run_interval 60 log_level debug @@ -70,20 +48,20 @@ data: type wincadvisorperf tag oms.api.wincadvisorperf - run_interval 60s + run_interval 60 log_level debug type filter_inventory2mdm - custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westEurope + custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westeurope,southafricanorth,centralus,northcentralus,eastus2,koreacentral,eastasia,centralindia,uksouth,canadacentral,francecentral,japaneast,australiaeast log_level info # custom_metrics_mdm filter plugin for perf data from windows nodes type filter_cadvisor2mdm - custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westEurope + custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westeurope,southafricanorth,centralus,northcentralus,eastus2,koreacentral,eastasia,centralindia,uksouth,canadacentral,francecentral,japaneast,australiaeast metrics_to_collect cpuUsageNanoCores,memoryWorkingSetBytes log_level info @@ -97,107 +75,96 @@ data: type out_oms log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_kubepods*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m type out_oms log_level debug num_threads 5 - buffer_chunk_limit 5m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_kubeevents*.buffer - buffer_queue_limit 10 + buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m - - - - type out_oms_api - log_level debug - buffer_chunk_limit 10m - buffer_type file - buffer_path %STATE_DIR_WS%/out_oms_api_kubernetes_logs*.buffer - buffer_queue_limit 10 - flush_interval 20s - retry_limit 10 - retry_wait 30s - + retry_wait 5s + max_retry_wait 5m + type out_oms log_level debug - num_threads 5 - buffer_chunk_limit 20m + num_threads 2 + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_kubeservices*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m type out_oms log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/state/out_oms_kubenodes*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m type out_oms log_level debug - buffer_chunk_limit 20m + num_threads 3 + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_containernodeinventory*.buffer buffer_queue_limit 20 flush_interval 20s retry_limit 10 - retry_wait 15s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m type out_oms log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_kubeperf*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m type out_mdm log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_mdm_*.buffer buffer_queue_limit 20 @@ -213,30 +180,30 @@ data: type out_oms log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_api_wincadvisorperf*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m type out_mdm log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_mdm_cdvisorperf*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m retry_mdm_post_wait_minutes 60 @@ -244,15 +211,15 @@ data: type out_oms log_level debug num_threads 5 - buffer_chunk_limit 20m + buffer_chunk_limit 4m buffer_type file buffer_path %STATE_DIR_WS%/out_oms_kubehealth*.buffer buffer_queue_limit 20 buffer_queue_full_action drop_oldest_chunk flush_interval 20s retry_limit 10 - retry_wait 30s - max_retry_wait 9m + retry_wait 5s + max_retry_wait 5m metadata: name: omsagent-rs-config diff --git a/incubator/azuremonitor-containers/values.yaml b/incubator/azuremonitor-containers/values.yaml index 00779d2de8..5c9947f5fe 100644 --- a/incubator/azuremonitor-containers/values.yaml +++ b/incubator/azuremonitor-containers/values.yaml @@ -6,12 +6,12 @@ ## ref: https://github.com/Microsoft/OMS-docker/tree/ci_feature_prod omsagent: image: - tag: "ciprod11012019" + tag: "ciprod01072020" pullPolicy: IfNotPresent - dockerProviderVersion: "7.0.0-6" + dockerProviderVersion: "8.0.0-2" 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. + ## 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. secret: wsid: @@ -19,7 +19,7 @@ omsagent: domain: opinsights.azure.com env: clusterName: -## Applicable for only managed clusters hosted in Azure + ## Applicable for only managed clusters hosted in Azure clusterId: clusterRegion: rbac: true @@ -28,10 +28,34 @@ omsagent: tailbufchunksizemegabytes: "" tailbufmaxsizemegabytes: "" + ## Configure node tolerations for scheduling onto nodes with taints + ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + ## + tolerations: + - operator: "Exists" + effect: "NoSchedule" + - operator: "Exists" + effect: "NoExecute" + - operator: "Exists" + effect: "PreferNoSchedule" -## Configure resource requests and limits -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## + ## Pod scheduling preferences. + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - labelSelector: + matchExpressions: + - key: type + operator: NotIn + values: + - virtual-kubelet + + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## resources: daemonset: requests: @@ -42,8 +66,8 @@ omsagent: memory: 600Mi deployment: requests: - cpu: 110m + cpu: 150m memory: 250Mi limits: - cpu: 150m - memory: 500Mi + cpu: 1 + memory: 750Mi