1、添加helm repo
helm repo add minio-repo https://charts.bitnami.com/bitnami
helm repo update
helm fetch minio-repo/minio --untar
cp minio/values.yaml .
2、部署
helm -n sre install minio minio-repo/minio \
--set mode="distributed" \
--set auth.rootUser=admin \
--set auth.rootPassword="duanshuaixingPassw0rd" \
--set accessKey=duanshuaxing-ak \
--set secretKey=dunashuaixing-sk-env \
--set-string env.MINIO_ACCESS_KEY=dunashuaixing-access-key \
--set-string env.MINIO_SECRET_KEY=dunashuaixing-secret-key \
--set persistence.enabled=true \
--set persistence.storageClass="local-path" \
--set persistence.size=200G \
--set statefulset.replicaCount=4 \
--set resources.limits.cpu=1 \
--set resources.limits.memory=1Gi \
--set resources.requests.cpu=200m \
--set resources.requests.memory=200Mi
NAME: minio
LAST DEPLOYED: Tue Mar 19 14:50:50 2024
NAMESPACE: sre
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: minio
CHART VERSION: 14.1.0
APP VERSION: 2024.3.15
** Please be patient while the chart is being deployed **
MinIO® can be accessed via port on the following DNS name from within your cluster:
minio.sre.svc.cluster.local
To get your credentials run:
export ROOT_USER=$(kubectl get secret --namespace sre minio -o jsonpath="{.data.root-user}" | base64 -d)
export ROOT_PASSWORD=$(kubectl get secret --namespace sre minio -o jsonpath="{.data.root-password}" | base64 -d)
To connect to your MinIO® server using a client:
- Run a MinIO® Client pod and append the desired command (e.g. 'admin info'):
kubectl run --namespace sre minio-client \
--rm --tty -i --restart='Never' \
--env MINIO_SERVER_ROOT_USER=$ROOT_USER \
--env MINIO_SERVER_ROOT_PASSWORD=$ROOT_PASSWORD \
--env MINIO_SERVER_HOST=minio \
--image docker.io/bitnami/minio-client:2024.3.9-debian-12-r0 -- admin info minio
To access the MinIO® web UI:
- Get the MinIO® URL:
echo "MinIO® web URL: http://127.0.0.1:9001/minio"
kubectl port-forward --namespace sre svc/minio 9001:9001
WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
- resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
3、配置minio客户端(命令行配置)
mc config host add minio http://minio.sre.svc.cluster.local:9000 duanshuaxing-ak dunashuaixing-sk --api s3v4
4、生成ak/sk MINIO_ACCESS_KEY 和 MINIO_SECRET_KEY
mc config host add minio http://minio.sre.svc.cluster.local:9000 FGXgT3RIEOfCP6J5 INgbX065QkwcSPYT --api s3v4
查看配置
mc config host list
温馨提示: Minio 持久化数据存储不建议使用网络文件系统卷,有可能导致MinIO无法提供一致性保证,若非要使用NFS网络连接存储的部署,请使用NFSv4以获得最佳效果。
mount -l
# 挂载 NFS 时关键参数 vers=4
192.168.86.100:/volume1/storage/ on /app type nfs (rw,relatime,vers=4,rsize=131072
参考:https://blog.csdn.net/lgbisha/article/details/133137331