Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform kubernetes容器中的持久存储_Google Cloud Platform_Kubernetes - Fatal编程技术网

Google cloud platform kubernetes容器中的持久存储

Google cloud platform kubernetes容器中的持久存储,google-cloud-platform,kubernetes,Google Cloud Platform,Kubernetes,出现问题,我无法将我的pod容器与持久存储链接 这是我的pod的配置,其中elastic是连接的磁盘的名称(与应该安装和格式化的区域相同),当我使用此配置启动pod时,我出现以下错误: 无法为pod elastic.etcd装载卷 我可以将我的容器链接到任何其他类型的卷,无论是emptyDir还是hostDir,都可以正常工作。但如果是已装入的磁盘,则不会。 我真的找不到关于persitsentDisk卷的好例子 id: elastic kind: Pod apiVersion: v1beta1

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

这是我的pod的配置,其中
elastic
是连接的磁盘的名称(与应该安装和格式化的区域相同),当我使用此配置启动pod时,我出现以下错误:

无法为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
是同一项目、同一区域中的磁盘的名称,并连接到claster的主节点。它也是格式化和装入的


谢谢

github文档中有一个安装PD的示例:


GCE中的PDs只能连接到单个VM(在读/写模式下),因此,如果磁盘已连接到主机,则无法将其连接到pod计划所在的节点。尝试将PD与主机分离,然后安排pod

第一次它工作了,但现在当我删除并再次启动同一个pod时,它冻结在挂起状态,我认为pod当前不应该作为存储服务工作(可能以后),现在最好创建公共vm实例来包含此类服务,对吗?这应该可以工作。删除pod可能没有从原始计算机上卸载磁盘。我将尝试重新编程,看看是否有错误。filedOh,您不应该将磁盘连接到主机。您应该将其未连接,pod将自动将其附加到正确的工作节点。我已经扩展了PD测试,并且它似乎工作正常。如果您继续遇到问题,请通过IRC与我们联系,或对github问题发表评论。谢谢