简体   繁体   English

pod 具有未绑定的直接 PersistentVolumeClaims 操作管理器

[英]pod has unbound immediate PersistentVolumeClaims ops manager

EDIT: SEE BELOW编辑:见下文

I am new trying to build a local cluster with 2 physical machines with kubeadm.我是新手,正在尝试使用 kubeadm 构建一个包含 2 台物理机的本地集群。 I am following this https://github.com/mongodb/mongodb-enterprise-kube.netes steps and everything is ok.我按照这个https://github.com/mongodb/mongodb-enterprise-kube.netes步骤,一切正常。 At first i am installing kube.netes operator, but when i tried to install ops manager i am geting: 0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims ops manager.起初我正在安装 kube.netes 操作员,但是当我尝试安装操作管理器时我得到:0/2 个节点可用:2 个 pod 具有未绑定的直接 PersistentVolumeClaims 操作管理器。 the yaml i used to install ops manager is:我用来安装 ops 管理器的 yaml 是:

  ---
    apiVersion: mongodb.com/v1
    kind: MongoDBOpsManager
    metadata:
    
      name: opsmanager1
    
    spec:
    
      replicas: 2
    
      version: 4.2.0
    
      adminCredentials: mongo-db-admin1 # Should match metadata.name
    
                                               # in the Kubernetes secret
    
                                               # for the admin user
    
      externalConnectivity:
    
        type: NodePort
    
    
    
      applicationDatabase:
    
        members: 3
    
        version: 4.4.0
    
        persistent: true
    
        podSpec:
       
           persistence:
    
             single: 
    
               storage: 1Gi

i can't figure out what the problem is.我不知道是什么问题。 I am at a testing phase, and my goal is to make a scaling mongo database.我正处于测试阶段,我的目标是制作一个可伸缩的 mongo 数据库。 Thanks in advance提前致谢

edit : i made a few changes.I created storage class like this:编辑:我做了一些更改。我像这样创建了存储 class:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
    
      name: localstorage
    
    provisioner: kubernetes.io/no-provisioner
    volumeBindingMode: Immediate
    reclaimPolicy: Delete
    allowVolumeExpansion: True
    
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: mongo-01
      labels:
        type: local
    spec:
      storageClassName: localstorage
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      hostPath:
        path: "/home/master/mongo01"
    
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: mongo-02
      labels:
        type: local
    spec:
      storageClassName: localstorage
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      hostPath:
        path: "/home/master/mongo02"

And now my yaml for ops manger is:现在我的运营经理 yaml 是:

apiVersion: mongodb.com/v1
kind: MongoDBOpsManager
metadata:
 name: ops-manager-localmode
spec:
 replicas: 2
 version: 4.2.12
 adminCredentials: mongo-db-admin1
 externalConnectivity:
    type: NodePort
 
 statefulSet:
   spec:
     # the Persistent Volume Claim will be created for each Ops Manager Pod
     volumeClaimTemplates:
       - metadata:
           name: mongodb-versions
         spec:
           storageClassName: localstorage
           accessModes: [ "ReadWriteOnce" ]
           resources:
             requests:
               storage: 2Gi
     template:
       spec:
         containers:
           - name: mongodb-ops-manager
             volumeMounts:
               - name: mongodb-versions
                 # this is the directory in each Pod where all MongoDB
                 # archives must be put
                 mountPath: /mongodb-ops-manager/mongodb-releases

 backup:
   enabled: false

 applicationDatabase:
   members: 3
   version: 4.4.0

   persistent: true

But i get a new error: Warning ProvisioningFailed 44s (x26 over 6m53s) persistentvolume-controller no volume plugin matched name: kube.netes.io/no-provisioner但我收到一个新错误: Warning ProvisioningFailed 44s (x26 over 6m53s) persistentvolume-controller no volume plugin matched name: kube.netes.io/no-provisioner

At a quick glance, it looks like you don't have any volume that can create a PVC on your cluster.快速浏览一下,您似乎没有任何可以在集群上创建 PVC 的卷。 seehttps://v1-15.docs.kube.netes.io/docs/concepts/storage/volumes/ Your app needs to create a persistant volume, but your cluster doesn't know how to do that.请参阅https://v1-15.docs.kube.netes.io/docs/concepts/storage/volumes/您的应用需要创建持久卷,但您的集群不知道如何执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM