browsertrix/chart/templates/minio.yaml
Ilya Kreymer fb3d88291f
Background Jobs Work (#1321)
Fixes #1252 

Supports a generic background job system, with two background jobs,
CreateReplicaJob and DeleteReplicaJob.
- CreateReplicaJob runs on new crawls, uploads, profiles and updates the
`replicas` array with the info about the replica after the job succeeds.
- DeleteReplicaJob deletes the replica.
- Both jobs are created from the new `replica_job.yaml` template. The
CreateReplicaJob sets secrets for primary storage + replica storage,
while DeleteReplicaJob only needs the replica storage.
- The job is processed in the operator when the job is finalized
(deleted), which should happen immediately when the job is done, either
because it succeeds or because the backoffLimit is reached (currently
set to 3).
- /jobs/ api lists all jobs using a paginated response, including filtering and sorting
- /jobs/<job id> returns details for a particular job
- tests: nightly tests updated to check create + delete replica jobs for crawls as well as uploads, job api endpoints
- tests: also fixes to timeouts in nightly tests to avoid crawls finishing too quickly.

---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
2023-11-02 13:02:17 -07:00

165 lines
3.4 KiB
YAML

{{- if .Values.minio_local }}
---
kind: Secret
apiVersion: v1
metadata:
name: minio-auth
namespace: {{ .Release.Namespace }}
type: Opaque
stringData:
{{- with (first .Values.storages) }}
MINIO_ROOT_USER: "{{ .access_key }}"
MINIO_ROOT_PASSWORD: "{{ .secret_key }}"
MC_HOST: "{{ $.Values.minio_scheme }}://{{ .access_key }}:{{ .secret_key }}@{{ $.Values.minio_host }}"
{{- end }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: minio-storage-pvc
annotations:
"helm.sh/resource-policy": keep
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
{{- if .Values.volume_storage_class }}
storageClassName: {{ .Values.volume_storage_class }}
{{- end }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: local-minio
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: local-minio
replicas: 1
template:
metadata:
labels:
app: local-minio
spec:
{{- if .Values.main_node_type }}
nodeSelector:
nodeType: {{ .Values.main_node_type }}
{{- end }}
volumes:
- name: data-minio
persistentVolumeClaim:
claimName: minio-storage-pvc
initContainers:
- name: init-bucket
image: {{ .Values.minio_image }}
imagePullPolicy: {{ .Values.minio_pull_policy }}
command:
- sh
- -c
- |
mkdir -p /data/{{ .Values.minio_local_bucket_name }}
mkdir -p /data/.minio.sys
echo '{"version":"1","format":"fs","id":"btrix-data-fs","fs":{"version":"2"}}' > /data/.minio.sys/format.json
volumeMounts:
- name: data-minio
mountPath: /data
subPath: minio
resources:
limits:
memory: {{ .Values.minio_memory }}
requests:
cpu: {{ .Values.minio_cpu }}
memory: {{ .Values.minio_memory }}
containers:
- name: minio
image: {{ .Values.minio_image }}
imagePullPolicy: {{ .Values.minio_pull_policy }}
args: ["server", "/data", "--console-address", ":9001"]
envFrom:
- secretRef:
name: minio-auth
volumeMounts:
- name: data-minio
mountPath: /data
subPath: minio
resources:
limits:
memory: {{ .Values.minio_memory }}
requests:
cpu: {{ .Values.minio_cpu }}
memory: {{ .Values.minio_memory }}
---
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: local-minio
labels:
app: local-minio
spec:
{{- if .Values.minio_local_access_port }}
type: NodePort
{{- end }}
selector:
app: local-minio
ports:
- protocol: TCP
port: 9000
{{- if .Values.minio_local_access_port }}
nodePort: {{ .Values.minio_local_access_port }}
{{- end }}
name: minio
{{- if .Values.minio_local_console_port }}
---
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: local-minio-console
labels:
app: local-minio-console
spec:
type: NodePort
selector:
app: local-minio
ports:
- protocol: TCP
port: 9001
nodePort: {{ .Values.minio_local_console_port }}
name: minio-console
{{- end }}
{{- end }}