minio部署

minio 的 helm 仓库

1
helm repo add minio https://helm.min.io/

helm 部署 minio,指定存储类。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
helm install minio \
  --namespace minio --create-namespace \
  --set accessKey=minio,secretKey=minio123 \
  --set mode=standalone \
  --set service.type=NodePort \
  --set persistence.enabled=true \
  --set persistence.size=5Gi \
  --set persistence.storageClass=rook-ceph \
  minio/minio
  #下载minio镜像
  docker pull minio/minio:RELEASE.2021-02-14T04-01-33Z
  docker tag minio/minio:RELEASE.2021-02-14T04-01-33Z www.harbor.mobi/bcs_dev/minio:RELEASE.2021-02-14T04-01-33Z
  docker save www.harbor.mobi/bcs_dev/minio:RELEASE.2021-02-14T04-01-33Z > minio.tar
  #解下来上传到服务进行操作

在目标机器上执行

1
2
docker load < minio.tar
docker push www.harbor.mobi/bcs_dev/minio:RELEASE.2021-02-14T04-01-33Z

在 k8s 的 master 上执行如下操作:

1
2
3
4
5
6
7
8
9
helm install minio \
  --namespace minio --create-namespace \
  --set accessKey=minio,secretKey=minio123 \
  --set mode=standalone \
  --set service.type=NodePort \
  --set persistence.enabled=true \
  --set persistence.size=5Gi \
  --set persistence.storageClass=cephfs-rook-pv \
  -f ./values-minio.yaml ./minio

输入命令后:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
NAME: minio
LAST DEPLOYED: Mon Feb 27 10:35:46 2023
NAMESPACE: minio
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Minio can be accessed via port 9000 on the following DNS name from within your cluster:
minio.minio.svc.cluster.local

To access Minio from localhost, run the below commands:

    1. export POD_NAME=$(kubectl get pods --namespace minio -l "release=minio" -o jsonpath="{.items[0].metadata.name}")

    2. kubectl port-forward $POD_NAME 9000 --namespace minio

Read more about port forwarding here: http://kubernetes.io/docs/user-guide/kubectl/kubectl_port-forward/

You can now access Minio server on http://localhost:9000. Follow the below steps to connect to Minio server with mc client:

    1. Download the Minio mc client - https://docs.minio.io/docs/minio-client-quickstart-guide

    2. Get the ACCESS_KEY=$(kubectl get secret minio -o jsonpath="{.data.accesskey}" | base64 --decode) and the SECRET_KEY=$(kubectl get secret minio -o jsonpath="{.data.secretkey}" | base64 --decode)

    3. mc alias set minio-local http://localhost:9000 "$ACCESS_KEY" "$SECRET_KEY" --api s3v4

    4. mc ls minio-local

Alternately, you can use your browser or the Minio SDK to access the server - https://docs.minio.io/categories/17

下面来看看命令执行的怎么样

1
kubectl get deploy -n minio

存储类写错,更新命令如下:

1
2
3
4
5
6
7
8
9
helm upgrade minio \
  --namespace minio  \
  --set accessKey=minio,secretKey=minio123 \
  --set mode=standalone \
  --set service.type=NodePort \
  --set persistence.enabled=true \
  --set persistence.size=5Gi \
  --set persistence.storageClass=rook-cephfs \
  minio/minio

参考文档:

https://blog.csdn.net/networken/article/details/111469223

Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up