39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
|
{{- if .Values.mcJob.enabled }}
|
||
|
apiVersion: batch/v1
|
||
|
kind: Job
|
||
|
metadata:
|
||
|
name: yonote-minio-mc-job
|
||
|
labels:
|
||
|
app: yonote-minio
|
||
|
spec:
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: yonote-minio
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: mc-client
|
||
|
image: "docker.io/bitnami/minio-client:2024.8.13-debian-12-r0"
|
||
|
command: ["/bin/sh", "-c"]
|
||
|
args:
|
||
|
- |
|
||
|
until mc alias set myminio http://yonote-minio:9000 {{ .Values.minio.auth.rootUser }} {{ .Values.minio.auth.rootPassword }}; do
|
||
|
echo "Waiting for MinIO to be ready..."
|
||
|
sleep 5
|
||
|
done
|
||
|
if ! mc ls myminio/yonote-bucket; then
|
||
|
mc mb myminio/yonote-bucket
|
||
|
else
|
||
|
echo "Bucket yonote-bucket already exists."
|
||
|
fi
|
||
|
resources:
|
||
|
requests:
|
||
|
memory: "128Mi"
|
||
|
cpu: "100m"
|
||
|
limits:
|
||
|
memory: "256Mi"
|
||
|
cpu: "200m"
|
||
|
restartPolicy: OnFailure
|
||
|
backoffLimit: 5
|
||
|
ttlSecondsAfterFinished: 100
|
||
|
{{- end }}
|