Creating MongoDB resource on K8s doesn't work

I’ve just installed the Kubernetes Enterprise Operator (latest) and Ops Manager (4.4.4) on my kubernetes cluster following the guide https://www.mongodb.com/blog/post/running-mongodb-ops-manager-in-kubernetes.

I’ve created my organization, project, API key. I have a single yaml file with the configmaps/secret/resource all defined. When I apply it nothing happens. The mongodb never shows an updated state and the description shows no events.

Below is my yaml.

    ---
    apiVersion: v1
    kind: Secret
    metadata:
      name: mongodb-conn-info
      namespace: mongodb-test
    type: Opaque
    stringData:
      password: "MyPassword!"
      url: "mongodb://admin:MyPassword!@mongodb"
    ---
    apiVersion: v1
    kind: Secret
    metadata:
      name: mongodb-ops-mgr-key
      namespace: mongodb-test
    type: Opaque
    stringData:
      user: "YWVWNBJB"
      publicApiKey: "ed93e78d-c6ab-4f8f-b08b-4b8347652710"
    ---
    kind: ConfigMap
    apiVersion: v1
    metadata:
      name: mongodb-ops-mgr-project
      namespace: mongodb-test
    data:
      baseUrl: "http://ops-manager-svc.mongodb.svc.cluster.local:8080"
      projectId: 5fd41ac23879d749eee766f3
      orgId: 5fd2f83804191904d6e1d1c1
    ---
    apiVersion: mongodb.com/v1
    kind: MongoDB
    metadata:
      name: mongodb
      namespace: mongodb-test
    spec:
      shardCount: 2
      mongodsPerShardCount: 3
      mongosCount: 2
      configServerCount: 3
      version: 4.2.3
      project: mongodb-ops-mgr-project
      credentials: mongodb-ops-mgr-key
      type: ShardedCluster
      persistent: true
      podSpec:
        persistence:
          single:
            storage: 30Gi
            storageClass: px-db-xfs
    ---
    apiVersion: mongodb.com/v1
    kind: MongoDBUser
    metadata:
      name: mongodb-admin-user
      namespace: mongodb-test
    spec:
      passwordSecretKeyRef:
        name: mongodb-conn-info
        key: password
      username: "admin"
      db: "admin"
      mongodbResourceRef:
        name: mongodb
      roles:
        - db: "admin"
          name: "clusterAdmin"
        - db: "admin"
          name: "userAdminAnyDatabase"
        - db: "admin"
          name: "readWrite"
        - db: "admin"
          name: "userAdminAnyDatabase"

I had same issue… this blof is out dated ;/

I did this all last week. Everything worked for me. https://github.com/alberttwong/mongodb-kubernetes-enterprise-operator-quickstart. I’d also add that since you need to have a EA subscription to use the k8s operator, I’d submit a ticket and get a SLA on your support ticket.

1 Like

I did the same. with values representing our resources , and it worked fine

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.