MinIO導入マン

S3互換なストレージがほしい。本番環境はS3を使ったとしても大した金額にはならなそうだからS3でもいいかもだが、一旦ローカル環境用にMinIOをdockerで建てる。


version: "3.0"
services:
minio:
image: minio/minio:latest
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: password
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
command: server /export --console-address ":9001"

volumes:
miniodata:

これでブラウザでhttp://localhost:9001にアクセスするとUIが表示されてminio/passwordでログインできる。


(スクショTODO)

ローカルで建てたMinIOにログインする際にも注意喚起が表示される。


localで建てたMinIOのbucket確認

aws configure --profile minio_localhost

などとしてローカルMinIO用のプロファイルを作成する。

aws --endpoint-url http://localhost:9000 s3 ls --profile minio_localhost
2025-06-28 02:53:27 <your-bucket-name>

という感じでbucketを確認することができる。


Kubernetes clusterにMinIO Operatorのinstall

https://min.io/docs/minio/kubernetes/upstream/operations/install-deploy-manage/deploy-operator-helm.html

helm repoで追加した後に、以下でinstallがうまく行っていることを確認。

kubectl get all -n minio-operator
NAME READY STATUS RESTARTS AGE
pod/minio-operator-678df8f4f7-2shcz 1/1 Running 0 4m27s
pod/minio-operator-678df8f4f7-6dfxk 1/1 Running 0 4m27s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/operator ClusterIP 10.103.125.172 <none> 4221/TCP 4m28s
service/sts ClusterIP 10.105.38.120 <none> 4223/TCP 4m28s

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/minio-operator 2/2 2 2 4m27s

NAME DESIRED CURRENT READY AGE
replicaset.apps/minio-operator-678df8f4f7 2 2 2 4m27s


MinIO Operatorが正常にinstallされたことを確認してMinIO tenantのdeployを行う。


MinIO Tenantのinstall

https://min.io/docs/minio/kubernetes/upstream/operations/install-deploy-manage/deploy-minio-tenant-helm.html#


同様にhelm repoでinstallを行う。volumesPerServerの数は冗長性のために1に設定しても4以上の値になる模様。

関連: https://github.com/minio/operator/issues/457


デフォルトで設定されている環境変数を上書きするためには以下のように

# If this variable is set to true, then enable the usage of an existing Kubernetes secret to set environment variables for the Tenant.
# The existing Kubernetes secret name must be placed under .tenant.configuration.name e.g. existing-minio-env-configuration
# The secret must contain a key ``config.env``.
# The values should be a series of export statements to set environment variables for the Tenant.

existingSecret: trueを設定したうえでkind: Secretの設定を行う。なお一度作成されたtenantに対してあとからsecretの設定を変えても反映されないことに注意。

Related Articles