Skip to content

Commit 4bb5495

Browse files
authored
Release mastodon 0.4.0 (#89)
* [mastodon]: add/fix nodeSelectors and tolerations support * [mastodon]: bump chart version to 0.4.0 * [mastodon]: add eof for precompile-job
1 parent 659015d commit 4bb5495

File tree

9 files changed

+97
-47
lines changed

9 files changed

+97
-47
lines changed

charts/mastodon/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.3.1
18+
version: 0.4.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/mastodon/templates/cronjob-media-remove.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ spec:
4141
persistentVolumeClaim:
4242
claimName: {{ template "mastodon.fullname" . }}-system
4343
{{- end }}
44+
{{- with .Values.nodeSelector }}
45+
nodeSelector:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
48+
{{- with .Values.tolerations }}
49+
tolerations:
50+
{{- toYaml . | nindent 8 }}
51+
{{- end }}
4452
containers:
4553
- name: {{ include "mastodon.fullname" . }}-media-remove
4654
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

charts/mastodon/templates/deployment-sidekiq.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,17 @@ spec:
106106
{{- end }}
107107
resources:
108108
{{- toYaml .Values.mastodon.sidekiq.resources | nindent 12 }}
109-
{{- with .Values.mastodon.sidekiq.nodeSelector }}
109+
{{- $nodeSelector := merge .Values.nodeSelector .Values.mastodon.sidekiq.nodeSelector }}
110+
{{- with $nodeSelector }}
110111
nodeSelector:
111112
{{- toYaml . | nindent 8 }}
112113
{{- end }}
113-
{{- with .Values.tolerations }}
114+
{{- if and .Values.mastodon.sidekiq.tolerations (gt (len .Values.mastodon.sidekiq.tolerations) 0) }}
114115
tolerations:
115-
{{- toYaml . | nindent 8 }}
116+
{{- toYaml .Values.mastodon.sidekiq.tolerations | nindent 8 }}
117+
{{- else if .Values.tolerations }}
118+
tolerations:
119+
{{- toYaml .Values.tolerations | nindent 8 }}
116120
{{- end }}
117121
{{- if .Values.postgres.credentials.certificateSecret }}
118122
volumes:

charts/mastodon/templates/deployment-streaming.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,22 @@ spec:
9797
{{- end }}
9898
resources:
9999
{{- toYaml .Values.mastodon.streaming.resources | nindent 12 }}
100-
{{- with .Values.mastodon.streaming.nodeSelector }}
101-
nodeSelector:
102-
{{- toYaml . | nindent 8 }}
103-
{{- end }}
104100
{{- with .Values.affinity }}
105101
affinity:
106102
{{- toYaml . | nindent 8 }}
107103
{{- end }}
108-
{{- with .Values.tolerations }}
109-
tolerations:
104+
{{- $nodeSelector := merge .Values.nodeSelector .Values.mastodon.streaming.nodeSelector }}
105+
{{- with $nodeSelector }}
106+
nodeSelector:
110107
{{- toYaml . | nindent 8 }}
111108
{{- end }}
109+
{{- if and .Values.mastodon.streaming.tolerations (gt (len .Values.mastodon.streaming.tolerations) 0) }}
110+
tolerations:
111+
{{- toYaml .Values.mastodon.streaming.tolerations | nindent 8 }}
112+
{{- else if .Values.tolerations }}
113+
tolerations:
114+
{{- toYaml .Values.tolerations | nindent 8 }}
115+
{{- end }}
112116
{{- if .Values.postgres.credentials.certificateSecret }}
113117
volumes:
114118
- name: certificates

charts/mastodon/templates/deployment-web.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,22 @@ spec:
118118
{{- end }}
119119
resources:
120120
{{- toYaml .Values.mastodon.web.resources | nindent 12 }}
121-
{{- with .Values.mastodon.web.nodeSelector }}
122-
nodeSelector:
123-
{{- toYaml . | nindent 8 }}
124-
{{- end }}
125121
{{- with .Values.affinity }}
126122
affinity:
127123
{{- toYaml . | nindent 8 }}
128124
{{- end }}
129-
{{- with .Values.tolerations }}
130-
tolerations:
125+
{{- $nodeSelector := merge .Values.nodeSelector .Values.mastodon.web.nodeSelector }}
126+
{{- with $nodeSelector }}
127+
nodeSelector:
131128
{{- toYaml . | nindent 8 }}
132129
{{- end }}
130+
{{- if and .Values.mastodon.web.tolerations (gt (len .Values.mastodon.web.tolerations) 0) }}
131+
tolerations:
132+
{{- toYaml .Values.mastodon.web.tolerations | nindent 8 }}
133+
{{- else if .Values.tolerations }}
134+
tolerations:
135+
{{- toYaml .Values.tolerations | nindent 8 }}
136+
{{- end }}
133137
{{- if .Values.postgres.credentials.certificateSecret }}
134138
volumes:
135139
- name: certificates

charts/mastodon/templates/job-assets-precompile.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ spec:
4141
persistentVolumeClaim:
4242
claimName: {{ template "mastodon.fullname" . }}-system
4343
{{- end }}
44+
{{- with .Values.nodeSelector }}
45+
nodeSelector:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
48+
{{- with .Values.tolerations }}
49+
tolerations:
50+
{{- toYaml . | nindent 8 }}
51+
{{- end }}
4452
containers:
4553
- name: {{ include "mastodon.fullname" . }}-assets-precompile
4654
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -98,7 +106,3 @@ spec:
98106
- key: db-certificate.crt
99107
path: root.crt
100108
{{- end }}
101-
{{- with .Values.nodeSelector }}
102-
nodeSelector:
103-
{{- toYaml . | nindent 8 }}
104-
{{- end }}

charts/mastodon/templates/job-chewy-upgrade.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ spec:
4242
persistentVolumeClaim:
4343
claimName: {{ template "mastodon.fullname" . }}-system
4444
{{- end }}
45+
{{- with .Values.nodeSelector }}
46+
nodeSelector:
47+
{{- toYaml . | nindent 8 }}
48+
{{- end }}
49+
{{- with .Values.tolerations }}
50+
tolerations:
51+
{{- toYaml . | nindent 8 }}
52+
{{- end }}
4553
containers:
4654
- name: {{ include "mastodon.fullname" . }}-chewy-setup
4755
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -99,8 +107,4 @@ spec:
99107
- key: db-certificate.crt
100108
path: root.crt
101109
{{- end }}
102-
{{- with .Values.nodeSelector }}
103-
nodeSelector:
104-
{{- toYaml . | nindent 8 }}
105-
{{- end }}
106110
{{- end }}

charts/mastodon/templates/job-db-migrate.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ spec:
4141
persistentVolumeClaim:
4242
claimName: {{ template "mastodon.fullname" . }}-system
4343
{{- end }}
44+
{{- with .Values.nodeSelector }}
45+
nodeSelector:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
48+
{{- with .Values.tolerations }}
49+
tolerations:
50+
{{- toYaml . | nindent 8 }}
51+
{{- end }}
4452
containers:
4553
- name: {{ include "mastodon.fullname" . }}-db-migrate
4654
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -98,7 +106,3 @@ spec:
98106
- key: db-certificate.crt
99107
path: root.crt
100108
{{- end }}
101-
{{- with .Values.nodeSelector }}
102-
nodeSelector:
103-
{{- toYaml . | nindent 8 }}
104-
{{- end }}

charts/mastodon/values.yaml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,29 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5+
# Number of replicas for the deployments
56
replicaCount: 1
67

78
image:
89
repository: tootsuite/mastodon
10+
# Image pull policy. Options: Always, Never, IfNotPresent
911
pullPolicy: Always
1012
# Overrides the image tag whose default is the chart appVersion.
1113
tag: "v4.2.10"
1214

15+
# Secrets used to pull images from private registries
1316
imagePullSecrets: []
1417
nameOverride: ""
1518
fullnameOverride: ""
1619

20+
# Global node selector for all pods (jobs, cronjobs will always use this)
21+
# (deployments will use this unless overridden)
22+
nodeSelector: {}
23+
24+
# Global tolerations for all pods (jobs, cronjobs will always use this)
25+
# (deployments will use this unless overridden)
26+
tolerations: []
27+
1728
mastodon:
1829
# Please look at https://docs.joinmastodon.org/admin/config/ for the full documentation.
1930
localDomain: example.com
@@ -23,13 +34,17 @@ mastodon:
2334
logLevel: debug
2435

2536
sidekiq:
37+
# Number of concurrent threads for Sidekiq worker
2638
concurrency: 25
2739

40+
# Node selector for Sidekiq (This takes precedence over the global nodeSelector)
2841
nodeSelector:
2942
doks.digitalocean.com/node-pool: josa-cloud-np
3043

31-
resources:
32-
{}
44+
# Tolerations for Sidekiq (This takes precedence over the global tolerations)
45+
tolerations: []
46+
47+
resources: {}
3348
# limits:
3449
# cpu: 100m
3550
# memory: 128Mi
@@ -60,11 +75,14 @@ mastodon:
6075
successThreshold: 1
6176
failureThreshold: 3
6277

78+
# Node selector for streaming (This takes precedence over the global nodeSelector)
6379
nodeSelector:
6480
doks.digitalocean.com/node-pool: josa-cloud-np
6581

66-
resources:
67-
{}
82+
# Tolerations for streaming (This takes precedence over the global tolerations)
83+
tolerations: []
84+
85+
resources: {}
6886
# limits:
6987
# cpu: 100m
7088
# memory: 128Mi
@@ -89,10 +107,13 @@ mastodon:
89107
successThreshold: 1
90108
failureThreshold: 3
91109

110+
# Node selector for web (This takes precedence over the global nodeSelector)
92111
nodeSelector: {}
93112

94-
resources:
95-
{}
113+
# Tolerations for web (This takes precedence over the global tolerations)
114+
tolerations: []
115+
116+
resources: {}
96117
# limits:
97118
# cpu: 100m
98119
# memory: 128Mi
@@ -101,9 +122,10 @@ mastodon:
101122
# memory: 128Mi
102123

103124
cron:
104-
# run `tootctl media remove` every week
105125
removeMedia:
126+
# Enable the media removal cron job
106127
enabled: true
128+
# Cron schedule for media removal (runs `tootctl media remove` every week by default)
107129
schedule: "0 0 * * 0"
108130

109131
secrets:
@@ -219,14 +241,15 @@ serviceAccount:
219241
# If not set and create is true, a name is generated using the fullname template
220242
name: "mastodon-sa"
221243

244+
# Annotations to add to all pods
222245
podAnnotations: {}
223246

224-
podSecurityContext:
225-
{}
247+
# Security context for all pods
248+
podSecurityContext: {}
226249
# fsGroup: 2000
227250

228-
securityContext:
229-
{}
251+
# Security context for containers
252+
securityContext: {}
230253
# capabilities:
231254
# drop:
232255
# - ALL
@@ -249,14 +272,12 @@ ingress:
249272
paths:
250273
- path: /
251274
pathType: ImplementationSpecific
252-
tls:
253-
[]
275+
tls: []
254276
# - secretName: josa.social-tls
255277
# hosts:
256278
# - example.com
257279

258-
resources:
259-
{}
280+
resources: {}
260281
# We usually recommend not to specify default resources and to leave this as a conscious
261282
# choice for the user. This also increases chances charts run on environments with little
262283
# resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -275,11 +296,8 @@ autoscaling:
275296
targetCPUUtilizationPercentage: 80
276297
# targetMemoryUtilizationPercentage: 80
277298

278-
nodeSelector: {}
279-
280-
tolerations: []
281-
282299
# The annotations set with jobAnnotations will be added to all job pods.
283300
jobAnnotations: {}
284301

302+
# Affinity rules for pod scheduling
285303
affinity: {}

0 commit comments

Comments
 (0)