![](/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.