我正在尝试让 mongo-replicaset 图表正常工作。
kubelet 在部署 mongo-replicaset 图表时报此错误:
MountVolume.SetUp failed for volume "mongo-two": lstat /mongo/data: no such file or directory
在每个节点上, /mongo/data 文件夹都存在,让我发疯。注意:在节点上,lstat 命令不存在,但我怀疑 kubelet 容器会带上它。?
我有 3 个持久卷:
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongo-[one/two/three]
spec:
capacity:
storage: 40Gi
accessModes:
- ReadWriteOnce
storageClassName: local-storage
local:
path: /mongo/data
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- [one/two/three]
StatefulSet yaml:(mongo-replicaset helm chart 3.8.0)
...
volumeMounts:
- mountPath: /data/db
name: datadir
...
volumeClaimTemplates:
- metadata:
creationTimestamp: null
name: datadir
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-storage
resources:
requests:
storage: 40Gi
...
现有目录上仍然有“没有这样的目录”。有什么不正确的?如果需要,我可以提供额外的数据。
谢谢