mirror of
https://github.com/rtomik/helm-charts.git
synced 2026-07-16 08:14:48 +00:00
Helm chart for norish upgraded to work with new version 0.14.1
added redis config when upgrading refer to readme file
This commit is contained in:
@ -55,3 +55,43 @@ Database connection URL
|
||||
{{- $database := .Values.database.name }}
|
||||
{{- printf "postgres://%s:%s@%s:%d/%s" $username $password $host (int $port) $database }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis URL (for non-authenticated Redis)
|
||||
Constructs the Redis URL without authentication.
|
||||
Format: redis://host:port/database
|
||||
*/}}
|
||||
{{- define "norish.redis.url.noauth" -}}
|
||||
{{- $host := .Values.redis.host }}
|
||||
{{- $port := .Values.redis.port }}
|
||||
{{- $database := .Values.redis.database | toString }}
|
||||
{{- printf "redis://%s:%d/%s" $host (int $port) $database }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Check if Redis authentication is configured
|
||||
Returns true if either existingSecret or password is set
|
||||
*/}}
|
||||
{{- define "norish.redis.hasAuth" -}}
|
||||
{{- if or .Values.redis.existingSecret .Values.redis.password }}
|
||||
{{- "true" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Redis URL with authentication (for secret generation)
|
||||
Constructs the Redis URL with password interpolation for use in secrets.
|
||||
Format: redis://[username]:[password]@host:port/database
|
||||
*/}}
|
||||
{{- define "norish.redis.url.withPassword" -}}
|
||||
{{- $host := .Values.redis.host }}
|
||||
{{- $port := .Values.redis.port }}
|
||||
{{- $database := .Values.redis.database | toString }}
|
||||
{{- $username := .Values.redis.username | default "" }}
|
||||
{{- $password := .Values.redis.password | default "" }}
|
||||
{{- if $username }}
|
||||
{{- printf "redis://%s:%s@%s:%d/%s" $username $password $host (int $port) $database }}
|
||||
{{- else }}
|
||||
{{- printf "redis://:%s@%s:%d/%s" $password $host (int $port) $database }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@ -145,6 +145,16 @@ spec:
|
||||
name: {{ include "norish.fullname" . }}-secret
|
||||
key: master-key
|
||||
{{- end }}
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
{{- if .Values.redis.existingSecret }}
|
||||
name: {{ .Values.redis.existingSecret }}
|
||||
key: {{ .Values.redis.urlKey | default "redis-url" }}
|
||||
{{- else }}
|
||||
name: {{ include "norish.fullname" . }}-secret
|
||||
key: redis-url
|
||||
{{- end }}
|
||||
{{- if .Values.config.auth.oidc.enabled }}
|
||||
- name: OIDC_NAME
|
||||
value: {{ .Values.config.auth.oidc.name | quote }}
|
||||
|
||||
@ -12,6 +12,13 @@ stringData:
|
||||
{{- if not .Values.database.existingSecret }}
|
||||
database-url: {{ include "norish.databaseUrl" . | quote }}
|
||||
{{- end }}
|
||||
{{- if not .Values.redis.existingSecret }}
|
||||
{{- if .Values.redis.password }}
|
||||
redis-url: {{ include "norish.redis.url.withPassword" . | quote }}
|
||||
{{- else }}
|
||||
redis-url: {{ include "norish.redis.url.noauth" . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.config.auth.oidc.enabled }}
|
||||
{{- if not .Values.config.auth.oidc.existingSecret }}
|
||||
oidc-client-id: {{ .Values.config.auth.oidc.clientId | quote }}
|
||||
|
||||
Reference in New Issue
Block a user