mirror of
https://github.com/bitnami/charts.git
synced 2026-03-16 06:47:30 +08:00
234 lines
12 KiB
YAML
234 lines
12 KiB
YAML
{{- /*
|
|
Copyright VMware, Inc.
|
|
SPDX-License-Identifier: APACHE-2.0
|
|
*/}}
|
|
|
|
{{- if and (include "mastodon.web.domain" .) (or .Values.enableS3 .Values.persistence.enabled) }}
|
|
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "mastodon.sidekiq.fullname" . }}
|
|
namespace: {{ include "common.names.namespace" . | quote }}
|
|
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
app.kubernetes.io/part-of: mastodon
|
|
app.kubernetes.io/component: sidekiq
|
|
{{- if .Values.commonAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
replicas: {{ .Values.sidekiq.replicaCount }}
|
|
{{- if .Values.sidekiq.updateStrategy }}
|
|
strategy: {{- toYaml .Values.sidekiq.updateStrategy | nindent 4 }}
|
|
{{- end }}
|
|
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.sidekiq.podLabels .Values.commonLabels ) "context" . ) }}
|
|
selector:
|
|
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
|
|
app.kubernetes.io/component: sidekiq
|
|
template:
|
|
metadata:
|
|
{{- if .Values.sidekiq.podAnnotations }}
|
|
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.podAnnotations "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
|
|
app.kubernetes.io/component: sidekiq
|
|
spec:
|
|
serviceAccountName: {{ template "mastodon.serviceAccountName" . }}
|
|
{{- include "mastodon.imagePullSecrets" . | nindent 6 }}
|
|
{{- if .Values.sidekiq.hostAliases }}
|
|
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.hostAliases "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.affinity }}
|
|
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.sidekiq.affinity "context" $) | nindent 8 }}
|
|
{{- else }}
|
|
affinity:
|
|
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.sidekiq.podAffinityPreset "component" "sidekiq" "customLabels" $podLabels "context" $) | nindent 10 }}
|
|
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.sidekiq.podAntiAffinityPreset "component" "sidekiq" "customLabels" $podLabels "context" $) | nindent 10 }}
|
|
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.sidekiq.nodeAffinityPreset.type "key" .Values.sidekiq.nodeAffinityPreset.key "values" .Values.sidekiq.nodeAffinityPreset.values) | nindent 10 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.nodeSelector }}
|
|
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.sidekiq.nodeSelector "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.tolerations }}
|
|
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.tolerations "context" .) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.priorityClassName }}
|
|
priorityClassName: {{ .Values.sidekiq.priorityClassName | quote }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.schedulerName }}
|
|
schedulerName: {{ .Values.sidekiq.schedulerName | quote }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.topologySpreadConstraints }}
|
|
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.topologySpreadConstraints "context" .) | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.podSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.sidekiq.podSecurityContext "enabled" | toYaml | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.terminationGracePeriodSeconds }}
|
|
terminationGracePeriodSeconds: {{ .Values.sidekiq.terminationGracePeriodSeconds }}
|
|
{{- end }}
|
|
initContainers:
|
|
{{- if not .Values.diagnosticMode.enabled }}
|
|
{{- include "mastodon.waitForWebInitContainer" . | nindent 8 }}
|
|
{{- if .Values.enableS3 }}
|
|
{{- include "mastodon.waitForS3InitContainer" . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.initContainers }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.initContainers "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: mastodon
|
|
image: {{ template "mastodon.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- if .Values.sidekiq.containerSecurityContext.enabled }}
|
|
securityContext: {{- omit .Values.sidekiq.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.diagnosticMode.enabled }}
|
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
|
|
{{- else if .Values.sidekiq.command }}
|
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.command "context" $) | nindent 12 }}
|
|
{{- else }}
|
|
command:
|
|
- /opt/bitnami/scripts/mastodon/run.sh
|
|
{{- end }}
|
|
{{- if .Values.diagnosticMode.enabled }}
|
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
|
|
{{- else if .Values.sidekiq.args }}
|
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.args "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: BITNAMI_DEBUG
|
|
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
|
- name: MASTODON_MODE
|
|
value: "sidekiq"
|
|
- name: MASTODON_DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.database.secretName" . }}
|
|
key: {{ include "mastodon.database.passwordKey" . | quote }}
|
|
{{- if (include "mastodon.redis.auth.enabled" .) }}
|
|
- name: MASTODON_REDIS_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.redis.secretName" . }}
|
|
key: {{ include "mastodon.redis.passwordKey" . | quote }}
|
|
{{- end }}
|
|
{{- if .Values.enableS3 }}
|
|
- name: MASTODON_AWS_ACCESS_KEY_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.s3.secretName" . }}
|
|
key: {{ include "mastodon.s3.accessKeyIDKey" . | quote }}
|
|
- name: MASTODON_AWS_SECRET_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.s3.secretName" . }}
|
|
key: {{ include "mastodon.s3.secretAccessKeyKey" . | quote }}
|
|
{{- end }}
|
|
{{- if and .Values.enableSearches (include "mastodon.elasticsearch.auth.enabled" .) }}
|
|
- name: MASTODON_ELASTICSEARCH_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.elasticsearch.secretName" . }}
|
|
key: {{ include "mastodon.elasticsearch.passwordKey" . | quote }}
|
|
{{- end }}
|
|
{{- if ne .Values.smtp.auth_method "none" }}
|
|
- name: SMTP_LOGIN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.smtp.secretName" . }}
|
|
key: {{ include "mastodon.smtp.loginKey" . | quote }}
|
|
- name: SMTP_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "mastodon.smtp.secretName" . }}
|
|
key: {{ include "mastodon.smtp.passwordKey" . | quote }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.extraEnvVars }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.extraEnvVars "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: {{ include "mastodon.defaultConfigmapName" . }}
|
|
- secretRef:
|
|
name: {{ include "mastodon.defaultSecretName" . }}
|
|
{{- if or .Values.extraConfig .Values.extraConfigExistingConfigmap }}
|
|
- configMapRef:
|
|
name: {{ include "mastodon.extraConfigmapName" . }}
|
|
{{- end }}
|
|
{{- if or .Values.extraSecretConfig .Values.extraConfigExistingSecret }}
|
|
- secretRef:
|
|
name: {{ include "mastodon.extraSecretName" . }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.extraEnvVarsCM }}
|
|
- configMapRef:
|
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.sidekiq.extraEnvVarsCM "context" $) }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.extraEnvVarsSecret }}
|
|
- secretRef:
|
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.sidekiq.extraEnvVarsSecret "context" $) }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.resources }}
|
|
resources: {{- toYaml .Values.sidekiq.resources | nindent 12 }}
|
|
{{- end }}
|
|
{{- if not .Values.diagnosticMode.enabled }}
|
|
{{- if .Values.sidekiq.customLivenessProbe }}
|
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.customLivenessProbe "context" $) | nindent 12 }}
|
|
{{- else if .Values.sidekiq.livenessProbe.enabled }}
|
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.sidekiq.livenessProbe "enabled") "context" $) | nindent 12 }}
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- pgrep -f ^sidekiq
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.customReadinessProbe }}
|
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.customReadinessProbe "context" $) | nindent 12 }}
|
|
{{- else if .Values.sidekiq.readinessProbe.enabled }}
|
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.sidekiq.readinessProbe "enabled") "context" $) | nindent 12 }}
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- pgrep -f ^sidekiq
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.customStartupProbe }}
|
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.customStartupProbe "context" $) | nindent 12 }}
|
|
{{- else if .Values.sidekiq.startupProbe.enabled }}
|
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.sidekiq.startupProbe "enabled") "context" $) | nindent 12 }}
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- pgrep -f ^sidekiq
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.lifecycleHooks }}
|
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.lifecycleHooks "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- if not .Values.enableS3 }}
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.extraVolumeMounts }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.extraVolumeMounts "context" $) | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.sidecars }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.sidekiq.sidecars "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
{{- if not .Values.enableS3 }}
|
|
- name: data
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "mastodon.pvc" . }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.sidekiq.extraVolumes }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.sidekiq.extraVolumes "context" $) | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|