Skip to content

Commit

Permalink
windows fix for replicaset collecting windows data (#620)
Browse files Browse the repository at this point in the history
* fix: remove uneeded windows scrape config in replicaset

* .

* .

* .
  • Loading branch information
bragi92 authored Oct 5, 2023
1 parent 89fe39c commit e7f4298
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
1 change: 1 addition & 0 deletions .pipelines/azure-pipeline-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ trigger:
branches:
include:
- main
- vishwa/10022023-upgrade
pr:
autoCancel: true
branches:
Expand Down
18 changes: 0 additions & 18 deletions otelcollector/configmapparser/prometheus-config-merger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,6 @@ def populateDefaultPrometheusConfig
contents = contents.gsub("$$NODE_NAME$$", ENV["NODE_NAME"])
File.open(@windowsexporterDefaultDsFile, "w") { |file| file.puts contents }
defaultConfigs.push(@windowsexporterDefaultDsFile)

# If advanced mode is enabled, but not the windows daemonset, scrape windows kubelet from the replicaset as if it's simple mode
elsif currentControllerType == @replicasetControllerType && advancedMode == true && windowsDaemonset == false && ENV["OS_TYPE"].downcase == "linux"
UpdateScrapeIntervalConfig(@windowsexporterDefaultRsSimpleFile, windowsexporterScrapeInterval)
if !winexporterMetricsKeepListRegex.nil? && !winexporterMetricsKeepListRegex.empty?
AppendMetricRelabelConfig(@windowsexporterDefaultRsSimpleFile, winexporterMetricsKeepListRegex)
end
defaultConfigs.push(@windowsexporterDefaultRsSimpleFile)
end
end

if !ENV["AZMON_PROMETHEUS_WINDOWSKUBEPROXY_SCRAPING_ENABLED"].nil? && ENV["AZMON_PROMETHEUS_WINDOWSKUBEPROXY_SCRAPING_ENABLED"].downcase == "true"
Expand All @@ -399,15 +390,6 @@ def populateDefaultPrometheusConfig
contents = contents.gsub("$$NODE_NAME$$", ENV["NODE_NAME"])
File.open(@windowskubeproxyDefaultDsFile, "w") { |file| file.puts contents }
defaultConfigs.push(@windowskubeproxyDefaultDsFile)

# If advanced mode is enabled, but not the windows daemonset, scrape windows kubelet from the replicaset as if it's simple mode
elsif currentControllerType == @replicasetControllerType && advancedMode == true && windowsDaemonset == false && ENV["OS_TYPE"].downcase == "linux"
UpdateScrapeIntervalConfig(@windowskubeproxyDefaultFileRsSimpleFile, windowskubeproxyScrapeInterval)
if !winkubeproxyMetricsKeepListRegex.nil? && !winkubeproxyMetricsKeepListRegex.empty?
AppendMetricRelabelConfig(@windowskubeproxyDefaultFileRsSimpleFile, winkubeproxyMetricsKeepListRegex)
end
defaultConfigs.push(@windowskubeproxyDefaultFileRsSimpleFile)
end
end

if !ENV["AZMON_PROMETHEUS_POD_ANNOTATION_SCRAPING_ENABLED"].nil? && ENV["AZMON_PROMETHEUS_POD_ANNOTATION_SCRAPING_ENABLED"].downcase == "true" && currentControllerType == @replicasetControllerType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ spec:
- name: MODE
value: "advanced" # only supported mode is 'advanced', any other value will be the default/non-advance mode
- name: WINMODE
value: "" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode
value: "advanced" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode
- name: MINIMAL_INGESTION_PROFILE
value: "true" # only supported value is the string "true"
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ spec:
- name: MODE
value: "advanced" # only supported mode is 'advanced', any other value will be the default/non-advance mode
- name: WINMODE
value: "" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode
value: "advanced" # WINDOWS: only supported mode is 'advanced', any other value will be the default/non-advance mode
- name: MINIMAL_INGESTION_PROFILE
value: "true" # only supported value is the string "true"
securityContext:
Expand Down

0 comments on commit e7f4298

Please sign in to comment.