refactor storage minio for k8s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user