目录
- Q: 之前使用正常,突然使用空间为0B,上传文件也是0B(部署在k8s中)
- Q: 无法上传大文件
- 参考yaml
Q: 之前使用正常,突然使用空间为0B,上传文件也是0B(部署在k8s中)
A:
1、检查pod状态
kubectl get pods
2、如果状态正常,则查看日志
kubectl logs <minio-pod-name>
提示: disk quota exceeded
表示存储卷可能已经达到了其分配的存储限制,无法再写入新的数据
3、解决:
增加存储容量、检查和清理旧数据、优化数据存储策略
4、优化:
设置磁盘使用率的监控和告警,以便在接近存储上限之前收到通知,及时采取行动。
扩容:
kubectl edit pvc <pvc-name> //编辑想要扩展的PVC,找到spec下的resources.requests.storage字段,并将其值更新为新容量大小
kubectl get pvc <pvc-name> //检查PVC的状态,确保其已经成功扩展
Q: 无法上传大文件
A: 配置允许客户端上传的最大请求体大小
---
# Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:...annotations:nginx.ingress.kubernetes.io/proxy-body-size: 2048m
参考yaml
apiVersion: v1
kind: ConfigMap
metadata:name: minio-configmapnamespace: company-product
data:MINIO_ROOT_USER: 'admin'MINIO_ROOT_PASSWORD: 'admin@localhost'---
apiVersion: apps/v1
kind: StatefulSet
metadata:name: minionamespace: company-product
spec:replicas: 1selector:matchLabels:app: minioserviceName: minio-servicetemplate:metadata:labels:app: miniospec:hostname: minio-0containers:- args:- server- /data- --console-address- :9090name: minioimage: minio/minio:RELEASE.2021-10-27T16-29-42ZimagePullPolicy: IfNotPresentports:- name: minio-apicontainerPort: 9000protocol: TCP- name: minio-uicontainerPort: 9090protocol: TCPenvFrom:- configMapRef:name: minio-configmapvolumeMounts:- name: minio-datamountPath: /dataimagePullSecrets:- name: harborvolumes:- name: minio-datapersistentVolumeClaim:claimName: minio-pvc-5g---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: minio-pvc-5gnamespace: company-product
spec:accessModes:- ReadWriteOnceresources:requests:storage: 5GistorageClassName: alibabacloud-cnfs-nas # 根据你的存储类进行调整---
apiVersion: v1
kind: Service
metadata:name: minio-servicenamespace: company-product
spec:ports:- name: minio-apiport: 9000targetPort: 9000protocol: TCP- name: minio-uiport: 9090targetPort: 9090protocol: TCPselector:app: minio # 与 StatefulSet 的 label 匹配type: ClusterIP# 根据部署形式来选择是否需要以下配置
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:name: minio-ingressnamespace: company-product
spec:rules:- host: minio.cn.company.com # 与实际的 域名匹配http:paths:- path: /pathType: Prefixbackend:service:name: minio-service # 与实际的 Service 名称匹配port:number: 9000 # 与实际的 Service 端口匹配tls:- hosts:- minio.cn.company.com # 与实际的 域名匹配 secretName: cn-company-com-tls # 与实际的 secret 匹配