Skip to content

Commit

Permalink
Merge pull request #1153 from porter-dev/redis-updates
Browse files Browse the repository at this point in the history
delegate setting password to env groups when deploying redis
  • Loading branch information
ianedwards authored Jan 4, 2024
2 parents d95362c + f7d3f5d commit 7e584ee
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 118 deletions.
30 changes: 9 additions & 21 deletions addons/redis-managed/templates/master/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
kind: {{ .Values.master.kind }}
metadata:
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
name: {{ printf "%s" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: master
Expand All @@ -24,7 +24,7 @@ spec:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: master
{{- if (eq .Values.master.kind "StatefulSet") }}
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
serviceName: {{ printf "%s" (include "common.names.fullname" .) }}
{{- end }}
{{- if .Values.master.updateStrategy }}
{{- if (eq .Values.master.kind "Deployment") }}
Expand Down Expand Up @@ -134,18 +134,6 @@ spec:
value: master
- name: ALLOW_EMPTY_PASSWORD
value: {{ ternary "no" "yes" .Values.auth.enabled | quote }}
{{- if .Values.auth.enabled }}
{{- if .Values.auth.usePasswordFiles }}
- name: REDIS_PASSWORD_FILE
value: "/opt/bitnami/redis/secrets/redis-password"
{{- else }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "redis.secretName" . }}
key: {{ template "redis.secretPasswordKey" . }}
{{- end }}
{{- end }}
- name: REDIS_TLS_ENABLED
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
{{- if .Values.tls.enabled }}
Expand All @@ -170,16 +158,16 @@ spec:
{{- if .Values.master.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.master.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
{{- if or .Values.master.extraEnvVarsCM .Values.master.extraEnvVarsSecret }}
{{- if or .Values.master.configMapRefs .Values.master.secretRefs }}
envFrom:
{{- if .Values.master.extraEnvVarsCM }}
{{ range $configMapName := .Values.master.configMapRefs }}
- configMapRef:
name: {{ .Values.master.extraEnvVarsCM }}
{{- end }}
{{- if .Values.master.extraEnvVarsSecret }}
name: {{ $configMapName }}
{{ end }}
{{ range $secretName := .Values.master.secretRefs }}
- secretRef:
name: {{ .Values.master.extraEnvVarsSecret }}
{{- end }}
name: {{ $secretName }}
{{ end }}
{{- end }}
ports:
- name: redis
Expand Down
2 changes: 1 addition & 1 deletion addons/redis-managed/templates/master/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
name: {{ printf "%s" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: master
Expand Down
Loading

0 comments on commit 7e584ee

Please sign in to comment.