3
0
mirror of https://github.com/mastodon/chart synced 2025-03-15 13:31:51 +00:00

Added custom volume mounts, additional small tweaks to match internal (#115)

This commit is contained in:
Tim Campbell 2024-01-19 03:39:42 -08:00 committed by GitHub
parent 97c3d1dc90
commit 5527809faf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 59 additions and 34 deletions

View File

@ -22,6 +22,7 @@ spec:
type: Recreate type: Recreate
{{- end }} {{- end }}
replicas: {{ .replicas }} replicas: {{ .replicas }}
revisionHistoryLimit: 2
selector: selector:
matchLabels: matchLabels:
{{- include "mastodon.selectorLabels" $context | nindent 6 }} {{- include "mastodon.selectorLabels" $context | nindent 6 }}
@ -60,8 +61,8 @@ spec:
topologySpreadConstraints: topologySpreadConstraints:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if (not $context.Values.mastodon.s3.enabled) }}
volumes: volumes:
{{- if (not $context.Values.mastodon.s3.enabled) }}
- name: assets - name: assets
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ template "mastodon.fullname" $context }}-assets claimName: {{ template "mastodon.fullname" $context }}-assets
@ -75,6 +76,9 @@ spec:
configMap: configMap:
name: {{ .customDatabaseConfigYml.configMapRef.name }} name: {{ .customDatabaseConfigYml.configMapRef.name }}
{{- end }} {{- end }}
{{- with $context.Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ $context.Chart.Name }} - name: {{ $context.Chart.Name }}
securityContext: securityContext:
@ -158,8 +162,8 @@ spec:
name: {{ $context.Values.mastodon.cacheBuster.authToken.existingSecret }} name: {{ $context.Values.mastodon.cacheBuster.authToken.existingSecret }}
key: password key: password
{{- end }} {{- end }}
{{- if (not $context.Values.mastodon.s3.enabled) }}
volumeMounts: volumeMounts:
{{- if (not $context.Values.mastodon.s3.enabled) }}
- name: assets - name: assets
mountPath: /opt/mastodon/public/assets mountPath: /opt/mastodon/public/assets
- name: system - name: system
@ -170,6 +174,9 @@ spec:
mountPath: /opt/mastodon/config/database.yml mountPath: /opt/mastodon/config/database.yml
subPath: {{ .customDatabaseConfigYml.configMapRef.key }} subPath: {{ .customDatabaseConfigYml.configMapRef.key }}
{{- end }} {{- end }}
{{- with $context.Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources: resources:
{{- toYaml (default (default $context.Values.resources $context.Values.mastodon.sidekiq.resources) .resources) | nindent 12 }} {{- toYaml (default (default $context.Values.resources $context.Values.mastodon.sidekiq.resources) .resources) | nindent 12 }}
{{- include "mastodon.statsdExporterContainer" $ | indent 8 }} {{- include "mastodon.statsdExporterContainer" $ | indent 8 }}

View File

@ -10,6 +10,7 @@ metadata:
{{- end }} {{- end }}
spec: spec:
replicas: {{ .Values.mastodon.streaming.replicas }} replicas: {{ .Values.mastodon.streaming.replicas }}
revisionHistoryLimit: 2
selector: selector:
matchLabels: matchLabels:
{{- include "mastodon.selectorLabels" . | nindent 6 }} {{- include "mastodon.selectorLabels" . | nindent 6 }}

View File

@ -10,6 +10,7 @@ metadata:
{{- end }} {{- end }}
spec: spec:
replicas: {{ .Values.mastodon.web.replicas }} replicas: {{ .Values.mastodon.web.replicas }}
revisionHistoryLimit: 2
selector: selector:
matchLabels: matchLabels:
{{- include "mastodon.selectorLabels" . | nindent 6 }} {{- include "mastodon.selectorLabels" . | nindent 6 }}
@ -39,20 +40,23 @@ spec:
securityContext: securityContext:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if (not .Values.mastodon.s3.enabled) }}
volumes: volumes:
{{- if (not .Values.mastodon.s3.enabled) }}
- name: assets - name: assets
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ template "mastodon.fullname" . }}-assets claimName: {{ template "mastodon.fullname" . }}-assets
- name: system - name: system
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ template "mastodon.fullname" . }}-system claimName: {{ template "mastodon.fullname" . }}-system
{{- end }}
{{- include "mastodon.statsdExporterVolume" $ | indent 8 }} {{- include "mastodon.statsdExporterVolume" $ | indent 8 }}
{{- if .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }} {{- if .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
- name: config-database-yml - name: config-database-yml
configMap: configMap:
name: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }} name: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
{{- end }} {{- end }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
containers: containers:
- name: {{ .Chart.Name }}-web - name: {{ .Chart.Name }}-web
@ -149,8 +153,8 @@ spec:
name: {{ .Values.mastodon.cacheBuster.authToken.existingSecret }} name: {{ .Values.mastodon.cacheBuster.authToken.existingSecret }}
key: password key: password
{{- end }} {{- end }}
{{- if (not .Values.mastodon.s3.enabled) }}
volumeMounts: volumeMounts:
{{- if (not .Values.mastodon.s3.enabled) }}
- name: assets - name: assets
mountPath: /opt/mastodon/public/assets mountPath: /opt/mastodon/public/assets
- name: system - name: system
@ -161,6 +165,9 @@ spec:
mountPath: /opt/mastodon/config/database.yml mountPath: /opt/mastodon/config/database.yml
subPath: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.key }} subPath: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.key }}
{{- end }} {{- end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports: ports:
- name: http - name: http
containerPort: {{ .Values.mastodon.web.port }} containerPort: {{ .Values.mastodon.web.port }}

View File

@ -11,6 +11,9 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
mastodon: mastodon:
# Labels added to every Mastodon-related object
labels: {}
# -- create an initial administrator user; the password is autogenerated and will # -- create an initial administrator user; the password is autogenerated and will
# have to be reset # have to be reset
createAdmin: createAdmin:
@ -140,6 +143,7 @@ mastodon:
repository: repository:
tag: tag:
# allows you to mount a custom database.yml from a configmap # allows you to mount a custom database.yml from a configmap
# please note that we do not advise using a read-only replica for sidekiq workers
customDatabaseConfigYml: customDatabaseConfigYml:
configMapRef: configMapRef:
name: name:
@ -166,7 +170,7 @@ mastodon:
ca_file: /etc/ssl/certs/ca-certificates.crt ca_file: /etc/ssl/certs/ca-certificates.crt
delivery_method: smtp delivery_method: smtp
domain: domain:
enable_starttls: 'auto' enable_starttls: "auto"
from_address: notifications@example.com from_address: notifications@example.com
return_path: return_path:
openssl_verify_mode: peer openssl_verify_mode: peer
@ -293,7 +297,7 @@ ingress:
hosts: hosts:
- host: mastodon.local - host: mastodon.local
paths: paths:
- path: '/' - path: "/"
tls: tls:
- secretName: mastodon-tls - secretName: mastodon-tls
hosts: hosts:
@ -561,3 +565,9 @@ affinity: {}
# want to spread each deployment independently, or override topologySpreadConstraints # want to spread each deployment independently, or override topologySpreadConstraints
# for each deployment # for each deployment
topologySpreadConstraints: {} topologySpreadConstraints: {}
# Default volume mounts for all pods
volumeMounts: []
# Default volumes for all pods
volumes: []