From 314ff0e96b1b6b05fdc070365fe6edf33f297134 Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Thu, 18 Jul 2024 14:43:49 -0700 Subject: [PATCH] fix: Normalize the service account create logic for all wandb applications (#178) --- charts/operator-wandb/Chart.yaml | 2 +- .../charts/app/templates/serviceaccount.yaml | 2 ++ charts/operator-wandb/charts/app/values.yaml | 1 + .../charts/console/templates/deployment.yaml | 2 +- .../console/templates/serviceaccount.yaml | 2 ++ .../operator-wandb/charts/console/values.yaml | 4 +++- .../templates/serviceaccount.yaml | 1 + .../charts/parquet/templates/deployment.yaml | 1 + .../parquet/templates/serviceaccount.yaml | 17 +++++++++++++++++ .../operator-wandb/charts/parquet/values.yaml | 4 +++- 10 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 charts/operator-wandb/charts/parquet/templates/serviceaccount.yaml diff --git a/charts/operator-wandb/Chart.yaml b/charts/operator-wandb/Chart.yaml index 4e14c641..15f5ee5e 100644 --- a/charts/operator-wandb/Chart.yaml +++ b/charts/operator-wandb/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: operator-wandb description: A Helm chart for deploying W&B to Kubernetes type: application -version: 0.14.17 +version: 0.15.0 appVersion: 1.0.0 icon: https://wandb.ai/logo.svg diff --git a/charts/operator-wandb/charts/app/templates/serviceaccount.yaml b/charts/operator-wandb/charts/app/templates/serviceaccount.yaml index c3824d12..f0639978 100644 --- a/charts/operator-wandb/charts/app/templates/serviceaccount.yaml +++ b/charts/operator-wandb/charts/app/templates/serviceaccount.yaml @@ -1,3 +1,4 @@ +{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -14,3 +15,4 @@ metadata: {{- if .Values.serviceAccount.annotations -}} {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/operator-wandb/charts/app/values.yaml b/charts/operator-wandb/charts/app/values.yaml index 9afff84c..ffc8d8fb 100644 --- a/charts/operator-wandb/charts/app/values.yaml +++ b/charts/operator-wandb/charts/app/values.yaml @@ -53,6 +53,7 @@ resources: serviceAccount: create: true + annotations: {} role: {} roleBinding: {} diff --git a/charts/operator-wandb/charts/console/templates/deployment.yaml b/charts/operator-wandb/charts/console/templates/deployment.yaml index 835a727d..54c983b4 100644 --- a/charts/operator-wandb/charts/console/templates/deployment.yaml +++ b/charts/operator-wandb/charts/console/templates/deployment.yaml @@ -34,7 +34,7 @@ spec: {{- toYaml .Values.pod.annotations | nindent 4 }} {{- end }} spec: - serviceAccountName: {{ include "console.fullname" . }} + serviceAccountName: {{ include "console.serviceAccountName" . }} {{- if .tolerations }} tolerations: {{- toYaml .tolerations | nindent 8 }} diff --git a/charts/operator-wandb/charts/console/templates/serviceaccount.yaml b/charts/operator-wandb/charts/console/templates/serviceaccount.yaml index 2eea38c2..3cda2894 100644 --- a/charts/operator-wandb/charts/console/templates/serviceaccount.yaml +++ b/charts/operator-wandb/charts/console/templates/serviceaccount.yaml @@ -1,3 +1,4 @@ +{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -14,3 +15,4 @@ metadata: {{- if .Values.serviceAccount.annotations -}} {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/operator-wandb/charts/console/values.yaml b/charts/operator-wandb/charts/console/values.yaml index ea23750e..827f646a 100644 --- a/charts/operator-wandb/charts/console/values.yaml +++ b/charts/operator-wandb/charts/console/values.yaml @@ -21,7 +21,9 @@ extraCors: [] common: labels: {} deployment: {} -serviceAccount: {} +serviceAccount: + create: true + annotations: {} clusterRole: {} pod: diff --git a/charts/operator-wandb/charts/flat-run-fields-updater/templates/serviceaccount.yaml b/charts/operator-wandb/charts/flat-run-fields-updater/templates/serviceaccount.yaml index 18053197..13cca672 100644 --- a/charts/operator-wandb/charts/flat-run-fields-updater/templates/serviceaccount.yaml +++ b/charts/operator-wandb/charts/flat-run-fields-updater/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "flat-run-fields-updater.serviceAccountName" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "wandb.commonLabels" . | nindent 4 }} {{- include "flat-run-fields-updater.commonLabels" . | nindent 4 }} diff --git a/charts/operator-wandb/charts/parquet/templates/deployment.yaml b/charts/operator-wandb/charts/parquet/templates/deployment.yaml index e37e973f..ddfd26cf 100644 --- a/charts/operator-wandb/charts/parquet/templates/deployment.yaml +++ b/charts/operator-wandb/charts/parquet/templates/deployment.yaml @@ -140,6 +140,7 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} + serviceAccountName: {{ include "parquet.serviceAccountName" . }} volumes: {{- if ne (include "wandb.redis.caCert" .) "" }} - name: {{ include "parquet.fullname" . }}-redis-ca diff --git a/charts/operator-wandb/charts/parquet/templates/serviceaccount.yaml b/charts/operator-wandb/charts/parquet/templates/serviceaccount.yaml new file mode 100644 index 00000000..0a1caf7e --- /dev/null +++ b/charts/operator-wandb/charts/parquet/templates/serviceaccount.yaml @@ -0,0 +1,17 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "parquet.serviceAccountName" . }} + labels: + {{- include "wandb.commonLabels" . | nindent 4 }} + {{- include "parquet.commonLabels" . | nindent 4 }} + {{- include "parquet.labels" . | nindent 4 }} + {{- if .Values.serviceAccount.labels -}} + {{- toYaml .Values.serviceAccount.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.serviceAccount.annotations -}} + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/operator-wandb/charts/parquet/values.yaml b/charts/operator-wandb/charts/parquet/values.yaml index 591417fa..547a3700 100644 --- a/charts/operator-wandb/charts/parquet/values.yaml +++ b/charts/operator-wandb/charts/parquet/values.yaml @@ -22,7 +22,9 @@ cronJob: exportHistoryToParquet: enabled: false schedule: "11 * * * *" -serviceAccount: {} +serviceAccount: + create: true + annotations: {} clusterRole: {} service: