如何在Kubernetes里使用Minio存储
286 字
1 分钟
如何在Kubernetes里使用Minio存储
1 部署驱动
minio 部署参考: [[使用minion当blog图床]]
kubectl apply -f . -n miniokubectl get pod -n minioNAME READY STATUS RESTARTS AGEcsi-attacher-s3-0 1/1 Running 0 16hcsi-provisioner-s3-0 2/2 Running 0 16hcsi-s3-2dfnn 2/2 Running 0 16hcsi-s3-nn5pp 2/2 Running 0 16hcsi-s3-q9pln 2/2 Running 0 16h2 Storageclass
创建 Secret
cat secret.yamlapiVersion: v1kind: Secretmetadata: namespace: minio name: csi-s3-secretstringData: accessKeyID: "admin" # minio用户名,明文就可以 secretAccessKey: "xxxxxxxxx" # minio密码,明文就可以 endpoint: http://10.1.1.1:9000 # minio api地址kubectl apply -f secret.yaml -n minio创建 Storageclass
cat sc.yamlkind: StorageClassapiVersion: storage.k8s.io/v1metadata: name: csi-s3provisioner: ch.ctrox.csi.s3-driverparameters: mounter: s3fs csi.storage.k8s.io/provisioner-secret-name: csi-s3-secret csi.storage.k8s.io/provisioner-secret-namespace: minio csi.storage.k8s.io/controller-publish-secret-name: csi-s3-secret csi.storage.k8s.io/controller-publish-secret-namespace: minio csi.storage.k8s.io/node-stage-secret-name: csi-s3-secret csi.storage.k8s.io/node-stage-secret-namespace: minio csi.storage.k8s.io/node-publish-secret-name: csi-s3-secret csi.storage.k8s.io/node-publish-secret-namespace: minioreclaimPolicy: DeletevolumeBindingMode: Immediatekubectl apply -f sc.yaml -n minio3 验证
3.1 创建 pvc
cat pvc.yamlapiVersion: v1kind: PersistentVolumeClaimmetadata: name: csi-s3-pvc namespace: miniospec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: csi-s3kubectl apply -f pvc.yaml -n minio查看
kubectl get pvc -n minioNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGEcsi-s3-pvc Bound pvc-df3ed2a7-6086-450d-8c17-ff40ab9a1fb4 5Gi RWO csi-s3 16h3.2 创建 pod
cat pod.yamlkind: PodapiVersion: v1metadata: name: minio-pod namespace: miniospec: containers: - name: minio-pod image: nginx volumeMounts: - name: pvc mountPath: "/mnt" volumes: - name: pvc persistentVolumeClaim: claimName: csi-s3-pvc readOnly: falsekubectl apply -f pod.yaml -n minio查看
kubectl get pod -n minioNAME READY STATUS RESTARTS AGEminio-pod 1/1 Running 0 16h文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
如何在Kubernetes里使用Minio存储
https://ccops.cc/posts/a03ee434/ 相关文章 智能推荐
1
如何在Kubernetes里使用本地存储
🐳云原生 如何在Kubernetes里使用节点磁盘存储数据
2
如何在Kubernetes里使用SMB存储
🐳云原生 如何在Kubernetes里使用smb作为存储后端
3
如何在Kubernetes里使用NFS存储
🐳云原生 如何在Kubernetes里使用NFS作为存储后端
4
如何在Kubernetes里使用Glusterfs存储
🐳云原生 如何在Kubernetes里使用Glusterfs作为存储后端
5
如何在Kubernetes里使用cephrdb作为存储
🐳云原生 如何在Kubernetes里使用cephrbd作为存储后端
随机文章 随机推荐