我正在尝试在Kubernetes上配置MongoDB ops manager,我有一个基于CEPH的动态配置的PersistentVolumeClaim并成功配置了它,我正在尝试做的是在MongoDB OpsManager YAML文件中定义卷装载和卷,我尝试了不同的事情,但无法定义它们
这是我的MongoDB OpsManager yaml文件:
apiVersion: mongodb.com/v1
kind: MongoDBOpsManager
metadata:
name: ops-manager
namespace: mongodb
# podSpec:
# podTemplate:
# spec:
# containers:
# - name: mongodb-enterprise-database
# volumeMounts:
# - name: mongo-persistent-storage
# mountPath: /data/db
# volumes:
# - name: mongo-persistent-storage
# persistentVolumeClaim:
# claimName: mongo-pvc
spec:
# the version of Ops Manager distro to use
version: 4.2.4
containers:
- name: mongodb-ops-manager
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
volumes:
- name: mongo-persistent-storage
persistentVolumeClaim:
claimName: mongo-pvc
# the name of the secret containing admin user credentials.
adminCredentials: ops-manager-admin-secret
externalConnectivity:
type: NodePort
# the Replica Set backing Ops Manager.
# appDB has the SCRAM-SHA authentication mode always enabled
applicationDatabase:
members: 3
statefulSet:
spec:
# volumeClaimTemplates:letsChangeTheWorld1
template:
spec:
containers:
- name: mongodb-ops-manager
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
volumes:
- name: mongo-persistent-storage
persistentVolumeClaim:
claimName: mongo-pvc
我不知道我应该把卷挂载和卷定义放在哪里
我成功创建了操作管理器om,但当我检查创建的pod时,我发现了这个错误
运行";VolumeBinding";pod的过滤器插件";ops-manager-db-0":pod已解除立即PersistentVolumeClaims 的绑定
spec:
containers:
- image:
....
volumeMounts:
.....
- image:
....
volumeMounts:
......
volumes:
- name:
Volumes标签应与容器平行。所有容器的体积都是全局定义的,装载量是针对容器的
示例:https://kubernetes.io/docs/concepts/storage/volumes/
使用此检查一次