Skip to content
Snippets Groups Projects
Verified Commit 12fe1a56 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

fix(mastodon): Unify affinities for jobs

Currently the jobs still had the old S3 dependant affinity magic going,
which seems violates the rule of least surprise (in my perspective),
therefore removing the magic affinity adjustments and instead go with
using the same affinities defined for all web Pods.
parent 473c8d18
No related branches found
No related tags found
No related merge requests found
...@@ -18,21 +18,11 @@ spec: ...@@ -18,21 +18,11 @@ spec:
{{- end }} {{- end }}
spec: spec:
restartPolicy: Never restartPolicy: Never
{{- if (not .Values.mastodon.s3.enabled) }} {{- with (default .Values.affinity .Values.mastodon.web.affinity) }}
# ensure we run on the same node as the other rails components; only
# required when using PVCs that are ReadWriteOnce
{{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }}
affinity: affinity:
podAffinity: {{- toYaml . | nindent 8 }}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/part-of
operator: In
values:
- rails
topologyKey: kubernetes.io/hostname
{{- end }} {{- end }}
{{- if (not .Values.mastodon.s3.enabled) }}
volumes: volumes:
- name: assets - name: assets
persistentVolumeClaim: persistentVolumeClaim:
......
...@@ -19,21 +19,11 @@ spec: ...@@ -19,21 +19,11 @@ spec:
{{- end }} {{- end }}
spec: spec:
restartPolicy: Never restartPolicy: Never
{{- if (not .Values.mastodon.s3.enabled) }} {{- with (default .Values.affinity .Values.mastodon.web.affinity) }}
# ensure we run on the same node as the other rails components; only
# required when using PVCs that are ReadWriteOnce
{{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }}
affinity: affinity:
podAffinity: {{- toYaml . | nindent 8 }}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/part-of
operator: In
values:
- rails
topologyKey: kubernetes.io/hostname
{{- end }} {{- end }}
{{- if (not .Values.mastodon.s3.enabled) }}
volumes: volumes:
- name: assets - name: assets
persistentVolumeClaim: persistentVolumeClaim:
......
...@@ -19,21 +19,11 @@ spec: ...@@ -19,21 +19,11 @@ spec:
{{- end }} {{- end }}
spec: spec:
restartPolicy: Never restartPolicy: Never
{{- if (not .Values.mastodon.s3.enabled) }} {{- with (default .Values.affinity .Values.mastodon.web.affinity) }}
# ensure we run on the same node as the other rails components; only
# required when using PVCs that are ReadWriteOnce
{{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }}
affinity: affinity:
podAffinity: {{- toYaml . | nindent 8 }}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/part-of
operator: In
values:
- rails
topologyKey: kubernetes.io/hostname
{{- end }} {{- end }}
{{- if (not .Values.mastodon.s3.enabled) }}
volumes: volumes:
- name: assets - name: assets
persistentVolumeClaim: persistentVolumeClaim:
......
...@@ -18,21 +18,11 @@ spec: ...@@ -18,21 +18,11 @@ spec:
{{- end }} {{- end }}
spec: spec:
restartPolicy: Never restartPolicy: Never
{{- if (not .Values.mastodon.s3.enabled) }} {{- with (default .Values.affinity .Values.mastodon.web.affinity) }}
# ensure we run on the same node as the other rails components; only
# required when using PVCs that are ReadWriteOnce
{{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }}
affinity: affinity:
podAffinity: {{- toYaml . | nindent 8 }}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/part-of
operator: In
values:
- rails
topologyKey: kubernetes.io/hostname
{{- end }} {{- end }}
{{- if (not .Values.mastodon.s3.enabled) }}
volumes: volumes:
- name: assets - name: assets
persistentVolumeClaim: persistentVolumeClaim:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment