🔥 Remove --hub-ws-address flag and max-live-streams option

This commit is contained in:
M. Mert Yildiran 2022-12-11 11:52:33 +03:00
parent 48e5c2f9c2
commit 5973a77cf8
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461
5 changed files with 2 additions and 13 deletions

View File

@ -57,5 +57,4 @@ func init() {
deployCmd.Flags().Bool(configStructs.ServiceMeshName, defaultDeployConfig.ServiceMesh, "Record decrypted traffic if the cluster is configured with a service mesh and with mtls.") deployCmd.Flags().Bool(configStructs.ServiceMeshName, defaultDeployConfig.ServiceMesh, "Record decrypted traffic if the cluster is configured with a service mesh and with mtls.")
deployCmd.Flags().Bool(configStructs.TlsName, defaultDeployConfig.Tls, "Record tls traffic.") deployCmd.Flags().Bool(configStructs.TlsName, defaultDeployConfig.Tls, "Record tls traffic.")
deployCmd.Flags().Bool(configStructs.ProfilerName, defaultDeployConfig.Profiler, "Run pprof server.") deployCmd.Flags().Bool(configStructs.ProfilerName, defaultDeployConfig.Profiler, "Run pprof server.")
deployCmd.Flags().Int(configStructs.MaxLiveStreamsName, defaultDeployConfig.MaxLiveStreams, "Maximum live tcp streams to handle concurrently.")
} }

View File

@ -153,7 +153,6 @@ func startWorkerSyncer(ctx context.Context, cancel context.CancelFunc, provider
KubesharkServiceAccountExists: state.kubesharkServiceAccountExists, KubesharkServiceAccountExists: state.kubesharkServiceAccountExists,
ServiceMesh: config.Config.Deploy.ServiceMesh, ServiceMesh: config.Config.Deploy.ServiceMesh,
Tls: config.Config.Deploy.Tls, Tls: config.Config.Deploy.Tls,
MaxLiveStreams: config.Config.Deploy.MaxLiveStreams,
}, startTime) }, startTime)
if err != nil { if err != nil {

View File

@ -24,7 +24,6 @@ const (
ServiceMeshName = "service-mesh" ServiceMeshName = "service-mesh"
TlsName = "tls" TlsName = "tls"
ProfilerName = "profiler" ProfilerName = "profiler"
MaxLiveStreamsName = "max-live-streams"
) )
type DeployConfig struct { type DeployConfig struct {
@ -52,7 +51,6 @@ type DeployConfig struct {
Tls bool `yaml:"tls" default:"false"` Tls bool `yaml:"tls" default:"false"`
PacketCapture string `yaml:"packet-capture" default:"libpcap"` PacketCapture string `yaml:"packet-capture" default:"libpcap"`
Profiler bool `yaml:"profiler" default:"false"` Profiler bool `yaml:"profiler" default:"false"`
MaxLiveStreams int `yaml:"max-live-streams" default:"500"`
} }
func (config *DeployConfig) PodRegex() *regexp.Regexp { func (config *DeployConfig) PodRegex() *regexp.Regexp {

View File

@ -48,7 +48,6 @@ type WorkerSyncerConfig struct {
KubesharkServiceAccountExists bool KubesharkServiceAccountExists bool
ServiceMesh bool ServiceMesh bool
Tls bool Tls bool
MaxLiveStreams int
} }
func CreateAndStartWorkerSyncer(ctx context.Context, kubernetesProvider *Provider, config WorkerSyncerConfig, startTime time.Time) (*WorkerSyncer, error) { func CreateAndStartWorkerSyncer(ctx context.Context, kubernetesProvider *Provider, config WorkerSyncerConfig, startTime time.Time) (*WorkerSyncer, error) {
@ -371,7 +370,6 @@ func (workerSyncer *WorkerSyncer) updateWorkers() error {
WorkerDaemonSetName, WorkerDaemonSetName,
image, image,
WorkerPodName, WorkerPodName,
fmt.Sprintf("%s.%s.svc", HubPodName, workerSyncer.config.KubesharkResourcesNamespace),
nodeNames, nodeNames,
serviceAccountName, serviceAccountName,
workerSyncer.config.WorkerResources, workerSyncer.config.WorkerResources,
@ -379,8 +377,7 @@ func (workerSyncer *WorkerSyncer) updateWorkers() error {
workerSyncer.config.KubesharkApiFilteringOptions, workerSyncer.config.KubesharkApiFilteringOptions,
workerSyncer.config.LogLevel, workerSyncer.config.LogLevel,
workerSyncer.config.ServiceMesh, workerSyncer.config.ServiceMesh,
workerSyncer.config.Tls, workerSyncer.config.Tls); err != nil {
workerSyncer.config.MaxLiveStreams); err != nil {
return err return err
} }

View File

@ -10,7 +10,6 @@ import (
"net/url" "net/url"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strconv"
"github.com/kubeshark/base/pkg/api" "github.com/kubeshark/base/pkg/api"
"github.com/kubeshark/base/pkg/models" "github.com/kubeshark/base/pkg/models"
@ -781,7 +780,7 @@ func (provider *Provider) CreateConfigMap(ctx context.Context, namespace string,
return nil return nil
} }
func (provider *Provider) ApplyWorkerDaemonSet(ctx context.Context, namespace string, daemonSetName string, podImage string, workerPodName string, hubPodIp string, nodeNames []string, serviceAccountName string, resources models.Resources, imagePullPolicy core.PullPolicy, kubesharkApiFilteringOptions api.TrafficFilteringOptions, logLevel zerolog.Level, serviceMesh bool, tls bool, maxLiveStreams int) error { func (provider *Provider) ApplyWorkerDaemonSet(ctx context.Context, namespace string, daemonSetName string, podImage string, workerPodName string, nodeNames []string, serviceAccountName string, resources models.Resources, imagePullPolicy core.PullPolicy, kubesharkApiFilteringOptions api.TrafficFilteringOptions, logLevel zerolog.Level, serviceMesh bool, tls bool) error {
log.Debug(). log.Debug().
Int("node-count", len(nodeNames)). Int("node-count", len(nodeNames)).
Str("namespace", namespace). Str("namespace", namespace).
@ -802,9 +801,6 @@ func (provider *Provider) ApplyWorkerDaemonSet(ctx context.Context, namespace st
kubesharkCmd := []string{ kubesharkCmd := []string{
"./worker", "./worker",
"-i", "any", "-i", "any",
"--hub-ws-address", fmt.Sprintf("ws://%s/wsWorker", hubPodIp),
"--nodefrag",
"--max-live-streams", strconv.Itoa(maxLiveStreams),
} }
if serviceMesh { if serviceMesh {