Skip to content

Commit

Permalink
chore(agent,sysdig-deploy): set promscrape port to 9091 by default wh…
Browse files Browse the repository at this point in the history
…en gke autopilot is enabled (#1618)
  • Loading branch information
francesco-furlan authored Feb 21, 2024
1 parent 837ed5f commit 5934293
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ sources:
- https://app.sysdigcloud.com/#/settings/user
- https://github.com/draios/sysdig
type: application
version: 1.20.1
version: 1.20.2
5 changes: 4 additions & 1 deletion charts/agent/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ data:
Checking here the user is using Custom CA and if http_proxy.ssl = true
If these conditions are true, then we use the agent.sslCaFileName for the http_proxy.ca_certificate
*/}}
{{- $baseSettings := .Values.sysdig.settings -}}
{{- if and (include "agent.gke.autopilot" .) (or (not (hasKey $baseSettings "promscrape_web_address")) (eq (get $baseSettings "promscrape_web_address") "127.0.0.1:9990") ) }}
{{- $baseSettings := mergeOverwrite $baseSettings (dict "promscrape_web_address" "127.0.0.1:9991") -}}
{{- end }}
{{- if and (eq (include "sysdig.custom_ca.enabled" (dict "global" .Values.global.ssl "component" .Values.ssl)) "true") (.Values.sysdig.settings) (hasKey .Values.sysdig.settings "http_proxy") (hasKey (default dict .Values.sysdig.settings.http_proxy) "ssl") (eq (get (default (dict "ssl" false) .Values.sysdig.settings.http_proxy) "ssl") true) }}
{{- $baseSettings := .Values.sysdig.settings -}}
{{- $caFilePath := printf "%s%s" "/etc/ca-certs/" (include "sysdig.custom_ca.keyName" (dict "global" .Values.global.ssl "component" .Values.ssl)) }}
{{- $mergedSettings := mergeOverwrite $baseSettings (dict "http_proxy" (dict "ca_certificate" $caFilePath)) -}}
{{ toYaml $mergedSettings | nindent 4 }}
Expand Down
39 changes: 39 additions & 0 deletions charts/agent/tests/gke_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,45 @@ tests:
enabled: false
template: templates/configmap.yaml

- it: Ensure promscrape_web_address is set 127.0.0.1:9991 when autopilot is enabled
set:
gke:
autopilot: true
asserts:
- matchRegex:
path: data['dragent.yaml']
pattern: |-
promscrape_web_address: 127.0.0.1:9991
template: templates/configmap.yaml

- it: Ensure promscrape_web_address is unaltered when is set on settings and autopilot is enabled
set:
gke:
autopilot: true
sysdig:
settings:
promscrape_web_address: test:1234
asserts:
- matchRegex:
path: data['dragent.yaml']
pattern: |-
promscrape_web_address: test:1234
template: templates/configmap.yaml

- it: Ensure promscrape_web_address is unaltered when autopilot is disabled
set:
gke:
autopilot: false
sysdig:
settings:
promscrape_web_address: test:1234
asserts:
- matchRegex:
path: data['dragent.yaml']
pattern: |-
promscrape_web_address: test:1234
template: templates/configmap.yaml

- it: Ensure ephemeral storage is set correctly on kmod container when slim mode is enabled
set:
gke:
Expand Down
4 changes: 2 additions & 2 deletions charts/sysdig-deploy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sysdig-deploy
description: A chart with various Sysdig components for Kubernetes
type: application
version: 1.39.0
version: 1.39.1
maintainers:
- name: AlbertoBarba
email: [email protected]
Expand All @@ -26,7 +26,7 @@ dependencies:
- name: agent
# repository: https://charts.sysdig.com
repository: file://../agent
version: ~1.20.1
version: ~1.20.2
alias: agent
condition: agent.enabled
- name: common
Expand Down

0 comments on commit 5934293

Please sign in to comment.