diff --git a/config/configStruct.go b/config/configStruct.go index a2f1c04ce..a1c88a619 100644 --- a/config/configStruct.go +++ b/config/configStruct.go @@ -153,6 +153,14 @@ func CreateDefaultConfig() ConfigStruct { LDAP: []uint16{389}, DIAMETER: []uint16{3868}, }, + Nginx: configStructs.NginxConfig{ + Proxy: configStructs.ProxyNginxConfig{ + BufferSize: "64k", + BuffersCount: "4", + BuffersSize: "128k", + BusyBuffersSize: "128k", + }, + }, Dashboard: configStructs.DashboardConfig{ CompleteStreamingEnabled: true, ClusterWideMapEnabled: false, diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index 1199f2355..9bc6021e2 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -209,6 +209,17 @@ type FrontRoutingConfig struct { BasePath string `yaml:"basePath" json:"basePath" default:""` } +type NginxConfig struct { + Proxy ProxyNginxConfig `yaml:"proxy" json:"proxy"` +} + +type ProxyNginxConfig struct { + BufferSize string `yaml:"bufferSize" json:"bufferSize" default:"64k"` + BuffersCount string `yaml:"buffersCount" json:"buffersCount" default:"4"` + BuffersSize string `yaml:"buffersSize" json:"buffersSize" default:"128k"` + BusyBuffersSize string `yaml:"busyBuffersSize" json:"busyBuffersSize" default:"128k"` +} + type ReleaseConfig struct { Repo string `yaml:"repo" json:"repo" default:"https://helm.kubeshark.com"` Name string `yaml:"name" json:"name" default:"kubeshark"` @@ -406,6 +417,7 @@ type TapConfig struct { Routing RoutingConfig `yaml:"routing" json:"routing"` IPv6 bool `yaml:"ipv6" json:"ipv6" default:"true"` Debug bool `yaml:"debug" json:"debug" default:"false"` + Nginx NginxConfig `yaml:"nginx" json:"nginx"` Dashboard DashboardConfig `yaml:"dashboard" json:"dashboard"` Telemetry TelemetryConfig `yaml:"telemetry" json:"telemetry"` ResourceGuard ResourceGuardConfig `yaml:"resourceGuard" json:"resourceGuard"` diff --git a/helm-chart/templates/11-nginx-config-map.yaml b/helm-chart/templates/11-nginx-config-map.yaml index 39bbe4c9c..ab87c017c 100644 --- a/helm-chart/templates/11-nginx-config-map.yaml +++ b/helm-chart/templates/11-nginx-config-map.yaml @@ -20,6 +20,10 @@ data: client_header_buffer_size 32k; large_client_header_buffers 8 64k; + proxy_buffer_size {{ .Values.tap.nginx.proxy.bufferSize }}; + proxy_buffers {{ .Values.tap.nginx.proxy.buffersCount }} {{ .Values.tap.nginx.proxy.buffersSize }}; + proxy_busy_buffers_size {{ .Values.tap.nginx.proxy.busyBuffersSize }}; + location {{ default "" (((.Values.tap).routing).front).basePath }}/api { rewrite ^{{ default "" (((.Values.tap).routing).front).basePath }}/api(.*)$ $1 break; proxy_pass http://kubeshark-hub; diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 8a024cde6..92d2640ea 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -180,6 +180,12 @@ tap: routing: front: basePath: "" + nginx: + proxy: + bufferSize: 64k + buffersCount: 4 + buffersSize: 128k + busyBuffersSize: 128k ipv6: true debug: false dashboard: