Skip to content

Commit ae892d5

Browse files
deepyineffybleSISheogorathbocan
authored
Refactor chart sidekiq queues (#1)
Co-authored-by: Effy Elden <effy@effy.space> Co-authored-by: Sheogorath <sheogorath@shivering-isles.com> Co-authored-by: Chris Funderburg <chris@funderburg.me>
1 parent 543fdf7 commit ae892d5

File tree

13 files changed

+405
-310
lines changed

13 files changed

+405
-310
lines changed

.github/workflows/test-chart.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,16 @@ name: Test chart
55

66
on:
77
pull_request:
8-
paths:
9-
- "chart/**"
10-
- "!**.md"
11-
- ".github/workflows/test-chart.yml"
8+
paths-ignore:
9+
- "README.md"
1210
push:
13-
paths:
14-
- "chart/**"
15-
- "!**.md"
16-
- ".github/workflows/test-chart.yml"
1711
branches-ignore:
1812
- "dependabot/**"
1913
workflow_dispatch:
2014

2115
permissions:
2216
contents: read
2317

24-
defaults:
25-
run:
26-
working-directory: chart
27-
2818
jobs:
2919
lint-templates:
3020
runs-on: ubuntu-22.04

Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ 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: 2.3.0
18+
version: 4.0.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
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: v3.5.3
23+
appVersion: v4.0.2
2424

2525
dependencies:
2626
- name: elasticsearch

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ The variables that _must_ be configured are:
1919

2020
- SMTP settings for your mailer in the `mastodon.smtp` group.
2121

22+
If your PersistentVolumeClaim is `ReadWriteOnce` and you're unable to use a S3-compatible service or
23+
run a self-hosted compatible service like [Minio](https://min.io/docs/minio/kubernetes/upstream/index.html)
24+
then you need to set the pod affinity so the web and sidekiq pods are scheduled to the same node.
25+
26+
Example configuration:
27+
```yaml
28+
podAffinity:
29+
requiredDuringSchedulingIgnoredDuringExecution:
30+
- labelSelector:
31+
matchExpressions:
32+
- key: app.kubernetes.io/part-of
33+
operator: In
34+
values:
35+
- rails
36+
topologyKey: kubernetes.io/hostname
37+
```
38+
2239
# Administration
2340
2441
You can run [admin CLI](https://docs.joinmastodon.org/admin/tootctl/) commands in the web deployment.

templates/_helpers.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ Return true if a mastodon secret object should be created
136136
{{- true -}}
137137
{{- end -}}
138138
{{- end -}}
139+
140+
{{/*
141+
Find highest number of needed database connections to set DB_POOL variable
142+
*/}}
143+
{{- define "mastodon.maxDbPool" -}}
144+
{{/* Default MAX_THREADS for Puma is 5 */}}
145+
{{- $poolSize := 5 }}
146+
{{- range .Values.mastodon.sidekiq.workers }}
147+
{{- $poolSize = max $poolSize .concurrency }}
148+
{{- end }}
149+
{{- $poolSize | quote }}
150+
{{- end }}

0 commit comments

Comments
 (0)