From 5e3d197e51a8c3fad371e8828f0527ab705e769e Mon Sep 17 00:00:00 2001 From: Ganga Mahesh Siddem Date: Tue, 12 Oct 2021 12:57:18 -0700 Subject: [PATCH 1/4] chart updates for oct2021 release --- charts/azuremonitor-containers/Chart.yaml | 2 +- .../templates/omsagent-daemonset-windows.yaml | 8 ++- .../templates/omsagent-daemonset.yaml | 63 +++++++++++++++++++ .../templates/omsagent-deployment.yaml | 8 +-- charts/azuremonitor-containers/values.yaml | 23 ++++--- 5 files changed, 90 insertions(+), 14 deletions(-) diff --git a/charts/azuremonitor-containers/Chart.yaml b/charts/azuremonitor-containers/Chart.yaml index 00f3f49ed..4dd6623bf 100644 --- a/charts/azuremonitor-containers/Chart.yaml +++ b/charts/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.8.3 +version: 2.9.0 kubeVersion: "^1.10.0-0" keywords: - monitoring diff --git a/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml b/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml index efed76f7d..78831aa10 100644 --- a/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml @@ -86,7 +86,7 @@ spec: fieldRef: fieldPath: metadata.name - name: SIDECAR_SCRAPING_ENABLED - value: "false" + value: {{ .Values.omsagent.sidecarscraping | quote }} volumeMounts: - mountPath: C:\ProgramData\docker\containers name: docker-windows-containers @@ -104,7 +104,11 @@ spec: command: - cmd - /c - - C:\opt\omsagentwindows\scripts\cmd\livenessProbe.cmd + - C:\opt\omsagentwindows\scripts\cmd\livenessprobe.exe + - fluent-bit.exe + - fluentdwinaks + - "C:\\etc\\omsagentwindows\\filesystemwatcher.txt" + - "C:\\etc\\omsagentwindows\\renewcertificate.txt" periodSeconds: 60 initialDelaySeconds: 180 timeoutSeconds: 15 diff --git a/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml b/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml index 7201ee6ae..2269704fb 100644 --- a/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml @@ -132,6 +132,69 @@ spec: initialDelaySeconds: 60 periodSeconds: 60 timeoutSeconds: 15 + {{- if .Values.omsagent.sidecarscraping }} + - name: omsagent-prometheus + {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} + image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" + {{- else }} + image: {{ printf "%s:%s" .Values.omsagent.image.repo .Values.omsagent.image.tag }} + {{- end }} + imagePullPolicy: IfNotPresent + resources: +{{ toYaml .Values.omsagent.resources.daemonsetlinuxsidecar | 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 if ne .Values.Azure.Cluster.ResourceId "" }} + - name: AKS_RESOURCE_ID + value: {{ .Values.Azure.Cluster.ResourceId | quote }} + {{- if ne .Values.Azure.Cluster.Region "" }} + - name: AKS_REGION + value: {{ .Values.Azure.Cluster.Region | quote }} + {{- end }} + {{- else }} + - name: ACS_RESOURCE_NAME + value: {{ .Values.omsagent.env.clusterName | quote }} + {{- end }} + - name: CONTROLLER_TYPE + value: "DaemonSet" + - name: CONTAINER_TYPE + value: "PrometheusSidecar" + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: ISTEST + value: {{ .Values.omsagent.ISTEST | quote }} + securityContext: + privileged: true + volumeMounts: + - mountPath: /etc/kubernetes/host + name: azure-json-path + - mountPath: /etc/omsagent-secret + name: omsagent-secret + readOnly: true + - mountPath: /etc/config/settings + name: settings-vol-config + readOnly: true + - mountPath: /etc/config/osm-settings + name: osm-settings-vol-config + readOnly: true + livenessProbe: + exec: + command: + - /bin/bash + - -c + - /opt/livenessprobe.sh + initialDelaySeconds: 60 + periodSeconds: 60 + timeoutSeconds: 15 + {{- end }} {{- with .Values.omsagent.daemonset.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/azuremonitor-containers/templates/omsagent-deployment.yaml b/charts/azuremonitor-containers/templates/omsagent-deployment.yaml index fdc520cba..1eaf7f652 100644 --- a/charts/azuremonitor-containers/templates/omsagent-deployment.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-deployment.yaml @@ -69,14 +69,14 @@ spec: fieldPath: status.hostIP {{- if not (empty .Values.Azure.Extension.Name) }} - name: ARC_K8S_EXTENSION_NAME - value: {{ .Values.Azure.Extension.Name | quote }} - {{- end }} + value: {{ .Values.Azure.Extension.Name | quote }} + {{- end }} - name: USER_ASSIGNED_IDENTITY_CLIENT_ID value: "" - name: SIDECAR_SCRAPING_ENABLED - value: "false" + value: {{ .Values.omsagent.sidecarscraping | quote }} - name: ISTEST - value: {{ .Values.omsagent.ISTEST | quote }} + value: {{ .Values.omsagent.ISTEST | quote }} securityContext: privileged: true ports: diff --git a/charts/azuremonitor-containers/values.yaml b/charts/azuremonitor-containers/values.yaml index 9dd5317a4..62143c2ab 100644 --- a/charts/azuremonitor-containers/values.yaml +++ b/charts/azuremonitor-containers/values.yaml @@ -17,14 +17,14 @@ Azure: httpProxy: "" httpsProxy: "" noProxy: "" - proxyCert: "" + proxyCert: "" omsagent: image: repo: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod" - tag: "ciprod04222021" - tagWindows: "win-ciprod04222021" + tag: "ciprod10112021" + tagWindows: "win-ciprod10112021" pullPolicy: IfNotPresent - dockerProviderVersion: "15.0.0-0" + dockerProviderVersion: "16.0.0-0" agentVersion: "1.10.0.1" # The priority used by the omsagent priority class for the daemonset pods @@ -39,7 +39,7 @@ omsagent: # chance to build pod for the node and give it to the scheduler) # Should be some number greater than default (0) priority: 10 - + # This used for running agent pods in test mode. # if set to true additional agent workflow logs will be emitted which are used for e2e and arc k8s conformance testing ISTEST: false @@ -58,6 +58,7 @@ omsagent: clusterId: clusterRegion: rbac: true + sidecarscraping: true logsettings: logflushintervalsecs: "" tailbufchunksizemegabytes: "" @@ -171,10 +172,10 @@ omsagent: daemonsetlinux: requests: cpu: 75m - memory: 225Mi + memory: 325Mi limits: cpu: 150m - memory: 600Mi + memory: 750Mi daemonsetwindows: limits: cpu: 200m @@ -186,3 +187,11 @@ omsagent: limits: cpu: 1 memory: 1Gi + daemonsetlinuxsidecar: + limits: + cpu: 500m + memory: 1Gi + requests: + cpu: 75m + memory: 225Mi + From 94994a45408571096fc59b14ba5ce109c7bc67b5 Mon Sep 17 00:00:00 2001 From: Ganga Mahesh Siddem Date: Tue, 12 Oct 2021 15:50:06 -0700 Subject: [PATCH 2/4] wip --- .../templates/omsagent-daemonset.yaml | 130 +++++++++--------- 1 file changed, 67 insertions(+), 63 deletions(-) diff --git a/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml b/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml index 2269704fb..0b2d19994 100644 --- a/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml @@ -37,6 +37,69 @@ spec: serviceAccountName: omsagent {{- end }} containers: + {{- if .Values.omsagent.sidecarscraping }} + - name: omsagent-prometheus + {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} + image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" + {{- else }} + image: {{ printf "%s:%s" .Values.omsagent.image.repo .Values.omsagent.image.tag }} + {{- end }} + imagePullPolicy: IfNotPresent + resources: +{{ toYaml .Values.omsagent.resources.daemonsetlinuxsidecar | 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 if ne .Values.Azure.Cluster.ResourceId "" }} + - name: AKS_RESOURCE_ID + value: {{ .Values.Azure.Cluster.ResourceId | quote }} + {{- if ne .Values.Azure.Cluster.Region "" }} + - name: AKS_REGION + value: {{ .Values.Azure.Cluster.Region | quote }} + {{- end }} + {{- else }} + - name: ACS_RESOURCE_NAME + value: {{ .Values.omsagent.env.clusterName | quote }} + {{- end }} + - name: CONTROLLER_TYPE + value: "DaemonSet" + - name: CONTAINER_TYPE + value: "PrometheusSidecar" + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: ISTEST + value: {{ .Values.omsagent.ISTEST | quote }} + securityContext: + privileged: true + volumeMounts: + - mountPath: /etc/kubernetes/host + name: azure-json-path + - mountPath: /etc/omsagent-secret + name: omsagent-secret + readOnly: true + - mountPath: /etc/config/settings + name: settings-vol-config + readOnly: true + - mountPath: /etc/config/osm-settings + name: osm-settings-vol-config + readOnly: true + livenessProbe: + exec: + command: + - /bin/bash + - -c + - /opt/livenessprobe.sh + initialDelaySeconds: 60 + periodSeconds: 60 + timeoutSeconds: 15 + {{- end }} - name: omsagent {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" @@ -132,69 +195,6 @@ spec: initialDelaySeconds: 60 periodSeconds: 60 timeoutSeconds: 15 - {{- if .Values.omsagent.sidecarscraping }} - - name: omsagent-prometheus - {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} - image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" - {{- else }} - image: {{ printf "%s:%s" .Values.omsagent.image.repo .Values.omsagent.image.tag }} - {{- end }} - imagePullPolicy: IfNotPresent - resources: -{{ toYaml .Values.omsagent.resources.daemonsetlinuxsidecar | 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 if ne .Values.Azure.Cluster.ResourceId "" }} - - name: AKS_RESOURCE_ID - value: {{ .Values.Azure.Cluster.ResourceId | quote }} - {{- if ne .Values.Azure.Cluster.Region "" }} - - name: AKS_REGION - value: {{ .Values.Azure.Cluster.Region | quote }} - {{- end }} - {{- else }} - - name: ACS_RESOURCE_NAME - value: {{ .Values.omsagent.env.clusterName | quote }} - {{- end }} - - name: CONTROLLER_TYPE - value: "DaemonSet" - - name: CONTAINER_TYPE - value: "PrometheusSidecar" - - name: NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - - name: ISTEST - value: {{ .Values.omsagent.ISTEST | quote }} - securityContext: - privileged: true - volumeMounts: - - mountPath: /etc/kubernetes/host - name: azure-json-path - - mountPath: /etc/omsagent-secret - name: omsagent-secret - readOnly: true - - mountPath: /etc/config/settings - name: settings-vol-config - readOnly: true - - mountPath: /etc/config/osm-settings - name: osm-settings-vol-config - readOnly: true - livenessProbe: - exec: - command: - - /bin/bash - - -c - - /opt/livenessprobe.sh - initialDelaySeconds: 60 - periodSeconds: 60 - timeoutSeconds: 15 - {{- end }} {{- with .Values.omsagent.daemonset.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} @@ -236,4 +236,8 @@ spec: secret: secretName: omsagent-adx-secret optional: true + - name: osm-settings-vol-config + configMap: + name: container-azm-ms-osmconfig + optional: true {{- end }} From e3ed3f5293d288e3bd176ff6befb72300c405bec Mon Sep 17 00:00:00 2001 From: Ganga Mahesh Siddem Date: Tue, 12 Oct 2021 15:52:25 -0700 Subject: [PATCH 3/4] wip --- .../templates/omsagent-daemonset.yaml | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml b/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml index 0b2d19994..8e5513f91 100644 --- a/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-daemonset.yaml @@ -37,69 +37,6 @@ spec: serviceAccountName: omsagent {{- end }} containers: - {{- if .Values.omsagent.sidecarscraping }} - - name: omsagent-prometheus - {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} - image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" - {{- else }} - image: {{ printf "%s:%s" .Values.omsagent.image.repo .Values.omsagent.image.tag }} - {{- end }} - imagePullPolicy: IfNotPresent - resources: -{{ toYaml .Values.omsagent.resources.daemonsetlinuxsidecar | 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 if ne .Values.Azure.Cluster.ResourceId "" }} - - name: AKS_RESOURCE_ID - value: {{ .Values.Azure.Cluster.ResourceId | quote }} - {{- if ne .Values.Azure.Cluster.Region "" }} - - name: AKS_REGION - value: {{ .Values.Azure.Cluster.Region | quote }} - {{- end }} - {{- else }} - - name: ACS_RESOURCE_NAME - value: {{ .Values.omsagent.env.clusterName | quote }} - {{- end }} - - name: CONTROLLER_TYPE - value: "DaemonSet" - - name: CONTAINER_TYPE - value: "PrometheusSidecar" - - name: NODE_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - - name: ISTEST - value: {{ .Values.omsagent.ISTEST | quote }} - securityContext: - privileged: true - volumeMounts: - - mountPath: /etc/kubernetes/host - name: azure-json-path - - mountPath: /etc/omsagent-secret - name: omsagent-secret - readOnly: true - - mountPath: /etc/config/settings - name: settings-vol-config - readOnly: true - - mountPath: /etc/config/osm-settings - name: osm-settings-vol-config - readOnly: true - livenessProbe: - exec: - command: - - /bin/bash - - -c - - /opt/livenessprobe.sh - initialDelaySeconds: 60 - periodSeconds: 60 - timeoutSeconds: 15 - {{- end }} - name: omsagent {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" @@ -195,6 +132,69 @@ spec: initialDelaySeconds: 60 periodSeconds: 60 timeoutSeconds: 15 + {{- if .Values.omsagent.sidecarscraping }} + - name: omsagent-prometheus + {{- if eq (.Values.omsagent.domain | lower) "opinsights.azure.cn" }} + image: "mcr.azk8s.cn/azuremonitor/containerinsights/ciprod:{{ .Values.omsagent.image.tag }}" + {{- else }} + image: {{ printf "%s:%s" .Values.omsagent.image.repo .Values.omsagent.image.tag }} + {{- end }} + imagePullPolicy: IfNotPresent + resources: +{{ toYaml .Values.omsagent.resources.daemonsetlinuxsidecar | 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 if ne .Values.Azure.Cluster.ResourceId "" }} + - name: AKS_RESOURCE_ID + value: {{ .Values.Azure.Cluster.ResourceId | quote }} + {{- if ne .Values.Azure.Cluster.Region "" }} + - name: AKS_REGION + value: {{ .Values.Azure.Cluster.Region | quote }} + {{- end }} + {{- else }} + - name: ACS_RESOURCE_NAME + value: {{ .Values.omsagent.env.clusterName | quote }} + {{- end }} + - name: CONTROLLER_TYPE + value: "DaemonSet" + - name: CONTAINER_TYPE + value: "PrometheusSidecar" + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: ISTEST + value: {{ .Values.omsagent.ISTEST | quote }} + securityContext: + privileged: true + volumeMounts: + - mountPath: /etc/kubernetes/host + name: azure-json-path + - mountPath: /etc/omsagent-secret + name: omsagent-secret + readOnly: true + - mountPath: /etc/config/settings + name: settings-vol-config + readOnly: true + - mountPath: /etc/config/osm-settings + name: osm-settings-vol-config + readOnly: true + livenessProbe: + exec: + command: + - /bin/bash + - -c + - /opt/livenessprobe.sh + initialDelaySeconds: 60 + periodSeconds: 60 + timeoutSeconds: 15 + {{- end }} {{- with .Values.omsagent.daemonset.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} From 2d4737572cf1388b191999dded3acbcfaa21ce42 Mon Sep 17 00:00:00 2001 From: Ganga Mahesh Siddem Date: Tue, 12 Oct 2021 16:54:23 -0700 Subject: [PATCH 4/4] wip --- charts/azuremonitor-containers/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/azuremonitor-containers/values.yaml b/charts/azuremonitor-containers/values.yaml index 62143c2ab..0d78ed50f 100644 --- a/charts/azuremonitor-containers/values.yaml +++ b/charts/azuremonitor-containers/values.yaml @@ -60,9 +60,9 @@ omsagent: rbac: true sidecarscraping: true logsettings: - logflushintervalsecs: "" - tailbufchunksizemegabytes: "" - tailbufmaxsizemegabytes: "" + logflushintervalsecs: "15" + tailbufchunksizemegabytes: "1" + tailbufmaxsizemegabytes: "1" ## Applicable for only Azure Stack Edge K8s since it has custom mount path for container logs which will have symlink to /var/log path custommountpath: ""