mirror of
https://github.com/mastodon/chart
synced 2025-03-15 13:31:51 +00:00
Custom docker images and database configs (#110)
This commit is contained in:
parent
61b643b05d
commit
0c7466501c
|
@ -70,11 +70,16 @@ spec:
|
||||||
claimName: {{ template "mastodon.fullname" $context }}-system
|
claimName: {{ template "mastodon.fullname" $context }}-system
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "mastodon.statsdExporterVolume" $ | indent 8 }}
|
{{- include "mastodon.statsdExporterVolume" $ | indent 8 }}
|
||||||
|
{{- if dig "customDatabaseConfigYml" "configMapRef" "name" false . }}
|
||||||
|
- name: config-database-yml
|
||||||
|
configMap:
|
||||||
|
name: {{ .customDatabaseConfigYml.configMapRef.name }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $context.Chart.Name }}
|
- name: {{ $context.Chart.Name }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml $context.Values.mastodon.sidekiq.securityContext | nindent 12 }}
|
{{- toYaml $context.Values.mastodon.sidekiq.securityContext | nindent 12 }}
|
||||||
image: "{{ $context.Values.image.repository }}:{{ $context.Values.image.tag | default $context.Chart.AppVersion }}"
|
image: "{{ coalesce (dig "image" "repository" false .) $context.Values.image.repository }}:{{ coalesce (dig "image" "tag" false .) $context.Values.image.tag $context.Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ $context.Values.image.pullPolicy }}
|
imagePullPolicy: {{ $context.Values.image.pullPolicy }}
|
||||||
command:
|
command:
|
||||||
- bundle
|
- bundle
|
||||||
|
@ -146,6 +151,11 @@ spec:
|
||||||
- name: system
|
- name: system
|
||||||
mountPath: /opt/mastodon/public/system
|
mountPath: /opt/mastodon/public/system
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if dig "customDatabaseConfigYml" "configMapRef" "name" false . }}
|
||||||
|
- name: config-database-yml
|
||||||
|
mountPath: /opt/mastodon/config/database.yml
|
||||||
|
subPath: {{ .customDatabaseConfigYml.configMapRef.key }}
|
||||||
|
{{- 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 }}
|
||||||
|
|
|
@ -42,7 +42,7 @@ spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ coalesce .Values.mastodon.streaming.image.repository .Values.image.repository }}:{{ coalesce .Values.mastodon.streaming.image.tag .Values.image.tag .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
command:
|
command:
|
||||||
- node
|
- node
|
||||||
|
|
|
@ -48,6 +48,11 @@ spec:
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ template "mastodon.fullname" . }}-system
|
claimName: {{ template "mastodon.fullname" . }}-system
|
||||||
{{- include "mastodon.statsdExporterVolume" $ | indent 8 }}
|
{{- include "mastodon.statsdExporterVolume" $ | indent 8 }}
|
||||||
|
{{- if .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
|
||||||
|
- name: config-database-yml
|
||||||
|
configMap:
|
||||||
|
name: {{ .Values.mastodon.web.customDatabaseConfigYml.configMapRef.name }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}-web
|
- name: {{ .Chart.Name }}-web
|
||||||
|
@ -55,7 +60,7 @@ spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
image: "{{ coalesce .Values.mastodon.web.image.repository .Values.image.repository }}:{{ coalesce .Values.mastodon.web.image.tag .Values.image.tag .Chart.AppVersion }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
command:
|
command:
|
||||||
- bundle
|
- bundle
|
||||||
|
@ -130,6 +135,11 @@ spec:
|
||||||
- name: system
|
- name: system
|
||||||
mountPath: /opt/mastodon/public/system
|
mountPath: /opt/mastodon/public/system
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- 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 }}
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.mastodon.web.port }}
|
containerPort: {{ .Values.mastodon.web.port }}
|
||||||
|
|
20
values.yaml
20
values.yaml
|
@ -130,6 +130,14 @@ mastodon:
|
||||||
- mailers,2
|
- mailers,2
|
||||||
- pull
|
- pull
|
||||||
- scheduler # Make sure the scheduler queue only exists once and with a worker that has 1 replica.
|
- scheduler # Make sure the scheduler queue only exists once and with a worker that has 1 replica.
|
||||||
|
image:
|
||||||
|
repository:
|
||||||
|
tag:
|
||||||
|
# allows you to mount a custom database.yml from a configmap
|
||||||
|
customDatabaseConfigYml:
|
||||||
|
configMapRef:
|
||||||
|
name:
|
||||||
|
key:
|
||||||
#- name: push-pull
|
#- name: push-pull
|
||||||
# concurrency: 50
|
# concurrency: 50
|
||||||
# resources: {}
|
# resources: {}
|
||||||
|
@ -166,6 +174,9 @@ mastodon:
|
||||||
# password must be located in keys named `login` and `password` respectively.
|
# password must be located in keys named `login` and `password` respectively.
|
||||||
existingSecret:
|
existingSecret:
|
||||||
streaming:
|
streaming:
|
||||||
|
image:
|
||||||
|
repository:
|
||||||
|
tag:
|
||||||
port: 4000
|
port: 4000
|
||||||
# -- this should be set manually since os.cpus() returns the number of CPUs on
|
# -- this should be set manually since os.cpus() returns the number of CPUs on
|
||||||
# the node running the pod, which is unrelated to the resources allocated to
|
# the node running the pod, which is unrelated to the resources allocated to
|
||||||
|
@ -218,6 +229,15 @@ mastodon:
|
||||||
maxThreads: "5"
|
maxThreads: "5"
|
||||||
workers: "2"
|
workers: "2"
|
||||||
persistentTimeout: "20"
|
persistentTimeout: "20"
|
||||||
|
image:
|
||||||
|
repository:
|
||||||
|
tag:
|
||||||
|
# allows you to mount a custom database.yml from a configmap
|
||||||
|
# for example if you want to use a read-only replica
|
||||||
|
customDatabaseConfigYml:
|
||||||
|
configMapRef:
|
||||||
|
name:
|
||||||
|
key:
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
statsd:
|
statsd:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user