refactor storage minio for k8s

This commit is contained in:
2026-03-26 09:20:23 -03:00
parent e27cb5bcc3
commit c9ba9e4f5f
22 changed files with 961 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ kind: Kustomization
resources:
- ../../base
- minio-pvc.yaml
patches:
# Gateway as NodePort for local access
@@ -28,3 +29,40 @@ patches:
- op: add
path: /spec/ports/0/nodePort
value: 30379
# MinIO with persistent storage + host media mount for seeding.
# PV survives pod restarts. Host mount is read-only for mc mirror seeding.
# Requires kind cluster created with MEDIA_HOST_PATH extraMount (see kind-create.sh).
- target:
kind: Deployment
name: minio
patch: |
- op: replace
path: /spec/template/spec/volumes/0
value:
name: data
persistentVolumeClaim:
claimName: minio-data
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: host-media
mountPath: /host-media
readOnly: true
- op: add
path: /spec/template/spec/volumes/-
value:
name: host-media
hostPath:
path: /mnt/media
type: DirectoryOrCreate
- op: replace
path: /spec/template/spec/containers/0/lifecycle/postStart/exec/command
value:
- /bin/sh
- -c
- |
until curl -sf http://localhost:9000/minio/health/live; do sleep 1; done
/usr/bin/mc alias set local http://localhost:9000 minioadmin minioadmin --quiet
/usr/bin/mc mb --ignore-existing local/mpr
/usr/bin/mc cp --recursive /host-media/mpr/out/ local/mpr/out/ --quiet || true

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio-data
namespace: mpr
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi