From bedecdb080407d0295b81544440694fd65fcd761 Mon Sep 17 00:00:00 2001 From: Volodymyr Stoiko Date: Wed, 18 Jun 2025 18:45:17 +0300 Subject: [PATCH] Fix bugs in helm chart (#1765) --- helm-chart/templates/01-service-account.yaml | 8 +++++++- helm-chart/templates/02-cluster-role.yaml | 4 ++-- helm-chart/templates/03-cluster-role-binding.yaml | 2 +- helm-chart/templates/04-hub-deployment.yaml | 8 +------- helm-chart/templates/05-hub-service.yaml | 2 +- helm-chart/templates/06-front-deployment.yaml | 8 +------- helm-chart/templates/07-front-service.yaml | 2 +- .../templates/08-persistent-volume-claim.yaml | 2 +- helm-chart/templates/09-worker-daemon-set.yaml | 14 +------------- helm-chart/templates/17-network-policies.yaml | 2 +- helm-chart/templates/18-dex-deployment.yaml | 8 +------- helm-chart/templates/19-dex-service.yaml | 2 +- 12 files changed, 19 insertions(+), 43 deletions(-) diff --git a/helm-chart/templates/01-service-account.yaml b/helm-chart/templates/01-service-account.yaml index da63d830e..a74a92b09 100644 --- a/helm-chart/templates/01-service-account.yaml +++ b/helm-chart/templates/01-service-account.yaml @@ -4,9 +4,15 @@ kind: ServiceAccount metadata: labels: {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: {{ include "kubeshark.serviceAccountName" . }} namespace: {{ .Release.Namespace }} +{{- if .Values.tap.docker.imagePullSecrets }} +imagePullSecrets: + {{- range .Values.tap.docker.imagePullSecrets }} + - name: {{ . }} + {{- end }} +{{- end }} diff --git a/helm-chart/templates/02-cluster-role.yaml b/helm-chart/templates/02-cluster-role.yaml index add390390..0911c4263 100644 --- a/helm-chart/templates/02-cluster-role.yaml +++ b/helm-chart/templates/02-cluster-role.yaml @@ -4,8 +4,8 @@ kind: ClusterRole metadata: labels: {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-cluster-role-{{ .Release.Namespace }} @@ -85,4 +85,4 @@ rules: - pods/log verbs: - create - - get \ No newline at end of file + - get diff --git a/helm-chart/templates/03-cluster-role-binding.yaml b/helm-chart/templates/03-cluster-role-binding.yaml index a002ad055..2a728ab6b 100644 --- a/helm-chart/templates/03-cluster-role-binding.yaml +++ b/helm-chart/templates/03-cluster-role-binding.yaml @@ -4,8 +4,8 @@ kind: ClusterRoleBinding metadata: labels: {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-cluster-role-binding-{{ .Release.Namespace }} diff --git a/helm-chart/templates/04-hub-deployment.yaml b/helm-chart/templates/04-hub-deployment.yaml index 4231092d2..49df442d3 100644 --- a/helm-chart/templates/04-hub-deployment.yaml +++ b/helm-chart/templates/04-hub-deployment.yaml @@ -5,8 +5,8 @@ metadata: labels: app.kubeshark.co/app: hub {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: {{ include "kubeshark.name" . }}-hub @@ -101,12 +101,6 @@ spec: - name: saml-x509-volume mountPath: "/etc/saml/x509" readOnly: true - {{- if .Values.tap.docker.imagePullSecrets }} - imagePullSecrets: - {{- range .Values.tap.docker.imagePullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} {{- if gt (len .Values.tap.nodeSelectorTerms.hub) 0}} affinity: nodeAffinity: diff --git a/helm-chart/templates/05-hub-service.yaml b/helm-chart/templates/05-hub-service.yaml index b7d19cf2c..656eca6dd 100644 --- a/helm-chart/templates/05-hub-service.yaml +++ b/helm-chart/templates/05-hub-service.yaml @@ -5,8 +5,8 @@ metadata: labels: app.kubeshark.co/app: hub {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-hub diff --git a/helm-chart/templates/06-front-deployment.yaml b/helm-chart/templates/06-front-deployment.yaml index 6fd699df5..cda39fb00 100644 --- a/helm-chart/templates/06-front-deployment.yaml +++ b/helm-chart/templates/06-front-deployment.yaml @@ -4,8 +4,8 @@ metadata: labels: app.kubeshark.co/app: front {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: {{ include "kubeshark.name" . }}-front @@ -122,12 +122,6 @@ spec: mountPath: /etc/nginx/conf.d/default.conf subPath: default.conf readOnly: true - {{- if .Values.tap.docker.imagePullSecrets }} - imagePullSecrets: - {{- range .Values.tap.docker.imagePullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} {{- if gt (len .Values.tap.nodeSelectorTerms.front) 0}} affinity: nodeAffinity: diff --git a/helm-chart/templates/07-front-service.yaml b/helm-chart/templates/07-front-service.yaml index eab85522c..fb24e705d 100644 --- a/helm-chart/templates/07-front-service.yaml +++ b/helm-chart/templates/07-front-service.yaml @@ -4,8 +4,8 @@ kind: Service metadata: labels: {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-front diff --git a/helm-chart/templates/08-persistent-volume-claim.yaml b/helm-chart/templates/08-persistent-volume-claim.yaml index 49c4cb4c5..20b75f029 100644 --- a/helm-chart/templates/08-persistent-volume-claim.yaml +++ b/helm-chart/templates/08-persistent-volume-claim.yaml @@ -26,8 +26,8 @@ kind: PersistentVolumeClaim metadata: labels: {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-persistent-volume-claim diff --git a/helm-chart/templates/09-worker-daemon-set.yaml b/helm-chart/templates/09-worker-daemon-set.yaml index 575286db7..a183eb365 100644 --- a/helm-chart/templates/09-worker-daemon-set.yaml +++ b/helm-chart/templates/09-worker-daemon-set.yaml @@ -6,8 +6,8 @@ metadata: app.kubeshark.co/app: worker sidecar.istio.io/inject: "false" {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-worker-daemon-set @@ -107,12 +107,6 @@ spec: image: '{{ .Values.tap.docker.registry }}/worker:{{ not (eq .Values.tap.docker.tag "") | ternary .Values.tap.docker.tag (include "kubeshark.defaultVersion" .) }}{{ include "kubeshark.dockerTagDebugVersion" . }}' {{- end }} imagePullPolicy: {{ .Values.tap.docker.imagePullPolicy }} - {{- if .Values.tap.docker.imagePullSecrets }} - imagePullSecrets: - {{- range .Values.tap.docker.imagePullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} name: sniffer ports: - containerPort: {{ .Values.tap.metrics.port }} @@ -353,12 +347,6 @@ spec: {{- end }} {{- end }} {{- end }} - {{- if .Values.tap.docker.imagePullSecrets }} - imagePullSecrets: - {{- range .Values.tap.docker.imagePullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} {{- if gt (len .Values.tap.nodeSelectorTerms.workers) 0}} affinity: nodeAffinity: diff --git a/helm-chart/templates/17-network-policies.yaml b/helm-chart/templates/17-network-policies.yaml index 9235daf75..e9dcdad39 100644 --- a/helm-chart/templates/17-network-policies.yaml +++ b/helm-chart/templates/17-network-policies.yaml @@ -3,8 +3,8 @@ kind: NetworkPolicy metadata: labels: {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-hub-network-policy diff --git a/helm-chart/templates/18-dex-deployment.yaml b/helm-chart/templates/18-dex-deployment.yaml index ea2d07f73..bf50dddc7 100644 --- a/helm-chart/templates/18-dex-deployment.yaml +++ b/helm-chart/templates/18-dex-deployment.yaml @@ -7,8 +7,8 @@ metadata: labels: app.kubeshark.co/app: dex {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: {{ include "kubeshark.name" . }}-dex @@ -69,12 +69,6 @@ spec: requests: cpu: 50m memory: 50Mi - {{- if .Values.tap.docker.imagePullSecrets }} - imagePullSecrets: - {{- range .Values.tap.docker.imagePullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} {{- if gt (len .Values.tap.nodeSelectorTerms.dex) 0}} affinity: nodeAffinity: diff --git a/helm-chart/templates/19-dex-service.yaml b/helm-chart/templates/19-dex-service.yaml index f10db2423..e8a29d838 100644 --- a/helm-chart/templates/19-dex-service.yaml +++ b/helm-chart/templates/19-dex-service.yaml @@ -7,8 +7,8 @@ metadata: labels: app.kubeshark.co/app: dex {{- include "kubeshark.labels" . | nindent 4 }} - annotations: {{- if .Values.tap.annotations }} + annotations: {{- toYaml .Values.tap.annotations | nindent 4 }} {{- end }} name: kubeshark-dex