Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Creating secret when secretName is provided #295

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.21.9
version: 0.21.10
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
6 changes: 3 additions & 3 deletions charts/operator-wandb/charts/app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
optional: true
key: {{ .Values.global.redis.secret.secretKey }}
- name: REDIS_PORT
Expand Down Expand Up @@ -336,8 +336,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "app.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
optional: true
key: {{ .Values.global.redis.secret.secretKey }}
- name: REDIS_PORT
Expand Down Expand Up @@ -169,8 +169,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "executor.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
optional: true
key: REDIS_PASSWORD
- name: REDIS_PORT
Expand Down Expand Up @@ -177,8 +177,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "filestream.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
optional: true
key: REDIS_PASSWORD
- name: REDIS_PORT
Expand Down Expand Up @@ -189,8 +189,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "flat-run-fields-updater.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
6 changes: 3 additions & 3 deletions charts/operator-wandb/charts/parquet/templates/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
key: REDIS_PASSWORD
{{- end }}
- name: REDIS_PORT
Expand Down Expand Up @@ -166,8 +166,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "parquet.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
optional: true
key: REDIS_PASSWORD
- name: REDIS_PORT
Expand Down Expand Up @@ -196,8 +196,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "parquet.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "mysql-exporter.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wandb.redis.passwordSecret" . }}
name: {{ include "wandb.redis.secretName" . }}
optional: true
key: REDIS_PASSWORD
- name: REDIS_PORT
Expand Down Expand Up @@ -89,8 +89,8 @@ spec:
volumes:
{{- if ne (include "wandb.redis.caCert" .) "" }}
- name: {{ include "redis-exporter.fullname" . }}-redis-ca
secret:
secretName: "{{ include "wandb.redis.passwordSecret" . }}"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
2 changes: 1 addition & 1 deletion charts/operator-wandb/templates/_redis.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Return name of secret where redis information is stored
*/}}
{{- define "wandb.redis.passwordSecret" -}}
{{- define "wandb.redis.secretName" -}}
{{- if .Values.global.redis.secret.secretName -}}
{{ .Values.global.redis.secret.secretName }}
{{- else -}}
Expand Down
7 changes: 3 additions & 4 deletions charts/operator-wandb/templates/redis.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{{- if not .Values.redis.install }}
{{- $secretName := (include "wandb.redis.passwordSecret" .) }}
{{- if not (or .Values.redis.install .Values.global.redis.secret.secretName) }}
apiVersion: v1
kind: Secret
metadata:
name: "{{ $secretName }}"
name: "{{ .Release.Name }}-redis-secret"
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
data:
REDIS_PASSWORD: {{ include "wandb.redis.password" . | b64enc }}
REDIS_CA_CERT: {{ include "wandb.redis.caCert" . | b64enc }}
{{- end }}

---
Expand All @@ -19,5 +17,6 @@ metadata:
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
data:
REDIS_CA_CERT: {{ include "wandb.redis.caCert" . | quote}}
REDIS_PORT: "{{ include "wandb.redis.port" . }}"
REDIS_HOST: "{{ include "wandb.redis.host" . }}"
4 changes: 2 additions & 2 deletions charts/operator-wandb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ glue:
name: '{{ .Values.global.caCertsConfigMap | default "noCertProvided" }}'
optional: true
- name: redis-ca
secret:
secretName: "{{ .Release.Name }}-redis-secret"
configMap:
name: "{{ .Release.Name }}-redis-configmap"
items:
- key: REDIS_CA_CERT
path: redis_ca.pem
Expand Down
Loading