bitnami/charts

[bitnami/mastodon] missing support for redis sub-chart's `redis.auth.existingSecret`

jessebot opened this issue · 5 comments

Name and Version

bitnami/mastodon

What architecture are you using?

amd64

What steps will reproduce the bug?

On the latest version of k3s using Argo CD, attempt to deploy the latest mastodon chart using the redis subchart with the below values set.

Are you using any custom parameters or values?

relevant values:

## ref: https://github.com/bitnami/charts/blob/main/bitnami/redis/values.yaml
redis:
  enabled: true
  fullnameOverride: mastodon-redis
  ## Set Redis architecture
  architecture: standalone
  auth:
    ## Name of a secret containing redis credentials
    existingSecret: "mastodon-redis-credentials"
    existingSecretPasswordKey: "redis-pasword"

which I've based on the docs here:
https://github.com/bitnami/charts/tree/8c7bc70727aa6096895cf3f3a5d5b55e88470cf1/bitnami/redis#redis-common-configuration-parameters

What is the expected behavior?

This section of the _helpers.tpl below should include checking the following values for existing Secret names and secret key names:

  • .Values.redis.auth.existingSecret
  • .Values.redis.auth.existingSecretPasswordKey

{{/*
Return the Redis(TM) Secret Name
*/}}
{{- define "mastodon.redis.secretName" -}}
{{- if .Values.redis.enabled -}}
{{- print (include "mastodon.redis.fullname" .) -}}
{{- else if .Values.externalRedis.existingSecret -}}
{{- print .Values.externalRedis.existingSecret -}}
{{- else -}}
{{- printf "%s-externalredis" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{/*
Retrieve key of the Redis(TM) secret
*/}}
{{- define "mastodon.redis.passwordKey" -}}
{{- if .Values.redis.enabled -}}
{{- print "redis-password" -}}
{{- else -}}
{{- if .Values.externalRedis.existingSecret -}}
{{- if .Values.externalRedis.existingSecretPasswordKey -}}
{{- printf "%s" .Values.externalRedis.existingSecretPasswordKey -}}
{{- else -}}
{{- print "redis-password" -}}
{{- end -}}
{{- else -}}
{{- print "redis-password" -}}
{{- end -}}
{{- end -}}
{{- end -}}

Based on the docs here:
https://github.com/bitnami/charts/tree/8c7bc70727aa6096895cf3f3a5d5b55e88470cf1/bitnami/redis#redis-common-configuration-parameters

What do you see instead?

The init-job fails with:

Error: secret "mastodon-redis" not found

Additional information

The values section showing existingSecret for redis:

redis:
## @param redis.enabled Deploy Redis subchart
##
enabled: true
## @param redis.architecture Set Redis architecture
##
architecture: standalone
## @param redis.existingSecret Name of a secret containing redis credentials
##
existingSecret: ""
## @param redis.master.service.ports.redis Redis port
##
master:
service:
ports:
redis: 6379
## @param redis.auth.enabled Enable Redis auth
## @param redis.auth.password Redis password
## @param redis.auth.existingSecret Name of a secret containing the Redis password
##
auth:
enabled: true
password: ""
existingSecret: ""

which are documented here:
https://github.com/bitnami/charts/tree/main/bitnami/mastodon#redis-sub-chart-parameters

As a work around, I'm just using the externalRedis parameters and setting redis.enabled to false.

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

I'll do my best to get this done in the next couple of weeks, but if I don't, or someone else has the time sooner, please feel free to submit a PR ahead of me :)

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

please don't close this