我有一个未初始化的损坏的mongo容器,我怀疑可以通过清洁所有存储设备来对其进行修复。因此,我删除了正在使用的持久性存储,但是现在,我创建的每个新存储都处于“丢失”阶段,而在mongo的POD创建中找不到该新存储。
这是我用来创建PV的.yml文件:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
volume.beta.kubernetes.io/storage-class: standard
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/gce-pd
creationTimestamp: "2018-08-11T09:19:29Z"
finalizers:
- kubernetes.io/pvc-protection
labels:
environment: test
role: mongo
name: mongo-persistent-storage-mongo-db-0
namespace: default
resourceVersion: "122299922"
selfLink: /api/v1/namespaces/default/persistentvolumeclaims/mongo-persistent-storage-mongo-db-0
uid: a68de459-9d47-11e8-84b1-42010a800138
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
volumeMode: Filesystem
volumeName: pvc-a68de459-9d47-11e8-84b1-42010a800135
status:
accessModes:
- ReadWriteOnce
capacity:
storage: 20Gi
phase: Bound
这是我重新启动mongo POD时遇到的错误:
error while running "VolumeBinding" filter plugin for pod "mongo-db-0": could not find v1.PersistentVolume "pvc-a68de459-9d47-11e8-84b1-42010a800135"
我已经尝试过更改PV名称和ID,但是没有用。
答案 0 :(得分:2)
这是我用来创建PV的.yml文件
似乎您使用了绑定到特定PV的清单。
如果删除唯一字段并让集群为您动态配置新的PV,该怎么办?
示例:
func cgImage(from ciImage: CIImage) -> CGImage? {
let context = CIContext(options: [CIContextOption.workingColorSpace: kCFNull!])
return context.createCGImage(ciImage, from: ciImage.extent, format: .RGBA8, colorSpace: CGColorSpace.init(name: CGColorSpace.sRGB)!)
}