diff --git a/cmd/helmChart.go b/cmd/helmChart.go index 3a9a5b47a..1ce224f5a 100644 --- a/cmd/helmChart.go +++ b/cmd/helmChart.go @@ -126,7 +126,7 @@ var hubPodMappings = map[string]interface{}{ }, { "name": "NAMESPACES", - "value": "{{ .Values.tap.namespaces }}", + "value": "{{ .Values.tap.allnamespaces | ternary \"\" .Values.tap.namespaces | quote }}", }, { "name": "STORAGE_LIMIT", @@ -139,26 +139,32 @@ var hubPodMappings = map[string]interface{}{ }, "spec.containers[0].image": "{{ .Values.tap.docker.registry }}/hub:{{ .Values.tap.docker.tag }}", "spec.containers[0].imagePullPolicy": "{{ .Values.tap.docker.imagePullPolicy }}", + "spec.imagePullSecrets": "{{ .Values.tap.docker.imagepullsecrets }}", "spec.containers[0].resources.limits.cpu": "{{ .Values.tap.resources.hub.cpu-limit }}", "spec.containers[0].resources.limits.memory": "{{ .Values.tap.resources.hub.memory-limit }}", "spec.containers[0].resources.requests.cpu": "{{ .Values.tap.resources.hub.cpu-requests }}", "spec.containers[0].resources.requests.memory": "{{ .Values.tap.resources.hub.memory-requests }}", + "spec.containers[0].command[0]": "{{ .Values.tap.debug | ternary \"./hub -debug\" \"./hub\" }}", } var hubServiceMappings = namespaceMappings var frontPodMappings = map[string]interface{}{ "metadata.name": "{{ .Values.tap.selfnamespace }}", "spec.containers[0].image": "{{ .Values.tap.docker.registry }}/front:{{ .Values.tap.docker.tag }}", "spec.containers[0].imagePullPolicy": "{{ .Values.tap.docker.imagePullPolicy }}", + "spec.imagePullSecrets": "{{ .Values.tap.docker.imagepullsecrets }}", } var frontServiceMappings = namespaceMappings var workerDaemonSetMappings = map[string]interface{}{ "metadata.name": "{{ .Values.tap.selfnamespace }}", "spec.template.spec.containers[0].image": "{{ .Values.tap.docker.registry }}/worker:{{ .Values.tap.docker.tag }}", "spec.template.spec.containers[0].imagePullPolicy": "{{ .Values.tap.docker.imagePullPolicy }}", + "spec.imagePullSecrets": "{{ .Values.tap.docker.imagepullsecrets }}", "spec.template.spec.containers[0].resources.limits.cpu": "{{ .Values.tap.resources.worker.cpu-limit }}", "spec.template.spec.containers[0].resources.limits.memory": "{{ .Values.tap.resources.worker.memory-limit }}", "spec.template.spec.containers[0].resources.requests.cpu": "{{ .Values.tap.resources.worker.cpu-requests }}", "spec.template.spec.containers[0].resources.requests.memory": "{{ .Values.tap.resources.worker.memory-requests }}", + "spec.template.spec.containers[0].command[0]": "{{ .Values.tap.debug | ternary \"./worker -debug\" \"./worker\" }}", + "spec.template.spec.containers[0].command[6]": "{{ .Values.tap.packetcapture }}", } func init() { diff --git a/helm-chart/templates/04-hub-pod.yaml b/helm-chart/templates/04-hub-pod.yaml index 31a54d2dd..6c69d039f 100644 --- a/helm-chart/templates/04-hub-pod.yaml +++ b/helm-chart/templates/04-hub-pod.yaml @@ -11,12 +11,12 @@ metadata: spec: containers: - command: - - ./hub + - '{{ .Values.tap.debug | ternary "./hub -debug" "./hub" }}' env: - name: POD_REGEX value: '{{ .Values.tap.regex }}' - name: NAMESPACES - value: '{{ .Values.tap.namespaces }}' + value: '{{ .Values.tap.allnamespaces | ternary "" .Values.tap.namespaces | quote }}' - name: STORAGE_LIMIT value: '{{ .Values.tap.storagelimit }}' - name: LICENSE @@ -32,6 +32,7 @@ spec: cpu: '{{ .Values.tap.resources.hub.cpu-requests }}' memory: '{{ .Values.tap.resources.hub.memory-requests }}' dnsPolicy: ClusterFirstWithHostNet + imagePullSecrets: '{{ .Values.tap.docker.imagepullsecrets }}' serviceAccountName: kubeshark-service-account terminationGracePeriodSeconds: 0 tolerations: diff --git a/helm-chart/templates/06-front-pod.yaml b/helm-chart/templates/06-front-pod.yaml index c6b78d103..eace32f25 100644 --- a/helm-chart/templates/06-front-pod.yaml +++ b/helm-chart/templates/06-front-pod.yaml @@ -35,6 +35,7 @@ spec: cpu: 50m memory: 50Mi dnsPolicy: ClusterFirstWithHostNet + imagePullSecrets: '{{ .Values.tap.docker.imagepullsecrets }}' serviceAccountName: kubeshark-service-account terminationGracePeriodSeconds: 0 tolerations: diff --git a/helm-chart/templates/08-worker-daemon-set.yaml b/helm-chart/templates/08-worker-daemon-set.yaml index c861dc7b4..ffb0ff3d6 100644 --- a/helm-chart/templates/08-worker-daemon-set.yaml +++ b/helm-chart/templates/08-worker-daemon-set.yaml @@ -9,6 +9,7 @@ metadata: name: '{{ .Values.tap.selfnamespace }}' namespace: kubeshark spec: + imagePullSecrets: '{{ .Values.tap.docker.imagepullsecrets }}' selector: matchLabels: app: kubeshark-worker-daemon-set @@ -26,11 +27,13 @@ spec: spec: containers: - command: - - ./worker + - '{{ .Values.tap.debug | ternary "./worker -debug" "./worker" }}' - -i - any - -port - "8897" + - -packet-capture + - '{{ .Values.tap.packetcapture }}' - -servicemesh - -tls - -procfs diff --git a/kubernetes/provider.go b/kubernetes/provider.go index c96e9b547..8df2a2c90 100644 --- a/kubernetes/provider.go +++ b/kubernetes/provider.go @@ -706,7 +706,15 @@ func (provider *Provider) BuildWorkerDaemonSet( } // Command - command := []string{"./worker", "-i", "any", "-port", "8897"} + command := []string{ + "./worker", + "-i", + "any", + "-port", + "8897", + "-packet-capture", + config.Config.Tap.PacketCapture, + } if debug { command = append(command, "-debug") } diff --git a/manifests/08-worker-daemon-set.yaml b/manifests/08-worker-daemon-set.yaml index 5ee38dbab..073ad9d21 100644 --- a/manifests/08-worker-daemon-set.yaml +++ b/manifests/08-worker-daemon-set.yaml @@ -31,6 +31,8 @@ spec: - any - -port - "8897" + - -packet-capture + - libpcap - -servicemesh - -tls - -procfs