代码拉取完成,页面将自动刷新
MinIO 是在 GNU Affero 通用公共许可证 v3.0 下发布的高性能对象存储。它与 Amazon S3 云存储服务 API 兼容。使用 MinIO 为机器学习、分析和应用程序数据工作负载构建高性能基础架构。
官方文档:https://docs.min.io/
中文文档:http://docs.minio.org.cn/docs/
GitHub地址:https://github.com/minio/minio/
想了解更多关于minio也可以参考我以下几篇文章:
因为minio是有chart包,所以这里就基于现有的chart包进行改造。
helm repo add bitnami https://charts.bitnami.com/bitnami
helm pull bitnami/minio --version 11.10.16
tar -xf minio-11.10.16.tgz
这里就不重新构建镜像了,只是把远程的包推送到本地harbor仓库,如有不知道怎么构建镜像的小伙伴,欢迎留言或私信。
docker pull docker.io/bitnami/minio:2022.11.11-debian-11-r0
docker tag docker.io/bitnami/minio:2022.11.11-debian-11-r0 myharbor.com/bigdata/minio:2022.11.11-debian-11-r0
docker push myharbor.com/bigdata/minio:2022.11.11-debian-11-r0
docker pull docker.io/bitnami/minio-client:2022.11.7-debian-11-r0
docker tag docker.io/bitnami/minio-client:2022.11.7-debian-11-r0 myharbor.com/bigdata/minio-client:2022.11.7-debian-11-r0
docker push myharbor.com/bigdata/minio-client:2022.11.7-debian-11-r0
minio/values.yaml
image:
registry: myharbor.com
repository: bigdata/minio
tag: 2022.11.11-debian-11-r0
clientImage:
registry: myharbor.com
repository: bigdata/minio-client
tag: 2022.11.7-debian-11-r0
# `standalone` or `distributed`
mode: distributed
# 登录账号,密码
auth:
rootUser: admin
rootPassword: "admin12345"
statefulset:
## @param statefulset.replicaCount Number of pods per zone (only for MinIO® distributed mode). Should be even and `>= 4`
##
replicaCount: 4
service:
## @param service.type MinIO® service type
##
type: NodePort
nodePorts:
api: "31900"
console: "31901"
persistence:
enabled: true
storageClass: "local-minio-stroage"
size: 10Gi
local:
- name: minio-0
host: "local-168-182-110"
path: "/opt/bigdata/servers/minio/data/data1"
- name: minio-1
host: "local-168-182-111"
path: "/opt/bigdata/servers/minio/data/data1"
- name: minio-2
host: "local-168-182-112"
path: "/opt/bigdata/servers/minio/data/data1"
- name: minio-3
host: "local-168-182-110"
path: "/opt/bigdata/servers/minio/data/data2"
minio/templates/pv.yaml
{{- range .Values.persistence.local }}
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .name }}
labels:
name: {{ .name }}
spec:
storageClassName: {{ $.Values.persistence.storageClass }}
capacity:
storage: {{ $.Values.persistence.size }}
accessModes:
- ReadWriteOnce
local:
path: {{ .path }}
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- {{ .host }}
---
{{- end }}
ssh local-168-182-110 mkdir -p /opt/bigdata/servers/minio/data/data{1..2}
ssh local-168-182-111 mkdir -p /opt/bigdata/servers/minio/data/data{1..2}
ssh local-168-182-112 mkdir -p /opt/bigdata/servers/minio/data/data{1..2}
# --dry-run 模拟安装
# --debug 开启debug
# helm install --dry-run --debug minio ./minio -n minio --create-namespace
helm install --debug minio ./minio -n minio --create-namespace
NOTES
CHART NAME: minio
CHART VERSION: 11.10.16
APP VERSION: 2022.11.11
** 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.minio.svc.cluster.local
To get your credentials run:
export ROOT_USER=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-user}" | base64 -d)
export ROOT_PASSWORD=$(kubectl get secret --namespace minio 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 minio 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 myharbor.com/bigdata/minio-client:2022.11.7-debian-11-r0 -- admin info minio
To access the MinIO® web UI:
- Get the MinIO® URL:
export NODE_PORT=$(kubectl get --namespace minio -o jsonpath="{.spec.ports[0].nodePort}" services minio)
export NODE_IP=$(kubectl get nodes --namespace minio -o jsonpath="{.items[0].status.addresses[0].address}")
echo "MinIO® web URL: http://$NODE_IP:$NODE_PORT/minio"
查看
kubectl get pods,svc -n minio -owide
web登录:添加链接描述http://local-168-182-110:31901/
账号/密码:admin
/admin12345
创建桶并上传文件
mc客户端
# 查看notes
helm get notes minio -n minio
# 启动客户端
export ROOT_USER=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-user}" | base64 -d)
export ROOT_PASSWORD=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-password}" | base64 -d)
kubectl run --namespace minio 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 myharbor.com/bigdata/minio-client:2022.11.7-debian-11-r0 -- admin info minio
helm uninstall minio -n minio
ssh local-168-182-110 rm -fr /opt/bigdata/servers/minio/data/data{1..2}/*
ssh local-168-182-111 rm -fr /opt/bigdata/servers/minio/data/data{1..2}/*
ssh local-168-182-112 rm -fr /opt/bigdata/servers/minio/data/data{1..2}/*
Minio on k8s 讲解与实战操作就先到这里了,就疑问的小伙伴欢迎给我留言,后续会持续更【云原生+大数据】相关的文章,请小伙伴耐心等待~
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。