Skip to content

Commit

Permalink
feat(agent): Support single healthProbe port for Windows version with…
Browse files Browse the repository at this point in the history
… tag greater than 1.2.0 (#1990)

Co-authored-by: Marco Vito Moscaritolo <[email protected]>
  • Loading branch information
fnonay and mavimo authored Nov 28, 2024
1 parent bdf8266 commit 3453bc7
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 6 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.31.0
version: 1.32.0
8 changes: 8 additions & 0 deletions charts/agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ true
{{- end }}
{{- end }}
{{- define "agent.enableWindowsProbesSinglePort" }}
{{- if and (include "agent.isSemVer" .Values.windows.image.tag) (semverCompare "< 1.3.0-0" .Values.windows.image.tag) }}
{{- printf "false" -}}
{{- else -}}
{{- printf "true" -}}
{{- end }}
{{- end }}
{{- define "agent.enableFalcoBaselineSecureLight" }}
{{- if and (include "agent.isSemVer" .Values.image.tag) (semverCompare ">= 12.19.0-0" .Values.image.tag) }}
{{- printf "true" -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/agent/templates/daemonset-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ spec:
httpGet:
host: 127.0.0.1
path: /healthz
port: 24484
port: {{ if eq (include "agent.enableWindowsProbesSinglePort" .) "true" }}24483{{ else }}24484{{ end }}
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
readinessProbe:
httpGet:
host: 127.0.0.1
path: /healthz
port: 24484
port: {{ if eq (include "agent.enableWindowsProbesSinglePort" .) "true" }}24483{{ else }}24484{{ end }}
initialDelaySeconds: 60
timeoutSeconds: 10
resources:
Expand Down
61 changes: 61 additions & 0 deletions charts/agent/tests/readiness_probe_windows_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
suite: Test the Readiness Probe Configuration
templates:
- templates/daemonset-windows.yaml
kubernetesProvider:
scheme:
"v1/Node":
gvr:
version: "v1"
resource: "nodes"
namespaced: false
objects:
- apiVersion: v1
kind: Node
metadata:
name: fakenode
status:
nodeInfo:
osImage: fake-os-image
tests:

- it: "Windows Agent Probes (agent < 1.3.0)"
set:
windows:
enabled: true
image:
tag: 1.2.5
asserts:
- equal:
path: spec.template.spec.containers[*].livenessProbe.httpGet.port
value: 24484
- equal:
path: spec.template.spec.containers[0].readinessProbe.httpGet.port
value: 24484

- it: "Windows Agent Probes (agent > 1.2.0)"
set:
windows:
enabled: true
image:
tag: 1.3.0
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.httpGet.port
value: 24483
- equal:
path: spec.template.spec.containers[0].readinessProbe.httpGet.port
value: 24483

- it: "Windows Agent Probes (agent = latest)"
set:
windows:
enabled: true
image:
tag: latest
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.httpGet.port
value: 24483
- equal:
path: spec.template.spec.containers[0].readinessProbe.httpGet.port
value: 24483
2 changes: 1 addition & 1 deletion charts/agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ windows:
image:
registry: quay.io
repository: sysdig/agent-windows
tag: 1.2.0
tag: 1.3.0
# Specify an imagePullPolicy
# Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
# ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
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.68.1
version: 1.69.0
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.31.0
version: ~1.32.0
alias: agent
condition: agent.enabled
- name: common
Expand Down

0 comments on commit 3453bc7

Please sign in to comment.