Skip to content

Commit

Permalink
Refactor chart sidekiq queues (#1)
Browse files Browse the repository at this point in the history
Co-authored-by: Effy Elden <[email protected]>
Co-authored-by: Sheogorath <[email protected]>
Co-authored-by: Chris Funderburg <[email protected]>
  • Loading branch information
4 people authored Dec 3, 2022
1 parent 543fdf7 commit ae892d5
Show file tree
Hide file tree
Showing 13 changed files with 405 additions and 310 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/test-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,16 @@ name: Test chart

on:
pull_request:
paths:
- "chart/**"
- "!**.md"
- ".github/workflows/test-chart.yml"
paths-ignore:
- "README.md"
push:
paths:
- "chart/**"
- "!**.md"
- ".github/workflows/test-chart.yml"
branches-ignore:
- "dependabot/**"
workflow_dispatch:

permissions:
contents: read

defaults:
run:
working-directory: chart

jobs:
lint-templates:
runs-on: ubuntu-22.04
Expand Down
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.3.0
version: 4.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: v3.5.3
appVersion: v4.0.2

dependencies:
- name: elasticsearch
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ The variables that _must_ be configured are:

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

If your PersistentVolumeClaim is `ReadWriteOnce` and you're unable to use a S3-compatible service or
run a self-hosted compatible service like [Minio](https://min.io/docs/minio/kubernetes/upstream/index.html)
then you need to set the pod affinity so the web and sidekiq pods are scheduled to the same node.

Example configuration:
```yaml
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/part-of
operator: In
values:
- rails
topologyKey: kubernetes.io/hostname
```
# Administration
You can run [admin CLI](https://docs.joinmastodon.org/admin/tootctl/) commands in the web deployment.
Expand Down
12 changes: 12 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,15 @@ Return true if a mastodon secret object should be created
{{- true -}}
{{- end -}}
{{- end -}}

{{/*
Find highest number of needed database connections to set DB_POOL variable
*/}}
{{- define "mastodon.maxDbPool" -}}
{{/* Default MAX_THREADS for Puma is 5 */}}
{{- $poolSize := 5 }}
{{- range .Values.mastodon.sidekiq.workers }}
{{- $poolSize = max $poolSize .concurrency }}
{{- end }}
{{- $poolSize | quote }}
{{- end }}
Loading

0 comments on commit ae892d5

Please sign in to comment.