From b5aceec0a8be7514313e69420ea108a5610e5ce8 Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Mon, 22 Jul 2024 10:30:53 -0700 Subject: [PATCH] fix: Add an SA for weave-trace deployment (#182) --- charts/operator-wandb/Chart.yaml | 2 +- .../weave-trace/templates/deployment.yaml | 1 + .../weave-trace/templates/serviceaccount.yaml | 17 +++++++++++++++++ .../charts/weave-trace/values.yaml | 4 +++- .../charts/weave/templates/deployment.yaml | 2 +- .../charts/weave/templates/serviceaccount.yaml | 17 +++++++++++++++++ charts/operator-wandb/charts/weave/values.yaml | 4 +++- 7 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml create mode 100644 charts/operator-wandb/charts/weave/templates/serviceaccount.yaml diff --git a/charts/operator-wandb/Chart.yaml b/charts/operator-wandb/Chart.yaml index 6e9715d3..bb341aa8 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.15.2 +version: 0.15.3 appVersion: 1.0.0 icon: https://wandb.ai/logo.svg diff --git a/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml b/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml index a606fca2..653b1ea0 100644 --- a/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml +++ b/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml @@ -142,6 +142,7 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} + serviceAccountName: {{ include "weaveTrace.serviceAccountName" . }} --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler diff --git a/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml b/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml new file mode 100644 index 00000000..efd4314d --- /dev/null +++ b/charts/operator-wandb/charts/weave-trace/templates/serviceaccount.yaml @@ -0,0 +1,17 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "weaveTrace.serviceAccountName" . }} + labels: + {{- include "wandb.commonLabels" . | nindent 4 }} + {{- include "weaveTrace.commonLabels" . | nindent 4 }} + {{- include "weaveTrace.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/weave-trace/values.yaml b/charts/operator-wandb/charts/weave-trace/values.yaml index 410a2411..44bf08a2 100644 --- a/charts/operator-wandb/charts/weave-trace/values.yaml +++ b/charts/operator-wandb/charts/weave-trace/values.yaml @@ -16,7 +16,9 @@ extraCors: [] common: labels: {} deployment: {} -serviceAccount: {} +serviceAccount: + create: true + annotations: {} clusterRole: {} service: diff --git a/charts/operator-wandb/charts/weave/templates/deployment.yaml b/charts/operator-wandb/charts/weave/templates/deployment.yaml index 99c7d6b6..b3b7b9a4 100644 --- a/charts/operator-wandb/charts/weave/templates/deployment.yaml +++ b/charts/operator-wandb/charts/weave/templates/deployment.yaml @@ -107,7 +107,7 @@ spec: resources: {{- toYaml .Values.cacheClear.resources | nindent 12 }} - + serviceAccountName: {{ include "weave.serviceAccountName" . }} volumes: - name: cache emptyDir: diff --git a/charts/operator-wandb/charts/weave/templates/serviceaccount.yaml b/charts/operator-wandb/charts/weave/templates/serviceaccount.yaml new file mode 100644 index 00000000..f2d37925 --- /dev/null +++ b/charts/operator-wandb/charts/weave/templates/serviceaccount.yaml @@ -0,0 +1,17 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "weave.serviceAccountName" . }} + labels: + {{- include "wandb.commonLabels" . | nindent 4 }} + {{- include "weave.commonLabels" . | nindent 4 }} + {{- include "weave.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/weave/values.yaml b/charts/operator-wandb/charts/weave/values.yaml index cb138c3b..06b3ea74 100644 --- a/charts/operator-wandb/charts/weave/values.yaml +++ b/charts/operator-wandb/charts/weave/values.yaml @@ -25,7 +25,9 @@ extraCors: [] common: labels: {} deployment: {} -serviceAccount: {} +serviceAccount: + create: true + annotations: {} clusterRole: {} service: