From 0f1c9c52ea5e1cbfe726a9e314359fe6f4ff8265 Mon Sep 17 00:00:00 2001 From: Volodymyr Stoiko Date: Wed, 4 Feb 2026 18:49:01 +0200 Subject: [PATCH] Add captureSelf flag to enable/disable kubeshark traffic capture (#1829) Co-authored-by: Alon Girmonsky <1990761+alongir@users.noreply.github.com> --- config/configStructs/tapConfig.go | 9 +++++---- helm-chart/templates/12-config-map.yaml | 1 + helm-chart/values.yaml | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index 6b8ab3451..8017a1b4f 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -317,10 +317,11 @@ type DelayedDissectionConfig struct { } type CaptureConfig struct { - Stopped bool `yaml:"stopped" json:"stopped" default:"false"` - StopAfter string `yaml:"stopAfter" json:"stopAfter" default:"5m"` - Raw RawCaptureConfig `yaml:"raw" json:"raw"` - DbMaxSize string `yaml:"dbMaxSize" json:"dbMaxSize" default:"500Mi"` + Stopped bool `yaml:"stopped" json:"stopped" default:"false"` + StopAfter string `yaml:"stopAfter" json:"stopAfter" default:"5m"` + CaptureSelf bool `yaml:"captureSelf" json:"captureSelf" default:"false"` + Raw RawCaptureConfig `yaml:"raw" json:"raw"` + DbMaxSize string `yaml:"dbMaxSize" json:"dbMaxSize" default:"500Mi"` } type TapConfig struct { diff --git a/helm-chart/templates/12-config-map.yaml b/helm-chart/templates/12-config-map.yaml index 59a35e700..c5ec94d3d 100644 --- a/helm-chart/templates/12-config-map.yaml +++ b/helm-chart/templates/12-config-map.yaml @@ -12,6 +12,7 @@ data: EXCLUDED_NAMESPACES: '{{ gt (len .Values.tap.excludedNamespaces) 0 | ternary (join "," .Values.tap.excludedNamespaces) "" }}' BPF_OVERRIDE: '{{ .Values.tap.bpfOverride }}' STOPPED: '{{ .Values.tap.capture.stopped | ternary "true" "false" }}' + CAPTURE_SELF: '{{ .Values.tap.capture.captureSelf | ternary "true" "false" }}' SCRIPTING_SCRIPTS: '{}' SCRIPTING_ACTIVE_SCRIPTS: '{{ gt (len .Values.scripting.active) 0 | ternary (join "," .Values.scripting.active) "" }}' INGRESS_ENABLED: '{{ .Values.tap.ingress.enabled }}' diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 83cc20cc6..595eacd86 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -28,6 +28,7 @@ tap: capture: stopped: false stopAfter: 5m + captureSelf: false raw: enabled: true storageSize: 1Gi