![](/img/trans.png)
[英]What Persistent Volume storage solutions I can use when I run my Kubernetes cluster on GCP?
[英]Persistent storage in kubernetes container
有问题,我无法将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
是相同项目,相同区域中的磁盘名称,并附加到claster的主节点上。 而且它已经格式化并挂载了。
谢谢!
github文档中有一个安装PD的示例: https : //github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/volumes.md#creating-a-pd
GCE中的PD只能连接到单个VM(以读/写模式),因此,如果磁盘已经连接到您的主服务器,则不可能将其也连接到调度了pod的节点上。 尝试从主服务器上卸下PD,然后安排Pod。
我已经扩展了PD测试,它似乎可以正常工作。 如果您仍然遇到问题,请在IRC上与我们联系,或对该github问题发表评论。
谢谢! --brendan
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.