mastodon: bump to v4.4.1, helm chart v6.5.0
This commit is contained in:
97
mastodon/templates/job-assets-copy.yaml
Normal file
97
mastodon/templates/job-assets-copy.yaml
Normal file
@ -0,0 +1,97 @@
|
||||
{{- if .Values.mastodon.hooks.s3Upload.enabled -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ include "mastodon.fullname" . }}-assets-upload
|
||||
labels:
|
||||
{{- include "mastodon.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": pre-install,pre-upgrade
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
|
||||
"helm.sh/hook-weight": "-1"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: {{ include "mastodon.fullname" . }}-assets-upload
|
||||
{{- with .Values.jobAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
restartPolicy: Never
|
||||
initContainers:
|
||||
- name: extract-assets
|
||||
image: "{{ coalesce .Values.mastodon.web.image.repository .Values.image.repository }}:{{ coalesce .Values.mastodon.web.image.tag .Values.image.tag .Chart.AppVersion }}"
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
- cp
|
||||
args:
|
||||
- -rv
|
||||
- public
|
||||
- /assets
|
||||
volumeMounts:
|
||||
- mountPath: /assets
|
||||
name: assets
|
||||
containers:
|
||||
- name: upload-assets
|
||||
image: rclone/rclone:1
|
||||
imagePullPolicy: Always
|
||||
env:
|
||||
- name: RCLONE_S3_NO_CHECK_BUCKET
|
||||
value: "true"
|
||||
- name: RCLONE_S3_ACL
|
||||
value: {{ required "Please specify a canned ACL for S3 asset uploads" .Values.mastodon.hooks.s3Upload.acl }}
|
||||
- name: RCLONE_CONFIG_REMOTE_TYPE
|
||||
value: s3
|
||||
- name: RCLONE_CONFIG_REMOTE_PROVIDER
|
||||
value: AWS
|
||||
- name: RCLONE_CONFIG_REMOTE_ENDPOINT
|
||||
value: {{ required "Please specify an endpoint for S3 asset uploads" .Values.mastodon.hooks.s3Upload.endpoint }}
|
||||
- name: RCLONE_CONFIG_REMOTE_ACCESS_KEY_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ required "Please specify a secret with S3 credentials for S3 asset uploads" .Values.mastodon.hooks.s3Upload.secretRef.name }}
|
||||
key: {{ .Values.mastodon.hooks.s3Upload.secretRef.keys.accesKeyId }}
|
||||
- name: RCLONE_CONFIG_REMOTE_SECRET_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ required "Please specify a secret with S3 credentials for S3 asset uploads" .Values.mastodon.hooks.s3Upload.secretRef.name }}
|
||||
key: {{ .Values.mastodon.hooks.s3Upload.secretRef.keys.secretAccessKey }}
|
||||
{{- with .Values.mastodon.hooks.s3Upload.rclone.env }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- rclone
|
||||
args:
|
||||
- copy
|
||||
- /assets/public
|
||||
- "remote:{{ required "Please specify a bucket for S3 asset uploads" .Values.mastodon.hooks.s3Upload.bucket }}"
|
||||
- --fast-list
|
||||
- --transfers=32
|
||||
- --include
|
||||
- "{assets,packs}/**"
|
||||
- --progress
|
||||
- -vv
|
||||
volumeMounts:
|
||||
- mountPath: /assets
|
||||
name: assets
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
memory: 500Mi
|
||||
volumes:
|
||||
- name: assets
|
||||
emptyDir: {}
|
||||
{{- with coalesce .Values.mastodon.hooks.s3Upload.nodeSelector .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- . | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
Reference in New Issue
Block a user