2020-06-29 11:58:48 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ include "mastodon.fullname" . }}-web
|
|
|
|
labels:
|
|
|
|
{{- include "mastodon.labels" . | nindent 4 }}
|
2024-09-12 13:59:12 +00:00
|
|
|
{{- with .Values.mastodon.web.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2023-04-19 22:31:36 +00:00
|
|
|
annotations:
|
2024-09-12 13:59:12 +00:00
|
|
|
{{- with .Values.deploymentAnnotations }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.mastodon.web.annotations }}
|
2023-04-19 22:31:36 +00:00
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
spec:
|
2022-12-03 04:44:39 +00:00
|
|
|
replicas: {{ .Values.mastodon.web.replicas }}
|
2024-02-16 10:32:01 +00:00
|
|
|
{{- if (ne (toString .Values.mastodon.revisionHistoryLimit) "<nil>") }}
|
|
|
|
revisionHistoryLimit: {{ .Values.mastodon.revisionHistoryLimit }}
|
|
|
|
{{- end }}
|
2024-07-10 14:26:02 +00:00
|
|
|
{{- if .Values.mastodon.web.updateStrategy }}
|
|
|
|
strategy: {{- toYaml .Values.mastodon.web.updateStrategy | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "mastodon.selectorLabels" . | nindent 6 }}
|
2022-11-08 16:21:06 +00:00
|
|
|
app.kubernetes.io/component: web
|
|
|
|
app.kubernetes.io/part-of: rails
|
2020-06-29 11:58:48 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
annotations:
|
2024-09-12 13:59:12 +00:00
|
|
|
{{- with .Values.podAnnotations }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.mastodon.web.podAnnotations }}
|
2020-06-29 11:58:48 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
2022-11-10 22:24:39 +00:00
|
|
|
{{- end }}
|
2022-11-10 18:10:38 +00:00
|
|
|
# roll the pods to pick up any db migrations or other changes
|
|
|
|
{{- include "mastodon.rollingPodAnnotations" . | nindent 8 }}
|
2020-06-29 11:58:48 +00:00
|
|
|
labels:
|
2023-12-12 09:39:27 +00:00
|
|
|
{{- include "mastodon.globalLabels" . | nindent 8 }}
|
2020-06-29 11:58:48 +00:00
|
|
|
{{- include "mastodon.selectorLabels" . | nindent 8 }}
|
2023-12-07 15:12:55 +00:00
|
|
|
{{- include "mastodon.statsdExporterLabels" . | nindent 8 }}
|
2025-03-14 08:37:30 +00:00
|
|
|
{{- with .Values.mastodon.podLabels }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2024-09-12 13:59:12 +00:00
|
|
|
{{- with .Values.mastodon.web.podLabels }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2022-11-08 16:21:06 +00:00
|
|
|
app.kubernetes.io/component: web
|
|
|
|
app.kubernetes.io/part-of: rails
|
2020-06-29 11:58:48 +00:00
|
|
|
spec:
|
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "mastodon.serviceAccountName" . }}
|
2022-12-03 04:44:39 +00:00
|
|
|
{{- with (default .Values.podSecurityContext .Values.mastodon.web.podSecurityContext) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
securityContext:
|
2022-11-10 22:24:39 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
volumes:
|
2024-01-19 11:39:42 +00:00
|
|
|
{{- if (not .Values.mastodon.s3.enabled) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
- name: assets
|
|
|
|
persistentVolumeClaim:
|
2024-04-23 09:22:42 +00:00
|
|
|
claimName: {{ template "mastodon.pvc.assets" . }}
|
2020-06-29 11:58:48 +00:00
|
|
|
- name: system
|
|
|
|
persistentVolumeClaim:
|
2024-04-23 09:22:42 +00:00
|
|
|
claimName: {{ template "mastodon.pvc.system" . }}
|
2024-01-19 11:39:42 +00:00
|
|
|
{{- end }}
|
2023-12-07 15:12:55 +00:00
|
|
|
{{- include "mastodon.statsdExporterVolume" $ | indent 8 }}
|
2023-12-18 12:45:00 +00:00
|
|
|
{{- if .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
|
|
|
|
- name: config-database-yml
|
|
|
|
configMap:
|
|
|
|
name: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
|
|
|
|
{{- end }}
|
2024-01-19 11:39:42 +00:00
|
|
|
{{- with .Values.volumes }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
2021-02-19 08:52:32 +00:00
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
containers:
|
2022-12-03 04:44:39 +00:00
|
|
|
- name: {{ .Chart.Name }}-web
|
|
|
|
{{- with (default .Values.securityContext .Values.mastodon.web.securityContext) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
securityContext:
|
2022-11-10 22:24:39 +00:00
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
2023-12-18 12:45:00 +00:00
|
|
|
image: "{{ coalesce .Values.mastodon.web.image.repository .Values.image.repository }}:{{ coalesce .Values.mastodon.web.image.tag .Values.image.tag .Chart.AppVersion }}"
|
2020-06-29 11:58:48 +00:00
|
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
|
|
command:
|
|
|
|
- bundle
|
|
|
|
- exec
|
|
|
|
- puma
|
|
|
|
- -C
|
|
|
|
- config/puma.rb
|
|
|
|
envFrom:
|
|
|
|
- configMapRef:
|
|
|
|
name: {{ include "mastodon.fullname" . }}-env
|
|
|
|
- secretRef:
|
2022-08-10 15:12:58 +00:00
|
|
|
name: {{ template "mastodon.secretName" . }}
|
2024-02-16 07:59:05 +00:00
|
|
|
{{- if .Values.mastodon.extraEnvFrom }}
|
|
|
|
- configMapRef:
|
|
|
|
name: {{ .Values.mastodon.extraEnvFrom }}
|
|
|
|
{{- end}}
|
2020-06-29 11:58:48 +00:00
|
|
|
env:
|
|
|
|
- name: "DB_PASS"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
2022-08-10 15:12:58 +00:00
|
|
|
name: {{ template "mastodon.postgresql.secretName" . }}
|
2022-11-08 16:18:57 +00:00
|
|
|
key: password
|
2024-01-11 11:56:14 +00:00
|
|
|
{{- if .Values.postgresql.readReplica.auth.existingSecret }}
|
|
|
|
- name: "REPLICA_DB_PASS"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.postgresql.readReplica.auth.existingSecret}}
|
|
|
|
key: password
|
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
- name: "REDIS_PASSWORD"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
2022-08-10 15:12:58 +00:00
|
|
|
name: {{ template "mastodon.redis.secretName" . }}
|
2020-06-29 11:58:48 +00:00
|
|
|
key: redis-password
|
2024-05-14 20:39:02 +00:00
|
|
|
{{- 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
|
|
|
|
{{- 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
|
|
|
|
{{- end }}
|
2023-12-15 07:11:13 +00:00
|
|
|
{{- if and .Values.elasticsearch.existingSecret (or .Values.elasticsearch.enabled .Values.elasticsearch.hostname) }}
|
|
|
|
- name: "ES_PASS"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.elasticsearch.existingSecret }}
|
|
|
|
key: password
|
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
- name: "PORT"
|
2021-02-15 07:00:54 +00:00
|
|
|
value: {{ .Values.mastodon.web.port | quote }}
|
2022-12-05 20:49:56 +00:00
|
|
|
{{- if .Values.mastodon.web.minThreads }}
|
|
|
|
- name: "MIN_THREADS"
|
|
|
|
value: {{ .Values.mastodon.web.minThreads | quote }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.mastodon.web.maxThreads }}
|
|
|
|
- name: "MAX_THREADS"
|
|
|
|
value: {{ .Values.mastodon.web.maxThreads | quote }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.mastodon.web.workers }}
|
|
|
|
- name: "WEB_CONCURRENCY"
|
|
|
|
value: {{ .Values.mastodon.web.workers | quote }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.mastodon.web.persistentTimeout }}
|
|
|
|
- name: "PERSISTENT_TIMEOUT"
|
|
|
|
value: {{ .Values.mastodon.web.persistentTimeout | quote }}
|
|
|
|
{{- end }}
|
2022-08-25 02:39:11 +00:00
|
|
|
{{- if (and .Values.mastodon.s3.enabled .Values.mastodon.s3.existingSecret) }}
|
|
|
|
- name: "AWS_SECRET_ACCESS_KEY"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.mastodon.s3.existingSecret }}
|
|
|
|
key: AWS_SECRET_ACCESS_KEY
|
|
|
|
- name: "AWS_ACCESS_KEY_ID"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.mastodon.s3.existingSecret }}
|
|
|
|
key: AWS_ACCESS_KEY_ID
|
2022-11-10 22:24:39 +00:00
|
|
|
{{- end }}
|
2023-12-13 14:26:14 +00:00
|
|
|
{{- if .Values.mastodon.deepl.enabled }}
|
|
|
|
- name: "DEEPL_API_KEY"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.mastodon.deepl.apiKeySecretRef.name }}
|
|
|
|
key: {{ .Values.mastodon.deepl.apiKeySecretRef.key }}
|
|
|
|
{{- end }}
|
2024-01-11 11:56:04 +00:00
|
|
|
{{- if .Values.mastodon.hcaptcha.enabled }}
|
|
|
|
- name: "HCAPTCHA_SECRET_KEY"
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.mastodon.hcaptcha.secretKeySecretRef.name }}
|
|
|
|
key: {{ .Values.mastodon.hcaptcha.secretKeySecretRef.key }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if and .Values.mastodon.cacheBuster.enabled .Values.mastodon.cacheBuster.authToken.existingSecret }}
|
|
|
|
- name: CACHE_BUSTER_SECRET
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ .Values.mastodon.cacheBuster.authToken.existingSecret }}
|
|
|
|
key: password
|
|
|
|
{{- end }}
|
2024-07-19 13:00:22 +00:00
|
|
|
{{- if or .Values.mastodon.web.otel.enabled (and .Values.mastodon.otel.enabled (ne .Values.mastodon.web.otel.enabled false)) }}
|
|
|
|
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
|
|
|
value: {{ coalesce .Values.mastodon.web.otel.endpointUri .Values.mastodon.otel.endpointUri }}
|
|
|
|
- name: OTEL_SERVICE_NAME_PREFIX
|
|
|
|
value: {{ coalesce .Values.mastodon.web.otel.namePrefix .Values.mastodon.otel.namePrefix }}
|
2024-09-30 14:22:26 +00:00
|
|
|
- name: OTEL_SERVICE_NAME_SEPARATOR
|
2024-10-01 09:33:30 +00:00
|
|
|
value: "{{ coalesce .Values.mastodon.web.otel.nameSeparator .Values.mastodon.otel.nameSeparator }}"
|
2024-07-19 13:00:22 +00:00
|
|
|
{{- end }}
|
2025-03-06 08:53:04 +00:00
|
|
|
{{- if .Values.mastodon.metrics.prometheus.enabled }}
|
|
|
|
- name: MASTODON_PROMETHEUS_EXPORTER_ENABLED
|
|
|
|
value: "true"
|
|
|
|
- name: PROMETHEUS_EXPORTER_HOST
|
|
|
|
value: "127.0.0.1"
|
|
|
|
- name: PROMETHEUS_EXPORTER_PORT
|
|
|
|
value: "{{ .Values.mastodon.metrics.prometheus.port }}"
|
|
|
|
{{- if .Values.mastodon.metrics.prometheus.web.detailed }}
|
|
|
|
- name: MASTODON_PROMETHEUS_EXPORTER_WEB_DETAILED_METRICS
|
|
|
|
value: "true"
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
- name: TEST_ENV_VALUE
|
|
|
|
value: {{ .Values.mastodon.metrics.statsd.address }}
|
2020-06-29 11:58:48 +00:00
|
|
|
volumeMounts:
|
2024-01-19 11:39:42 +00:00
|
|
|
{{- if (not .Values.mastodon.s3.enabled) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
- name: assets
|
|
|
|
mountPath: /opt/mastodon/public/assets
|
|
|
|
- name: system
|
|
|
|
mountPath: /opt/mastodon/public/system
|
2021-02-19 08:52:32 +00:00
|
|
|
{{- end }}
|
2023-12-18 12:45:00 +00:00
|
|
|
{{- if .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
|
|
|
|
- name: config-database-yml
|
|
|
|
mountPath: /opt/mastodon/config/database.yml
|
|
|
|
subPath: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.key }}
|
|
|
|
{{- end }}
|
2024-01-19 11:39:42 +00:00
|
|
|
{{- with .Values.volumeMounts }}
|
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
2020-06-29 11:58:48 +00:00
|
|
|
ports:
|
|
|
|
- name: http
|
2021-02-15 07:00:54 +00:00
|
|
|
containerPort: {{ .Values.mastodon.web.port }}
|
2020-06-29 11:58:48 +00:00
|
|
|
protocol: TCP
|
|
|
|
livenessProbe:
|
2022-11-10 18:16:49 +00:00
|
|
|
tcpSocket:
|
|
|
|
port: http
|
|
|
|
readinessProbe:
|
2020-06-29 11:58:48 +00:00
|
|
|
httpGet:
|
|
|
|
path: /health
|
|
|
|
port: http
|
2022-11-10 18:16:49 +00:00
|
|
|
startupProbe:
|
2020-06-29 11:58:48 +00:00
|
|
|
httpGet:
|
|
|
|
path: /health
|
|
|
|
port: http
|
2024-07-08 17:29:48 +00:00
|
|
|
initialDelaySeconds: 15
|
2022-11-10 18:16:49 +00:00
|
|
|
failureThreshold: 30
|
|
|
|
periodSeconds: 5
|
2022-12-03 04:44:39 +00:00
|
|
|
{{- with (default .Values.resources .Values.mastodon.web.resources) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
resources:
|
2022-11-10 22:24:39 +00:00
|
|
|
{{- toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
2025-03-06 08:53:04 +00:00
|
|
|
{{- if .Values.mastodon.metrics.prometheus.enabled }}
|
|
|
|
- name: prometheus-exporter
|
|
|
|
image: "{{ coalesce .Values.mastodon.web.image.repository .Values.image.repository }}:{{ coalesce .Values.mastodon.web.image.tag .Values.image.tag .Chart.AppVersion }}"
|
|
|
|
command:
|
|
|
|
- ./bin/prometheus_exporter
|
|
|
|
args:
|
|
|
|
- "--bind"
|
|
|
|
- "0.0.0.0"
|
|
|
|
- "--port"
|
|
|
|
- "{{ .Values.mastodon.metrics.prometheus.port }}"
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
cpu: "0.1"
|
|
|
|
memory: "180M"
|
|
|
|
limits:
|
|
|
|
cpu: "0.5"
|
|
|
|
memory: "250M"
|
|
|
|
ports:
|
|
|
|
- name: prometheus
|
|
|
|
containerPort: {{ .Values.mastodon.metrics.prometheus.port }}
|
|
|
|
{{- end }}
|
2023-12-07 15:12:55 +00:00
|
|
|
{{- include "mastodon.statsdExporterContainer" $ | indent 8 }}
|
2020-06-29 11:58:48 +00:00
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2022-12-03 04:44:39 +00:00
|
|
|
{{- with (default .Values.affinity .Values.mastodon.web.affinity) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2023-12-15 07:30:22 +00:00
|
|
|
{{- with (default .Values.topologySpreadConstraints .Values.mastodon.web.topologySpreadConstraints) }}
|
|
|
|
topologySpreadConstraints:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2024-02-02 13:03:35 +00:00
|
|
|
{{- with (default .Values.tolerations .Values.mastodon.web.tolerations) }}
|
2020-06-29 11:58:48 +00:00
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|