kubernetes runtime_error ai_generated true

挂载卷 "pvc-xxx" 失败:rpc 错误:code = DeadlineExceeded desc = 上下文截止时间已超过

AttachVolume.Attach failed for volume "pvc-xxx" : rpc error: code = DeadlineExceeded desc = context deadline exceeded

ID: kubernetes/volume-attach-timeout-csi

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
1证据数
2023-06-15首次发现

版本兼容性

版本状态引入弃用备注
Kubernetes 1.24 active — — —
Kubernetes 1.27 active — — —
AWS EBS CSI Driver 1.12 active — — —
GCE PD CSI Driver 1.8 active — — —

根因分析

CSI 驱动程序在将持久卷挂载到节点时超时,通常是由于云提供商 API 限流或 CSI 控制器与存储后端之间的网络问题。

English

CSI driver timed out while attaching a persistent volume to a node, often due to cloud provider API throttling or network issues between the CSI controller and storage backend.

generic

官方文档

https://kubernetes.io/docs/concepts/storage/volumes/#csi

解决方案

  1. Check CSI driver logs for specific errors: `kubectl logs -n kube-system <csi-controller-pod> csi-provisioner` and look for throttling or backend errors.
  2. Increase the CSI driver's attach timeout by setting environment variable `ATTACH_TIMEOUT=5m` in the CSI controller deployment, then restart the pods.
  3. Verify cloud provider API quotas (e.g., AWS EC2 API call rate limits) and request a quota increase if needed: `aws ec2 describe-account-attributes`.

无效尝试

常见但无效的做法:

  1. 70% 失败

    Restarting the CSI controller pod without checking cloud provider quotas or API rate limits will not resolve the underlying throttling issue.

  2. 50% 失败

    Increasing CSI driver timeout without addressing storage backend latency only delays the failure.

  3. 60% 失败

    Deleting and recreating the PVC/PV pair may be blocked by finalizers and does not fix the attach timeout root cause.