diff --git a/charts/mastodon/Chart.yaml b/charts/mastodon/Chart.yaml index 89573c3..c23c6ca 100644 --- a/charts/mastodon/Chart.yaml +++ b/charts/mastodon/Chart.yaml @@ -15,7 +15,7 @@ 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: 0.3.1 +version: 0.4.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 diff --git a/charts/mastodon/templates/cronjob-media-remove.yaml b/charts/mastodon/templates/cronjob-media-remove.yaml index 5018639..108af48 100644 --- a/charts/mastodon/templates/cronjob-media-remove.yaml +++ b/charts/mastodon/templates/cronjob-media-remove.yaml @@ -41,6 +41,14 @@ spec: persistentVolumeClaim: claimName: {{ template "mastodon.fullname" . }}-system {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "mastodon.fullname" . }}-media-remove image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/charts/mastodon/templates/deployment-sidekiq.yaml b/charts/mastodon/templates/deployment-sidekiq.yaml index 01e87df..e4b835d 100644 --- a/charts/mastodon/templates/deployment-sidekiq.yaml +++ b/charts/mastodon/templates/deployment-sidekiq.yaml @@ -106,13 +106,17 @@ spec: {{- end }} resources: {{- toYaml .Values.mastodon.sidekiq.resources | nindent 12 }} - {{- with .Values.mastodon.sidekiq.nodeSelector }} + {{- $nodeSelector := merge .Values.nodeSelector .Values.mastodon.sidekiq.nodeSelector }} + {{- with $nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- if and .Values.mastodon.sidekiq.tolerations (gt (len .Values.mastodon.sidekiq.tolerations) 0) }} tolerations: - {{- toYaml . | nindent 8 }} + {{- toYaml .Values.mastodon.sidekiq.tolerations | nindent 8 }} + {{- else if .Values.tolerations }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} {{- end }} {{- if .Values.postgres.credentials.certificateSecret }} volumes: diff --git a/charts/mastodon/templates/deployment-streaming.yaml b/charts/mastodon/templates/deployment-streaming.yaml index 40224e6..e2f6ac6 100644 --- a/charts/mastodon/templates/deployment-streaming.yaml +++ b/charts/mastodon/templates/deployment-streaming.yaml @@ -97,18 +97,22 @@ spec: {{- end }} resources: {{- toYaml .Values.mastodon.streaming.resources | nindent 12 }} - {{- with .Values.mastodon.streaming.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} - tolerations: + {{- $nodeSelector := merge .Values.nodeSelector .Values.mastodon.streaming.nodeSelector }} + {{- with $nodeSelector }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- if and .Values.mastodon.streaming.tolerations (gt (len .Values.mastodon.streaming.tolerations) 0) }} + tolerations: + {{- toYaml .Values.mastodon.streaming.tolerations | nindent 8 }} + {{- else if .Values.tolerations }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + {{- end }} {{- if .Values.postgres.credentials.certificateSecret }} volumes: - name: certificates diff --git a/charts/mastodon/templates/deployment-web.yaml b/charts/mastodon/templates/deployment-web.yaml index 4f39631..717638d 100644 --- a/charts/mastodon/templates/deployment-web.yaml +++ b/charts/mastodon/templates/deployment-web.yaml @@ -118,18 +118,22 @@ spec: {{- end }} resources: {{- toYaml .Values.mastodon.web.resources | nindent 12 }} - {{- with .Values.mastodon.web.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} - tolerations: + {{- $nodeSelector := merge .Values.nodeSelector .Values.mastodon.web.nodeSelector }} + {{- with $nodeSelector }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- if and .Values.mastodon.web.tolerations (gt (len .Values.mastodon.web.tolerations) 0) }} + tolerations: + {{- toYaml .Values.mastodon.web.tolerations | nindent 8 }} + {{- else if .Values.tolerations }} + tolerations: + {{- toYaml .Values.tolerations | nindent 8 }} + {{- end }} {{- if .Values.postgres.credentials.certificateSecret }} volumes: - name: certificates diff --git a/charts/mastodon/templates/job-assets-precompile.yaml b/charts/mastodon/templates/job-assets-precompile.yaml index bd268e5..9b6637a 100644 --- a/charts/mastodon/templates/job-assets-precompile.yaml +++ b/charts/mastodon/templates/job-assets-precompile.yaml @@ -41,6 +41,14 @@ spec: persistentVolumeClaim: claimName: {{ template "mastodon.fullname" . }}-system {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "mastodon.fullname" . }}-assets-precompile image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -98,7 +106,3 @@ spec: - key: db-certificate.crt path: root.crt {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/charts/mastodon/templates/job-chewy-upgrade.yaml b/charts/mastodon/templates/job-chewy-upgrade.yaml index f8b9dab..d0dc3b8 100644 --- a/charts/mastodon/templates/job-chewy-upgrade.yaml +++ b/charts/mastodon/templates/job-chewy-upgrade.yaml @@ -42,6 +42,14 @@ spec: persistentVolumeClaim: claimName: {{ template "mastodon.fullname" . }}-system {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "mastodon.fullname" . }}-chewy-setup image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -99,8 +107,4 @@ spec: - key: db-certificate.crt path: root.crt {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} {{- end }} diff --git a/charts/mastodon/templates/job-db-migrate.yaml b/charts/mastodon/templates/job-db-migrate.yaml index 751ef28..58d749b 100644 --- a/charts/mastodon/templates/job-db-migrate.yaml +++ b/charts/mastodon/templates/job-db-migrate.yaml @@ -41,6 +41,14 @@ spec: persistentVolumeClaim: claimName: {{ template "mastodon.fullname" . }}-system {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "mastodon.fullname" . }}-db-migrate image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -98,7 +106,3 @@ spec: - key: db-certificate.crt path: root.crt {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/charts/mastodon/values.yaml b/charts/mastodon/values.yaml index eec29cf..1dd891a 100644 --- a/charts/mastodon/values.yaml +++ b/charts/mastodon/values.yaml @@ -2,18 +2,29 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +# Number of replicas for the deployments replicaCount: 1 image: repository: tootsuite/mastodon + # Image pull policy. Options: Always, Never, IfNotPresent pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: "v4.2.10" +# Secrets used to pull images from private registries imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +# Global node selector for all pods (jobs, cronjobs will always use this) +# (deployments will use this unless overridden) +nodeSelector: {} + +# Global tolerations for all pods (jobs, cronjobs will always use this) +# (deployments will use this unless overridden) +tolerations: [] + mastodon: # Please look at https://docs.joinmastodon.org/admin/config/ for the full documentation. localDomain: example.com @@ -23,13 +34,17 @@ mastodon: logLevel: debug sidekiq: + # Number of concurrent threads for Sidekiq worker concurrency: 25 + # Node selector for Sidekiq (This takes precedence over the global nodeSelector) nodeSelector: doks.digitalocean.com/node-pool: josa-cloud-np - resources: - {} + # Tolerations for Sidekiq (This takes precedence over the global tolerations) + tolerations: [] + + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -60,11 +75,14 @@ mastodon: successThreshold: 1 failureThreshold: 3 + # Node selector for streaming (This takes precedence over the global nodeSelector) nodeSelector: doks.digitalocean.com/node-pool: josa-cloud-np - resources: - {} + # Tolerations for streaming (This takes precedence over the global tolerations) + tolerations: [] + + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -89,10 +107,13 @@ mastodon: successThreshold: 1 failureThreshold: 3 + # Node selector for web (This takes precedence over the global nodeSelector) nodeSelector: {} - resources: - {} + # Tolerations for web (This takes precedence over the global tolerations) + tolerations: [] + + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -101,9 +122,10 @@ mastodon: # memory: 128Mi cron: - # run `tootctl media remove` every week removeMedia: + # Enable the media removal cron job enabled: true + # Cron schedule for media removal (runs `tootctl media remove` every week by default) schedule: "0 0 * * 0" secrets: @@ -219,14 +241,15 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "mastodon-sa" +# Annotations to add to all pods podAnnotations: {} -podSecurityContext: - {} +# Security context for all pods +podSecurityContext: {} # fsGroup: 2000 -securityContext: - {} +# Security context for containers +securityContext: {} # capabilities: # drop: # - ALL @@ -249,14 +272,12 @@ ingress: paths: - path: / pathType: ImplementationSpecific - tls: - [] + tls: [] # - secretName: josa.social-tls # hosts: # - example.com -resources: - {} +resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -275,11 +296,8 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -nodeSelector: {} - -tolerations: [] - # The annotations set with jobAnnotations will be added to all job pods. jobAnnotations: {} +# Affinity rules for pod scheduling affinity: {}