Skip to content

Commit

Permalink
feat: Create api key secret in all namespaces (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimH98 authored Jan 23, 2024
1 parent fa2abd2 commit 9ad644e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/launch-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: launch-agent
icon: https://em-content.zobj.net/thumbs/240/apple/354/rocket_1f680.png
description: A Helm chart for running the W&B Launch Agent in Kubernetes
type: application
version: 0.11.6
version: 0.11.7
maintainers:
- name: wandb
email: support@wandb.com
Expand Down
2 changes: 2 additions & 0 deletions charts/launch-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
value: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
- name: WANDB_LAUNCH_START_TIMEOUT
value: "{{ .Values.agent.startTimeout }}"
- name: WANDB_RELEASE_NAME
value: "{{ .Release.Name }}"
volumeMounts:
- name: wandb-launch-config
mountPath: /home/launch_agent/.config/wandb
Expand Down
12 changes: 9 additions & 3 deletions charts/launch-agent/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
{{- if not .Values.agent.useExternalWandbSecret }}
{{- $root := . -}}
{{- $unique := uniq (append .Values.additionalTargetNamespaces .Values.namespace) }}
{{- range $ns := $unique }}
---
apiVersion: v1
kind: Secret
metadata:
name: wandb-api-key-{{ .Release.Name }}
namespace: {{ .Values.namespace }}
name: wandb-api-key-{{ $root.Release.Name }}
namespace: {{ $ns }}
labels:
wandb.ai/created-by: helm-chart
type: kubernetes.io/basic-auth
stringData:
password: {{ required "Please set agent.apiKey to a W&B API key" .Values.agent.apiKey }}
password: {{ required "Please set agent.apiKey to a W&B API key" $root.Values.agent.apiKey }}
...
{{ end }}

{{- end }}
{{- if .Values.gitCreds }}
---
apiVersion: v1
Expand Down

0 comments on commit 9ad644e

Please sign in to comment.