将AWS EBS卷安装到Kubernetes的pod时出现“special device nount found”错误

时间:2016-10-27 22:43:39

标签: amazon-web-services kubernetes

我在尝试将EBS卷安装到Kubernetes的pod时遇到“发现特殊设备nount”错误。 这是pod的yaml文件:

apiVersion: v1
kind: Pod
metadata:
  name: test-ebs
spec:
  containers:
  - image: gcr.io/google_containers/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-ebs
      name: test-volume
  volumes:
  - name: test-volume
    # This AWS EBS volume must already exist.
    awsElasticBlockStore:
      volumeID: aws://us-west-2a/vol-xxxxxxxx
      fsType: ext4

运行pod后,pod状态停留在“ContainerCreating”。 “kubectl describe pod”输出表明存在“找不到设备”错误:

SetUp failed for volume "kubernetes.io/aws-ebs/8e830149-9c95-11e6-b969-0691ac4fce05-test-volume" (spec.Name: "test-volume") pod "8e830149-9c95-11e6-b969-0691ac4fce05" (UID: "8e830149-9c95-11e6-b969-0691ac4fce05") with: mount failed: exit status 32 Mounting arguments: /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-west-2a/vol-xxxxxxxx /var/lib/kubelet/pods/8e830149-9c95-11e6-b969-0691ac4fce05/volumes/kubernetes.io~aws-ebs/test-volume  [bind]
Output: mount: special device /var/lib/kubelet/plugins/kubernetes.io/aws-ebs/mounts/aws/us-west-2a/vol-xxxxxxxx does not exist

任何人都知道这是怎么回事?提前谢谢。

1 个答案:

答案 0 :(得分:0)

你的volumeID应该只是" vol-xxxxxxxx"不是" aws:// us-west-2a / vol-xxxxxxxx"。 Kubernetes根据集群云提供商设置计算出该区域。