Skip to content
Open
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 6.6.4

- Added additional customization for redis secret. Can now specify auth secrey key:
```yaml
redis:
auth:
existingSecret:
existingSecretKey:
sidekiq:
auth:
existingSecret:
existingSecretKey:
cache:
auth:
existingSecret:
existingSecretKey:

```

# 6.6.3

- Update the mastodon version to v4.5.3
Expand Down
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time
# you make changes to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 6.6.3
version: 6.6.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion templates/_db-migrate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ spec:
{{- else }}
name: {{ template "mastodon.redis.secretName" . }}
{{- end }}
key: redis-password
key: {{ .Values.redis.auth.existingSecretKey }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to have both name and key (the whole secretKeyRef be from a template, rather than repeating this everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's honestly not a bad idea. I'll make that change.

Copy link
Contributor Author

@timetinytim timetinytim Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except I can see one issue with this.

The current solution allows it to be backwards compatible with the way it's already done. This new solution would basically mean either replacing existingSecret with that new format, which would break existing setups, or creating a new field like existingSecretRef, which wouldn't break anything, but would be somewhat redundant.

{{- if .preDeploy }}
- name: "SKIP_POST_DEPLOYMENT_MIGRATIONS"
value: "true"
Expand Down
6 changes: 3 additions & 3 deletions templates/deployment-sidekiq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ spec:
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.secretName" $context }}
key: redis-password
key: {{ $context.Values.redis.auth.existingSecretKey }}
{{- if and $context.Values.redis.sidekiq.enabled $context.Values.redis.sidekiq.auth.existingSecret }}
- name: "SIDEKIQ_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.sidekiq.secretName" $context }}
key: redis-password
key: {{ $context.Values.redis.sidekiq.auth.existingSecretKey }}
{{- end }}
{{- if and $context.Values.redis.cache.enabled $context.Values.redis.cache.auth.existingSecret }}
- name: "CACHE_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.cache.secretName" $context }}
key: redis-password
key: {{ $context.Values.redis.cache.auth.existingSecretKey }}
{{- end }}
{{- if and $context.Values.elasticsearch.existingSecret (or $context.Values.elasticsearch.enabled $context.Values.elasticsearch.hostname) }}
- name: "ES_PASS"
Expand Down
6 changes: 3 additions & 3 deletions templates/deployment-streaming.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,20 @@ spec:
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.secretName" . }}
key: redis-password
key: {{ .Values.redis.auth.existingSecretKey }}
{{- if and .Values.redis.sidekiq.enabled .Values.redis.sidekiq.auth.existingSecret }}
- name: "SIDEKIQ_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.sidekiq.secretName" . }}
key: redis-password
key: {{ .Values.redis.sidekiq.auth.existingSecretKey }}
{{- end }}
{{- if and .Values.redis.cache.enabled .Values.redis.cache.auth.existingSecret }}
- name: "CACHE_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.cache.secretName" . }}
key: redis-password
key: {{ .Values.redis.cache.auth.existingSecretKey }}
{{- end }}
- name: "PORT"
value: {{ .Values.mastodon.streaming.port | quote }}
Expand Down
6 changes: 3 additions & 3 deletions templates/deployment-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,20 @@ spec:
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.secretName" . }}
key: redis-password
key: {{ .Values.redis.auth.existingSecretKey }}
{{- if and .Values.redis.sidekiq.enabled .Values.redis.sidekiq.auth.existingSecret }}
- name: "SIDEKIQ_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.sidekiq.secretName" . }}
key: redis-password
key: {{ .Values.redis.sidekiq.auth.existingSecretKey }}
{{- end }}
{{- if and .Values.redis.cache.enabled .Values.redis.cache.auth.existingSecret }}
- name: "CACHE_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.cache.secretName" . }}
key: redis-password
key: {{ .Values.redis.cache.auth.existingSecretKey }}
{{- end }}
{{- if and .Values.elasticsearch.existingSecret (or .Values.elasticsearch.enabled .Values.elasticsearch.hostname) }}
- name: "ES_PASS"
Expand Down
6 changes: 3 additions & 3 deletions templates/job-create-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ spec:
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.secretName" . }}
key: redis-password
key: {{ .Values.redis.auth.existingSecretKey }}
{{- if and .Values.redis.sidekiq.enabled .Values.redis.sidekiq.auth.existingSecret }}
- name: "SIDEKIQ_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.sidekiq.secretName" . }}
key: redis-password
key: {{ .Values.redis.sidekiq.auth.existingSecretKey }}
{{- end }}
{{- if and .Values.redis.cache.enabled .Values.redis.cache.auth.existingSecret }}
- name: "CACHE_REDIS_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.cache.secretName" . }}
key: redis-password
key: {{ .Values.redis.cache.auth.existingSecretKey }}
{{- end }}
- name: "PORT"
value: {{ .Values.mastodon.web.port | quote }}
Expand Down
2 changes: 1 addition & 1 deletion templates/job-deploy-search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ template "mastodon.redis.secretName" . }}
key: redis-password
key: {{ .Values.redis.auth.existingSecretKey }}
- name: "PORT"
value: {{ .Values.mastodon.web.port | quote }}
{{- if (not .Values.mastodon.s3.enabled) }}
Expand Down
2 changes: 1 addition & 1 deletion templates/secret-redis-preinstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
type: Opaque
data:
redis-password: "{{ .Values.redis.auth.password | b64enc }}"
{{ .Values.redis.auth.existingSecretKey }}: "{{ .Values.redis.auth.password | b64enc }}"
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion templates/secret-redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- include "mastodon.labels" . | nindent 4 }}
type: Opaque
data:
redis-password: "{{ .Values.redis.auth.password | b64enc }}"
{{ .Values.redis.auth.existingSecretKey }}: "{{ .Values.redis.auth.password | b64enc }}"
{{- end }}
{{- end }}
{{- end }}
11 changes: 7 additions & 4 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,9 @@ redis:
password: ""
# setting password for an existing redis instance will store it in a new Secret
# you can also specify the name of an existing Secret
# with a key of redis-password set to the password you want
# existingSecret: ""
# set to the password you want
existingSecret: ""
existingSecretKey: redis-password
replica:
replicaCount: 0

Expand All @@ -772,8 +773,9 @@ redis:
auth:
password: ""
# you can also specify the name of an existing Secret
# with a key of redis-password set to the password you want
# set to the password you want
existingSecret: ""
existingSecretKey: redis-password

# Configuration for a separate redis instance only for cache.
# If enabled, any values not specified will be copied from the base config.
Expand All @@ -786,8 +788,9 @@ redis:
auth:
password: ""
# you can also specify the name of an existing Secret
# with a key of redis-password set to the password you want
# set to the password you want
existingSecret: ""
existingSecretKey: redis-password

# -- Node(s) on which we will deploy the various redis pods
master:
Expand Down