Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node-analyzer): Allow setting parameters for runtime and host scanner probes in Daemoset #1940

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/node-analyzer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: node-analyzer
description: Sysdig Node Analyzer
# currently matching Sysdig's appVersion 1.14.34
version: 1.31.7
version: 1.32.0
appVersion: 12.9.0
keywords:
- monitoring
Expand Down
16 changes: 8 additions & 8 deletions charts/node-analyzer/templates/daemonset-node-analyzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -661,14 +661,14 @@ spec:
httpGet:
port: {{ .Values.nodeAnalyzer.runtimeScanner.probesPort }}
path: /probes/liveness
initialDelaySeconds: 90
periodSeconds: 3
initialDelaySeconds: {{ .Values.nodeAnalyzer.runtimeScanner.livenessProbe.probe.initialDelaySeconds }}
periodSeconds: {{ .Values.nodeAnalyzer.runtimeScanner.livenessProbe.probe.periodSeconds }}
readinessProbe:
httpGet:
port: {{ .Values.nodeAnalyzer.runtimeScanner.probesPort }}
path: /probes/readiness
initialDelaySeconds: 90
periodSeconds: 3
initialDelaySeconds: {{ .Values.nodeAnalyzer.runtimeScanner.readinessProbe.probe.initialDelaySeconds }}
periodSeconds: {{ .Values.nodeAnalyzer.runtimeScanner.readinessProbe.probe.periodSeconds }}
securityContext:
privileged: true
resources:
Expand Down Expand Up @@ -808,14 +808,14 @@ spec:
httpGet:
port: {{ .Values.nodeAnalyzer.hostScanner.probesPort }}
path: /probes/liveness
initialDelaySeconds: 90
periodSeconds: 3
initialDelaySeconds: {{ .Values.nodeAnalyzer.hostScanner.livenessProbe.probe.initialDelaySeconds }}
periodSeconds: {{ .Values.nodeAnalyzer.hostScanner.livenessProbe.probe.periodSeconds }}
readinessProbe:
httpGet:
port: {{ .Values.nodeAnalyzer.hostScanner.probesPort }}
path: /probes/readiness
initialDelaySeconds: 90
periodSeconds: 3
initialDelaySeconds: {{ .Values.nodeAnalyzer.hostScanner.readinessProbe.probe.initialDelaySeconds }}
periodSeconds: {{ .Values.nodeAnalyzer.hostScanner.readinessProbe.probe.periodSeconds }}
securityContext:
# The privileged flag is necessary for OCP 4.x and other Kubernetes setups that deny host filesystem access to
# running containers by default regardless of volume mounts.
Expand Down
112 changes: 112 additions & 0 deletions charts/node-analyzer/tests/daemonset_probes_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
suite: Test Daemonset Abc
templates:
- templates/daemonset-node-analyzer.yaml
# For checksums
- templates/runtimeScanner/runtime-scanner-configmap.yaml
- templates/configmap-host-scanner.yaml
- clusterrole-node-analyzer.yaml
- clusterrolebinding-node-analyzer.yaml
- configmap-benchmark-runner.yaml
- configmap-host-analyzer.yaml
- configmap-image-analyzer.yaml
- secrets.yaml
- serviceaccount-node-analyzer.yaml
values:
- ./default_required_values.yaml
tests:
- it: assert default sysdig-runtime-scanner probes
set:
nodeAnalyzer:
runtimeScanner:
deploy: true
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.periodSeconds
value: 3
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.periodSeconds
value: 3
templates:
- templates/daemonset-node-analyzer.yaml
- it: assert custom sysdig-runtime-scanner probess
set:
nodeAnalyzer:
runtimeScanner:
deploy: true
livenessProbe:
probe:
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
probe:
initialDelaySeconds: 15
periodSeconds: 10
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.initialDelaySeconds
value: 10
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].livenessProbe.periodSeconds
value: 5
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.initialDelaySeconds
value: 15
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-runtime-scanner")].readinessProbe.periodSeconds
value: 10
templates:
- templates/daemonset-node-analyzer.yaml
- it: assert default sysdig-host-scanner probes
set:
nodeAnalyzer:
hostScanner:
deploy: true
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.periodSeconds
value: 3
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.initialDelaySeconds
value: 90
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.periodSeconds
value: 3
templates:
- templates/daemonset-node-analyzer.yaml
- it: assert custom sysdig-host-scanner probess
set:
nodeAnalyzer:
hostScanner:
deploy: true
livenessProbe:
probe:
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
probe:
initialDelaySeconds: 15
periodSeconds: 10
asserts:
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.initialDelaySeconds
value: 10
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].livenessProbe.periodSeconds
value: 5
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.initialDelaySeconds
value: 15
- equal:
path: spec.template.spec.containers[?(@.name == "sysdig-host-scanner")].readinessProbe.periodSeconds
value: 10
templates:
- templates/daemonset-node-analyzer.yaml
18 changes: 18 additions & 0 deletions charts/node-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ nodeAnalyzer:
memory: 2Gi
ephemeral-storage: "4Gi"

readinessProbe:
probe:
initialDelaySeconds: 90
periodSeconds: 3
livenessProbe:
probe:
initialDelaySeconds: 90
periodSeconds: 3

env: {}

settings:
Expand Down Expand Up @@ -422,6 +431,15 @@ nodeAnalyzer:
memory: 150Mi
ephemeral-storage: 250Mi

readinessProbe:
probe:
initialDelaySeconds: 90
periodSeconds: 3
livenessProbe:
probe:
initialDelaySeconds: 90
periodSeconds: 3

env: {}

settings:
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.64.10
version: 1.65.0
maintainers:
- name: AlbertoBarba
email: [email protected]
Expand Down Expand Up @@ -36,7 +36,7 @@ dependencies:
- name: node-analyzer
# repository: https://charts.sysdig.com
repository: file://../node-analyzer
version: ~1.31.7
version: ~1.32.0
alias: nodeAnalyzer
condition: nodeAnalyzer.enabled
- name: cluster-scanner
Expand Down
Loading