1

有问题,我无法将我的 pod 容器与持久存储链接

这是我的 pod 的配置,elastic附加磁盘的名称在哪里(相同的区域,按应安装和格式化),当我使用此配置启动 pod 时出现此错误:

Unable to mount volumes for pod elastic.etcd

我可以将我的容器链接到任何其他类型的卷,emptyDir或者hostDir都可以正常工作。但在挂载磁盘的情况下没有。我真的找不到关于persitsentDisk卷的好例子。

id: elastic
kind: Pod
apiVersion: v1beta1
desiredState:
  manifest:
    version: v1beta1
    id: elastic
    volumes:
      - name: elastic-persistent-storage
        source:
          persistentDisk:
            pdName : elastic
            fsType : ext4
    containers:
      - name: elastic
        image: dockerfile/elasticsearch
        cpu: 1000
        volumeMounts:
          - name: elastic-persistent-storage
            mountPath: /data
        ports:
          - name: elastic
            containerPort: 9200
            hostPort: 9200
labels:
  name: elastic
  role: storage

elastic是同一个项目,同一个区域,附加到集群主节点的磁盘的名称。它也被格式化和安装。

谢谢!

4

1 回答 1

2

github文档中有一个挂载PD的例子:https ://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/volumes.md#creating-a-pd

GCE 中的 PD 只能附加到单个 VM(在读/写模式下),因此如果磁盘已附加到您的主服务器,则无法将其也附加到您的 pod 调度所在的节点。尝试将 PD 与 master 分离,然后调度 pod。

于 2014-12-04T23:53:33.273 回答