0
votes

I'm following this https://github.com/mongodb/mongodb-enterprise-kubernetes and https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator/ to deploy mongodb inside a Kubernetes cluster on DigitalOcean.

So far everything worked except the last step. Deploying mongodb. I'm trying to do like suggested in the documentation:

---
apiVersion: mongodb.com/v1
kind: MongoDbReplicaSet
metadata:
  name: mongodb-rs
  namespace: mongodb
spec:
  members: 3
  version: 4.0.4

  persistent: true

  project: project-0
  credentials: mongodb-do-ops

It doesn't work. The resource of type MongoDbReplicaSet is created, but no pods and services are deployed like written in docs.

kubectl --kubeconfig="iniside-k8s-test-kubeconfig.yaml" describe MongoDbReplicaSet mongodb-rs -n mongodb

Name:         mongodb-rs
Namespace:    mongodb
Labels:       <none>
Annotations:  <none>
API Version:  mongodb.com/v1
Kind:         MongoDbReplicaSet
Metadata:
  Creation Timestamp:  2018-11-21T21:35:30Z
  Generation:          1
  Resource Version:    2948350
  Self Link:           /apis/mongodb.com/v1/namespaces/mongodb/mongodbreplicasets/mongodb-rs
  UID:                 5e83c7b0-edd5-11e8-88f5-be6ffc4e4dde
Spec:
  Credentials:  mongodb-do-ops
  Members:      3
  Persistent:   true
  Project:      project-0
  Version:      4.0.4
Events:         <none>
1
Any output for kubectl describe MongoDbReplicaSet? - Rico
hey, added output to question. - Łukasz Baran
no pods when you do a kubectl -n mongodb get pods? - Rico
Would you mind please reading the tag excerpt. before posting. "Questions should pertain to the scripting part. Questions about configuring servers should be asked on serverfault.com or superuser.com". This appears to be about adding configuration for server instances - Neil Lunn
Only operator pod, but pods with mongodb - Łukasz Baran

1 Answers

1
votes

I got it working. As It stands in documentation here: https://docs.opsmanager.mongodb.com/current/tutorial/install-k8s-operator/

data.projectName

Is not optional. After looking at operator logs, operator cloudn't create replica set deployment because projectName was missing in ConfigMap.