Skip to content

Commit

Permalink
Merge pull request #80 from small-hack/allow-extra-env-vars
Browse files Browse the repository at this point in the history
allow extraEnvVars for mastodon pods
  • Loading branch information
jessebot authored Oct 25, 2024
2 parents 0c4d031 + e13dfde commit d94bda6
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/mastodon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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: 9.6.2
version: 9.7.0

# renovate: image=ghcr.io/mastodon/mastodon
appVersion: v4.3.1
Expand Down
4 changes: 3 additions & 1 deletion charts/mastodon/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mastodon

![Version: 9.6.2](https://img.shields.io/badge/Version-9.6.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.3.1](https://img.shields.io/badge/AppVersion-v4.3.1-informational?style=flat-square)
![Version: 9.7.0](https://img.shields.io/badge/Version-9.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.3.1](https://img.shields.io/badge/AppVersion-v4.3.1-informational?style=flat-square)

Mastodon is a free, open-source social network server based on ActivityPub.

Expand Down Expand Up @@ -59,6 +59,8 @@ Mastodon is a free, open-source social network server based on ActivityPub.
| mastodon.deepl.apiKeySecretRef.name | string | `""` | |
| mastodon.deepl.enabled | bool | `false` | |
| mastodon.deepl.plan | string | `""` | |
| mastodon.extraEnvFrom | string | `""` | Alternatively specify extra environment variables stored in a ConfigMap. The specified ConfigMap should contain the additional environment variables in key-value format. |
| mastodon.extraEnvVars | list | `[]` | Specify extra environment variables to be added to all Mastodon pods. These can be used for configuration not included in this chart (including configuration for Mastodon varietals.) |
| mastodon.extraVolumeMounts | list | `[]` | optional extra volume mounts for the mastodon web pod |
| mastodon.extraVolumes | list | `[]` | optional extra volumes for the mastodon web pod |
| mastodon.hooks.assetsPrecompile.enabled | bool | `false` | disabled by default, see [mastodon/chart:#158](https://github.com/mastodon/chart/issues/158#issuecomment-2429186438) |
Expand Down
10 changes: 10 additions & 0 deletions charts/mastodon/dev-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ mastodon:
# -- optional extra volume mounts for the mastodon web pod
extraVolumeMounts: []

# -- Specify extra environment variables to be added to all Mastodon pods.
# These can be used for configuration not included in this chart (including configuration for Mastodon varietals.)
extraEnvVars:
- name: MAX_TOOT_CHARS
value: 1024

# -- Alternatively specify extra environment variables stored in a ConfigMap.
# The specified ConfigMap should contain the additional environment variables in key-value format.
extraEnvFrom: ""

s3:
enabled: false
access_key: ""
Expand Down
3 changes: 3 additions & 0 deletions charts/mastodon/templates/cronjob-elastic-search-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ spec:
name: {{ .Values.mastodon.s3.existingSecret }}
key: {{ .Values.mastodon.s3.secretKeys.s3AccessKey }}
{{- end }}
{{- with .Values.mastodon.extraEnvVars }}
{{- toYaml . | nindent 16 }}
{{- end }}
{{- if or .Values.mastodon.extraVolumeMounts (not .Values.mastodon.s3.enabled) }}
volumeMounts:
{{- if not .Values.mastodon.s3.enabled }}
Expand Down
7 changes: 7 additions & 0 deletions charts/mastodon/templates/deployment-sidekiq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ spec:
name: {{ include "mastodon.fullname" $context }}-env
- secretRef:
name: {{ template "mastodon.secretName" $context }}
{{- with $context.Values.mastodon.extraEnvFrom }}
- configMapRef:
name: {{ . }}
{{- end}}
env:
- name: "DB_PASS"
valueFrom:
Expand Down Expand Up @@ -183,6 +187,9 @@ spec:
- name: OTEL_SERVICE_NAME_SEPARATOR
value: "{{ coalesce $context.Values.mastodon.sidekiq.otel.nameSeparator $context.Values.mastodon.otel.nameSeparator }}"
{{- end }}
{{- with $context.Values.mastodon.extraEnvVars }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or $context.Values.mastodon.extraVolumeMounts (not $context.Values.mastodon.s3.enabled)}}
volumeMounts:
{{- if not $context.Values.mastodon.s3.enabled }}
Expand Down
7 changes: 7 additions & 0 deletions charts/mastodon/templates/deployment-streaming.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ spec:
envFrom:
- configMapRef:
name: {{ include "mastodon.fullname" . }}-env
{{- if .Values.mastodon.extraEnvFrom }}
- configMapRef:
name: {{ .Values.mastodon.extraEnvFrom }}
{{- end}}
env:
- name: "DB_PASS"
valueFrom:
Expand Down Expand Up @@ -88,6 +92,9 @@ spec:
{{- end }}
- name: "PORT"
value: {{ .Values.mastodon.streaming.port | quote }}
{{- with .Values.mastodon.extraEnvVars }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or .Values.mastodon.extraVolumeMounts }}
volumeMounts:
{{- if gt (len .Values.mastodon.extraVolumeMounts) 0 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/mastodon/templates/deployment-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ spec:
name: {{ include "mastodon.fullname" . }}-env
- secretRef:
name: {{ template "mastodon.secretName" . }}
{{- if .Values.mastodon.extraEnvFrom }}
- configMapRef:
name: {{ .Values.mastodon.extraEnvFrom }}
{{- end}}
env:
- name: "DB_PASS"
valueFrom:
Expand Down Expand Up @@ -165,6 +169,9 @@ spec:
- name: OTEL_SERVICE_NAME_SEPARATOR
value: "{{ coalesce .Values.mastodon.web.otel.nameSeparator .Values.mastodon.otel.nameSeparator }}"
{{- end }}
{{- with .Values.mastodon.extraEnvVars }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if or .Values.mastodon.extraVolumeMounts (not .Values.mastodon.s3.enabled)}}
volumeMounts:
{{- if not .Values.mastodon.s3.enabled }}
Expand Down
8 changes: 8 additions & 0 deletions charts/mastodon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ mastodon:
# -- optional extra volume mounts for the mastodon web pod
extraVolumeMounts: []

# -- Specify extra environment variables to be added to all Mastodon pods.
# These can be used for configuration not included in this chart (including configuration for Mastodon varietals.)
extraEnvVars: []

# -- Alternatively specify extra environment variables stored in a ConfigMap.
# The specified ConfigMap should contain the additional environment variables in key-value format.
extraEnvFrom: ""

s3:
# -- enable using s3 instead of local persistence
enabled: false
Expand Down

0 comments on commit d94bda6

Please sign in to comment.