【发布时间】:2018-08-03 06:34:25
【问题描述】:
我的集群中有两个节点和 2 个 Pod 在运行 (每个节点上 1 个 pod) 我的持久音量声明低于
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: blockchain-data
annotations: {
"volume.beta.kubernetes.io/storage-class": "blockchain-disk"
}
spec:
accessModes:
- ReadWriteOnce
storageClassName: ssd
resources:
requests:
storage: 500Gi
和mystorageclass
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: blockchain-disk
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd
我像这样将它安装在我的容器上
spec:
containers:
- image: gcr.io/indiesquare-dev/geth-node:v1.8.12
imagePullPolicy: IfNotPresent
name: geth-node
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: blockchain-data
mountPath: /root/.ethereum
volumes:
- name: blockchain-data
persistentVolumeClaim:
claimName: blockchain-data
我将副本设置为 2。开始部署时,第一个 pod 正确启动,磁盘正确安装。
但是,第二个 pod 卡在 containtercreating
如果我运行kubectl describe pods
Warning FailedAttachVolume 18m attachdetach-controller Multi-Attach error for volume "pvc-c56fbb79-954f-11e8-870b-4201ac100003" Volume is already exclusively attached to one node and can't be attached to another
我认为根据此消息,我正在尝试附加已附加到另一个节点的磁盘。
我想要做的是将两个持久卷分别附加到两个 pod。如果 Pod 向上扩展,那么每个 Pod 都应该附加不同的卷。 我该怎么做?
【问题讨论】:
标签: google-cloud-platform google-kubernetes-engine