]> cat aescling's git repositories - mastodon.git/blob - chart/templates/cronjob-media-remove.yaml
8515e4002720da830e11e6b93961df48ff7b5981
[mastodon.git] / chart / templates / cronjob-media-remove.yaml
1 {{ if .Values.mastodon.cron.removeMedia.enabled }}
2 apiVersion: batch/v1beta1
3 kind: CronJob
4 metadata:
5 name: {{ include "mastodon.fullname" . }}-media-remove
6 labels:
7 {{- include "mastodon.labels" . | nindent 4 }}
8 spec:
9 schedule: {{ .Values.mastodon.cron.removeMedia.schedule }}
10 jobTemplate:
11 spec:
12 template:
13 metadata:
14 name: {{ include "mastodon.fullname" . }}-media-remove
15 spec:
16 restartPolicy: OnFailure
17 # ensure we run on the same node as the other rails components; only
18 # required when using PVCs that are ReadWriteOnce
19 {{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }}
20 affinity:
21 podAffinity:
22 requiredDuringSchedulingIgnoredDuringExecution:
23 - labelSelector:
24 matchExpressions:
25 - key: component
26 operator: In
27 values:
28 - rails
29 topologyKey: kubernetes.io/hostname
30 {{- end }}
31 volumes:
32 - name: assets
33 persistentVolumeClaim:
34 claimName: {{ template "mastodon.fullname" . }}-assets
35 - name: system
36 persistentVolumeClaim:
37 claimName: {{ template "mastodon.fullname" . }}-system
38 containers:
39 - name: {{ include "mastodon.fullname" . }}-media-remove
40 image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
41 imagePullPolicy: {{ .Values.image.pullPolicy }}
42 command:
43 - bin/tootctl
44 - media
45 - remove
46 envFrom:
47 - configMapRef:
48 name: {{ include "mastodon.fullname" . }}-env
49 - secretRef:
50 name: {{ template "mastodon.fullname" . }}
51 env:
52 - name: "DB_PASS"
53 valueFrom:
54 secretKeyRef:
55 {{- if .Values.postgresql.enabled }}
56 name: {{ .Release.Name }}-postgresql
57 {{- else }}
58 name: {{ template "mastodon.fullname" . }}
59 {{- end }}
60 key: postgresql-password
61 - name: "REDIS_PASSWORD"
62 valueFrom:
63 secretKeyRef:
64 name: {{ .Release.Name }}-redis
65 key: redis-password
66 - name: "PORT"
67 value: {{ .Values.mastodon.web.port | quote }}
68 volumeMounts:
69 - name: assets
70 mountPath: /opt/mastodon/public/assets
71 - name: system
72 mountPath: /opt/mastodon/public/system
73 {{- end }}
This page took 0.070746 seconds and 2 git commands to generate.