From 0f402789f163f34855e8e1020f574f3af7cb5457 Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Mon, 15 Apr 2024 22:46:18 +0300 Subject: [PATCH] :sparkles: Add `TcpStreamChannelTimeoutShow` field to `MiscConfig` --- config/configStructs/tapConfig.go | 11 ++++++----- helm-chart/templates/02-cluster-role.yaml | 8 ++++---- helm-chart/templates/09-worker-daemon-set.yaml | 4 +++- helm-chart/templates/12-config-map.yaml | 2 +- helm-chart/values.yaml | 5 +++-- manifests/complete.yaml | 10 ++++++++++ 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index 55ac3b539..b76102c05 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -141,9 +141,12 @@ type MetricsConfig struct { } type MiscConfig struct { - JsonTTL string `yaml:"jsonTTL" json:"jsonTTL" default:"5m"` - PcapTTL string `yaml:"pcapTTL" json:"pcapTTL" default:"10s"` - PcapErrorTTL string `yaml:"pcapErrorTTL" json:"pcapErrorTTL" default:"60s"` + JsonTTL string `yaml:"jsonTTL" json:"jsonTTL" default:"5m"` + PcapTTL string `yaml:"pcapTTL" json:"pcapTTL" default:"10s"` + PcapErrorTTL string `yaml:"pcapErrorTTL" json:"pcapErrorTTL" default:"60s"` + TrafficSampleRate int `yaml:"trafficSampleRate" json:"trafficSampleRate" default:"100"` + TcpStreamChannelTimeoutMs int `yaml:"tcpStreamChannelTimeoutMs" json:"tcpStreamChannelTimeoutMs" default:"10000"` + TcpStreamChannelTimeoutShow bool `yaml:"tcpStreamChannelTimeoutShow" json:"tcpStreamChannelTimeoutShow" default:"false"` } type TapConfig struct { @@ -180,8 +183,6 @@ type TapConfig struct { Capabilities CapabilitiesConfig `yaml:"capabilities" json:"capabilities"` GlobalFilter string `yaml:"globalFilter" json:"globalFilter"` Metrics MetricsConfig `yaml:"metrics" json:"metrics"` - TrafficSampleRate int `yaml:"trafficSampleRate" json:"trafficSampleRate" default:"100"` - TcpStreamChannelTimeoutMs int `yaml:"tcpStreamChannelTimeoutMs" json:"tcpStreamChannelTimeoutMs" default:"10000"` Misc MiscConfig `yaml:"misc" json:"misc"` } diff --git a/helm-chart/templates/02-cluster-role.yaml b/helm-chart/templates/02-cluster-role.yaml index 3ad1604cb..8e5d02cbe 100644 --- a/helm-chart/templates/02-cluster-role.yaml +++ b/helm-chart/templates/02-cluster-role.yaml @@ -24,13 +24,13 @@ rules: - list - get - watch - - apiGroups: + - apiGroups: - "" - resources: + resources: - namespaces - verbs: + verbs: - get - resourceNames: + resourceNames: - kube-system --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/helm-chart/templates/09-worker-daemon-set.yaml b/helm-chart/templates/09-worker-daemon-set.yaml index 49cfd08ce..545be950e 100644 --- a/helm-chart/templates/09-worker-daemon-set.yaml +++ b/helm-chart/templates/09-worker-daemon-set.yaml @@ -84,7 +84,9 @@ spec: fieldRef: fieldPath: metadata.namespace - name: TCP_STREAM_CHANNEL_TIMEOUT_MS - value: '{{ .Values.tap.tcpStreamChannelTimeoutMs }}' + value: '{{ .Values.tap.misc.tcpStreamChannelTimeoutMs }}' + - name: TCP_STREAM_CHANNEL_TIMEOUT_SHOW + value: '{{ .Values.tap.misc.tcpStreamChannelTimeoutShow }}' - name: KUBESHARK_CLOUD_API_URL value: 'https://api.kubeshark.co' resources: diff --git a/helm-chart/templates/12-config-map.yaml b/helm-chart/templates/12-config-map.yaml index 936bb9932..7488304ce 100644 --- a/helm-chart/templates/12-config-map.yaml +++ b/helm-chart/templates/12-config-map.yaml @@ -24,7 +24,7 @@ data: TARGETED_PODS_UPDATE_DISABLED: '{{ .Values.tap.targetedPodsUpdateDisabled | ternary "true" "" }}' RECORDING_DISABLED: '{{ .Values.tap.recordingDisabled | ternary "true" "" }}' GLOBAL_FILTER: {{ include "kubeshark.escapeDoubleQuotes" .Values.tap.globalFilter | quote }} - TRAFFIC_SAMPLE_RATE: '{{ .Values.tap.trafficSampleRate }}' + TRAFFIC_SAMPLE_RATE: '{{ .Values.tap.misc.trafficSampleRate }}' JSON_TTL: '{{ .Values.tap.misc.jsonTTL }}' PCAP_TTL: '{{ .Values.tap.misc.pcapTTL }}' PCAP_ERROR_TTL: '{{ .Values.tap.misc.pcapErrorTTL }}' diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 6bec8b876..6f3c4e3ad 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -111,12 +111,13 @@ tap: globalFilter: "" metrics: port: 49100 - trafficSampleRate: 100 - tcpStreamChannelTimeoutMs: 10000 misc: jsonTTL: 5m pcapTTL: 10s pcapErrorTTL: 60s + trafficSampleRate: 100 + tcpStreamChannelTimeoutMs: 10000 + tcpStreamChannelTimeoutShow: false logs: file: "" kube: diff --git a/manifests/complete.yaml b/manifests/complete.yaml index 05e50bddc..63d146233 100644 --- a/manifests/complete.yaml +++ b/manifests/complete.yaml @@ -251,6 +251,14 @@ rules: - list - get - watch + - apiGroups: + - "" + resources: + - namespaces + verbs: + - get + resourceNames: + - kube-system --- # Source: kubeshark/templates/03-cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -476,6 +484,8 @@ spec: fieldPath: metadata.namespace - name: TCP_STREAM_CHANNEL_TIMEOUT_MS value: '10000' + - name: TCP_STREAM_CHANNEL_TIMEOUT_SHOW + value: 'false' - name: KUBESHARK_CLOUD_API_URL value: 'https://api.kubeshark.co' resources: