容器磁盘读写限速 本节介绍 容器磁盘读写限速的用户指南。 通过容器磁盘读写限速,可以帮助用户为不同应用配置磁盘带宽与 IOPS 限制,实现资源隔离与性能保障。 适用场景 需要防止单一容器占用过多磁盘带宽或 IOPS,影响其他业务。 希望为关键业务或普通业务设置不同的磁盘性能等级。 功能说明 支持通过 Pod 注解,分别限制容器的磁盘读写带宽与 IOPS: 注解 含义 koordinator.sh/blkioQOS Pod 磁盘限速 JSON 注解 注意 通过 koordinator.sh/blkioQOS 注解,以 JSON 格式配置具体设备的读写带宽/IOPS,单位为字节/秒。需根据实际设备名和需求填写。 配置方法 在 Pod/Deployment YAML 的 metadata.annotations 字段中添加 koordinator.sh/blkioQOS 注解。例如: plaintext apiVersion: apps/v1kind: Deploymentmetadata: name: fiotest namespace: demospec: replicas: 1 template: metadata: labels: app: fiotest annotations: koordinator.sh/blkioQOS: { "blocks": [ { "name": "/dev/vda", "type": "device", "ioCfg": { "readBPS": 10485760, "writeBPS": 10485760 } } ] } spec: containers: name: fio image: fio:latest command: ["sleep", "9999999"] volumeMounts: name: testvolume mountPath: /test volumes: name: testvolume hostPath: path: /var/lib/fiotest type: DirectoryOrCreate