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

fix(node-analyzer): enable hostPID in node-analyzer #1271

Merged
merged 6 commits into from
Jul 31, 2023
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 @@ -3,7 +3,7 @@ name: node-analyzer
description: Sysdig Node Analyzer

# currently matching Sysdig's appVersion 1.14.34
version: 1.11.3
version: 1.12.0
appVersion: 12.6.0
keywords:
- monitoring
Expand Down
8 changes: 8 additions & 0 deletions charts/node-analyzer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ true
{{- end -}}
{{- end -}}

{{- define "nodeAnalyzer.useHostPID" -}}
{{- if (include "nodeAnalyzer.deployBenchmarkRunner" .) }}
true
{{ else if or (not (hasKey .Values.global.kspm "deploy")) .Values.global.kspm.deploy }}
true
{{- end -}}
{{- end -}}

{{- define "nodeAnalyzer.deployImageAnalyzer" -}}
{{- if and (not .Values.secure.vulnerabilityManagement.newEngineOnly) (or (not (hasKey .Values.nodeAnalyzer.imageAnalyzer "deploy")) .Values.nodeAnalyzer.imageAnalyzer.deploy) }}
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ spec:
# This is required by the Benchmark and the HostScanner containers to determine the hostname and host mac address
hostNetwork: true
{{- end }}
{{- if include "nodeAnalyzer.deployBenchmarkRunner" . }}
{{- if include "nodeAnalyzer.useHostPID" . }}
# Use the Host PID namespace.
# This is required for Kubernetes benchmarks, as they contain tests that check Kubernetes processes running on
# the host
Expand Down
24 changes: 24 additions & 0 deletions charts/node-analyzer/tests/conditional_flag_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ tests:
apiVersion: v1
template: configmap-kspm-analyzer.yaml

- it: Check hostPID is true if global.kspm.deploy is true
set:
global:
kspm:
deploy: true
clusterName: test-cluster
template: daemonset-node-analyzer.yaml
asserts:
- equal:
path: spec.template.spec.hostPID
value: true

- it: Check hostPID is true if nodeAnalyzer.benchmarkRunner.deploy is true
set:
nodeAnalyzer:
benchmarkRunner:
deploy: true
clusterName: test-cluster
template: daemonset-node-analyzer.yaml
asserts:
- equal:
path: spec.template.spec.hostPID
value: true

- it: Check global kspm deploy without clusterName
set:
global:
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.15.4
version: 1.15.5
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.11.3
version: ~1.12.0
alias: nodeAnalyzer
condition: nodeAnalyzer.enabled
- name: cluster-scanner
Expand Down
Loading