From 206f318cc00c5b858a495e578a27bd81148e7abe Mon Sep 17 00:00:00 2001 From: Volodymyr Stoiko Date: Wed, 17 Sep 2025 17:37:55 +0300 Subject: [PATCH] Pass db storage size and ration to calculate for badger db --- config/configStructs/tapConfig.go | 5 +++-- helm-chart/README.md | 1 + helm-chart/templates/09-worker-daemon-set.yaml | 4 ++++ helm-chart/values.yaml | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index 5de658e35..840885d9f 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -301,8 +301,9 @@ type SeLinuxOptionsConfig struct { } type CaptureConfig struct { - Stopped bool `yaml:"stopped" json:"stopped" default:"false"` - StopAfter string `yaml:"stopAfter" json:"stopAfter" default:"5m"` + Stopped bool `yaml:"stopped" json:"stopped" default:"false"` + StopAfter string `yaml:"stopAfter" json:"stopAfter" default:"5m"` + DbMaxSizeRatio float64 `yaml:"dbMaxSizeRatio" json:"dbMaxSizeRatio" default:"0.8"` } type TapConfig struct { diff --git a/helm-chart/README.md b/helm-chart/README.md index bf5c0f856..8ddbef29f 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -140,6 +140,7 @@ Example for overriding image names: | `tap.bpfOverride` | When using AF_PACKET as a traffic capture backend, override any existing pod targeting rules and set explicit BPF expression (e.g. `net 0.0.0.0/0`). | `[]` | | `tap.capture.stopped` | Set to `false` to have traffic processing start automatically. When set to `true`, traffic processing is stopped by default, resulting in almost no resource consumption (e.g. Kubeshark is dormant). This property can be dynamically control via the dashboard. | `false` | | `tap.capture.stopAfter` | Set to a duration (e.g. `30s`) to have traffic processing stop after no websocket activity between worker and hub. | `30s` | +| `tap.capture.dbMaxSizeRatio` | Ratio of allocated storage (`tap.storageLimit`) to use for capture database. When set to `0.8`, the database will use 80% of allocated storage. Set to `0` to disable automatic calculation and use 200MB default. | `0.8` | | `tap.release.repo` | URL of the Helm chart repository | `https://helm.kubeshark.co` | | `tap.release.name` | Helm release name | `kubeshark` | | `tap.release.namespace` | Helm release namespace | `default` | diff --git a/helm-chart/templates/09-worker-daemon-set.yaml b/helm-chart/templates/09-worker-daemon-set.yaml index 7e1016f95..8aaa30d3c 100644 --- a/helm-chart/templates/09-worker-daemon-set.yaml +++ b/helm-chart/templates/09-worker-daemon-set.yaml @@ -99,6 +99,10 @@ spec: - '{{ .Values.tap.misc.resolutionStrategy }}' - -staletimeout - '{{ .Values.tap.misc.staleTimeoutSeconds }}' + - -storage-size + - '{{ .Values.tap.storageLimit }}' + - -capture-db-max-size-ratio + - '{{ .Values.tap.capture.dbMaxSizeRatio }}' {{- if .Values.tap.docker.overrideImage.worker }} image: '{{ .Values.tap.docker.overrideImage.worker }}' {{- else if .Values.tap.docker.overrideTag.worker }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index ab584a758..71d793b99 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -29,6 +29,7 @@ tap: capture: stopped: false stopAfter: 5m + dbMaxSizeRatio: 0.8 release: repo: https://helm.kubeshark.co name: kubeshark @@ -149,6 +150,7 @@ tap: ipv6: true debug: false dashboard: + streamingType: "" completeStreamingEnabled: true telemetry: enabled: true