Skip to content

Commit

Permalink
fix: Set the proper metric value for node allocatable metrics (HOTFIX) (
Browse files Browse the repository at this point in the history
#798)

* fix: Set the proper metric value for node allocatable metrics

* adding trivyignore to fix the build

* release changes

* .

* also add it for gpu metrics

* more vulnerablities
  • Loading branch information
bragi92 authored Jul 28, 2022
1 parent 95b746b commit eae194c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#[vishwa] - Fix telegraf & test all for next release - see work item #https://msazure.visualstudio.com/InfrastructureInsights/_workitems/edit/13322134
# Unfixed as of 4/28/2022
CVE-2019-3826
CVE-2022-27191

#still present in mdsd telegraf
CVE-2021-42836
Expand All @@ -17,3 +16,12 @@ CVE-2021-28965

#dpkg vulnerability in ubuntu
CVE-2022-1304


# Adding for Hotfix : This needs to be fixed
CVE-2022-27191
CVE-2022-29190
CVE-2022-29222
CVE-2022-31030
CVE-2022-29189
CVE-2022-29526
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ additional questions or comments.

Note : The agent version(s) below has dates (ciprod<mmddyyyy>), which indicate the agent build dates (not release dates)

### 07/27/2022 -
##### Version microsoft/oms:ciprod06272022-hotfix Version mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022-hotfix (linux)
- Fixes for sending the proper node allocatable cpu and memory value for the container which does not specify limits.

### 06/27/2022 -
##### Version microsoft/oms:ciprod06272022 Version mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022 (linux)
##### Code change log
Expand Down
2 changes: 1 addition & 1 deletion charts/azuremonitor-containers/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.9.4
version: 2.9.5
kubeVersion: "^1.10.0-0"
keywords:
- monitoring
Expand Down
2 changes: 1 addition & 1 deletion charts/azuremonitor-containers/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Azure:
omsagent:
image:
repo: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod"
tag: "ciprod06272022"
tag: "ciprod06272022-hotfix"
tagWindows: "win-ciprod06142022"
pullPolicy: IfNotPresent
dockerProviderVersion: "18.0.1-0"
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR 0.9
RUN /usr/bin/apt-get update && /usr/bin/apt-get install -y libc-bin wget openssl curl sudo python-ctypes init-system-helpers net-tools rsyslog cron vim dmidecode apt-transport-https gnupg && rm -rf /var/lib/apt/lists/*
COPY setup.sh main.sh defaultpromenvvariables defaultpromenvvariables-rs defaultpromenvvariables-sidecar mdsd.xml envmdsd logrotate.conf $tmpdir/

ARG IMAGE_TAG=ciprod06272022
ARG IMAGE_TAG=ciprod06272022-hotfix
ENV AGENT_VERSION ${IMAGE_TAG}

WORKDIR ${tmpdir}
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/linux/Dockerfile.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN /usr/bin/apt-get update && /usr/bin/apt-get install -y libc-bin wget openssl
COPY --from=builder /src/kubernetes/linux/Linux_ULINUX_1.0_*_64_Release/docker-cimprov-*.*.*-*.*.sh $tmpdir/
COPY kubernetes/linux/setup.sh kubernetes/linux/main.sh kubernetes/linux/defaultpromenvvariables kubernetes/linux/defaultpromenvvariables-rs kubernetes/linux/defaultpromenvvariables-sidecar kubernetes/linux/mdsd.xml kubernetes/linux/envmdsd kubernetes/linux/logrotate.conf $tmpdir/

ARG IMAGE_TAG=ciprod06272022
ARG IMAGE_TAG=ciprod06272022-hotfix
ENV AGENT_VERSION ${IMAGE_TAG}

WORKDIR ${tmpdir}
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/omsagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ spec:
# - NET_ADMIN
# - NET_RAW
- name: omsagent
image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022"
image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022-hotfix"
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down Expand Up @@ -468,7 +468,7 @@ spec:
timeoutSeconds: 15
#Only in sidecar scraping mode
- name: omsagent-prometheus
image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022"
image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022-hotfix"
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down Expand Up @@ -653,7 +653,7 @@ spec:
# - NET_ADMIN
# - NET_RAW
- name: omsagent
image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022"
image: "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod06272022-hotfix"
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
4 changes: 2 additions & 2 deletions source/plugins/ruby/KubernetesApiClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def getContainerResourceRequestsAndLimits(pod, metricCategory, metricNameToColle
#No container level limit for the given metric, so default to node level limit
else
if (metricCategory == "limits" && !nodeAllocatableRecord.nil? && !nodeAllocatableRecord.empty? && nodeAllocatableRecord.has_key?(metricNameToCollect))
metricValue = nodeAllocatableRecord[metricNameToCollect]
metricValue = getMetricNumericValue(metricNameToCollect, nodeAllocatableRecord[metricNameToCollect])
metricProps = {}
metricProps["Timestamp"] = metricTime
metricProps["Host"] = nodeName
Expand Down Expand Up @@ -591,7 +591,7 @@ def getContainerResourceRequestsAndLimitsAsInsightsMetrics(pod, metricCategory,
#No container level limit for the given metric, so default to node level limit for non-gpu metrics
if (metricNameToCollect.downcase != "nvidia.com/gpu") && (metricNameToCollect.downcase != "amd.com/gpu")
if !nodeAllocatableRecord.nil? && !nodeAllocatableRecord.empty? && nodeAllocatableRecord.has_key?(metricNameToCollect)
metricValue = nodeAllocatableRecord[metricNameToCollect]
metricValue = getMetricNumericValue(metricNameToCollect, nodeAllocatableRecord[metricNameToCollect])
end
end
end
Expand Down

0 comments on commit eae194c

Please sign in to comment.