Giter Club home page Giter Club logo

mongodb-operator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mongodb-operator's Issues

mongo/mongo.go:78:3: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields

Run command "make run" to start the operator run into issue that looks similar to this

// /home/sadath/go/bin/controller-gen rbac:roleName=mongodb-operator-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
// /home/sadath/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
// go fmt ./...
// go vet ./...
// # mongodb-operator/mongo
// mongo/mongo.go:77:3: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields
// mongo/mongo.go:77:35: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields
// 
// mongo/mongo.go:104:58: go.mongodb.org/mongo-driver/bson/primitive.E struct literal uses unkeyed fields
// make: *** [Makefile:86: vet] Error 1

Solution to fix this issue is to add Key and Value for running db command for user and role
for Example

change this

{"createUser", monitoringUser}, { "pwd",  params.Password}

To

{Key: "createUser", Value: monitoringUser}, {Key: "pwd", Value: params.Password}

arm64 support

Hi,

Is there any plan for suporting arm64 ?

Thanks

ERROR: child process failed, exited with 100

Error creating pod

+ pidfile=/tmp/mongod.pid
+ performinitdb=true
+ shouldPerformInitdb=true
+ arg_mongod=
+ '[' -n true ']'
+ dbPath=/data/db
+ for path in "$dbPath/WiredTiger" "$dbPath/journal" "$dbPath/local.0" "$dbPath/storage.bson"
+ '[' -e /data/db/WiredTiger ']'
+ for path in "$dbPath/WiredTiger" "$dbPath/journal" "$dbPath/local.0" "$dbPath/storage.bson"
+ '[' -e /data/db/journal ']'
+ for path in "$dbPath/WiredTiger" "$dbPath/journal" "$dbPath/local.0" "$dbPath/storage.bson"
+ '[' -e /data/db/local.0 ']'
+ for path in "$dbPath/WiredTiger" "$dbPath/journal" "$dbPath/local.0" "$dbPath/storage.bson"
+ '[' -e /data/db/storage.bson ']'
+ '[' -n true ']'
+ mongod --dbpath /data/db --pidfilepath /tmp/mongod.pid --logappend --logpath /dev/null --fork
about to fork child process, waiting until server is ready for connections.
forked process: 9
ERROR: child process failed, exited with 100
To see additional information in this output, start without the "--fork" option.

opstree mongodb operator out of date on operatorhub.io

Not sure if this is a here problem or a there problem but this operator on operatorhub.io is currently at rev 0.3.0 which is missing some key fixes that are available here. #61 being the one that brought me hither.

Anyways, not a huge deal and would probably work itself out if the 0.4.0 version mentioned in the commit for that issue was cut.

Thanks for the operator!

Volume mounts are read only

I created a cluster using this operator in EKS and for persistent storage used ebs csi drivers. The cluster creation failed as the /data/db folder was read only and lockfile couldn't be generated.

no replset config has been received

---
apiVersion: opstreelabs.in/v1alpha1
kind: MongoDBCluster
metadata:
  name: mongodb-demo
  namespace: mongodb-system
spec:
  clusterSize: 3
  kubernetesConfig:
    image: quay.io/opstree/mongo:v5.0.6
    imagePullPolicy: IfNotPresent
    resources:
      requests:
        cpu: 2
        memory: 1024Mi
      limits:
        cpu: 2
        memory: 4Gi
  storage:
    accessModes: ["ReadWriteOnce"]
    storageSize: 100Gi
    storageClass: nfs
  mongoDBSecurity:
    mongoDBAdminUser: admin
    secretRef:
      name: mongodb-cluster-secret
      key: demo-admin-password
  mongoDBMonitoring:
    enableExporter: true
    image: bitnami/mongodb-exporter:0.11.2-debian-10-r382
    imagePullPolicy: IfNotPresent
  mongoDBAdditionalConfig: mongo-demo-config # name of configmap

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mongo-demo-config
  namespace: mongodb-system
data:
  mongo.yaml: |
    net:
      bindIp: 0.0.0.0
      port: 27017

---
apiVersion: v1
kind: Secret
metadata:
  name: mongodb-cluster-secret
  namespace: mongodb-system
type: Opaque
stringData:
  demo-admin-password: 'abc123de2mo'
mongo -u $MONGO_ROOT_USERNAME -p $MONGO_ROOT_PASSWORD --eval "db.adminCommand( { replSetGetStatus: 1 } )"
> use admin
switched to db admin
> db.auth('admin','abc123de2mo')
1
> rs.status()
{
        "ok" : 0,
        "errmsg" : "no replset config has been received",
        "code" : 94,
        "codeName" : "NotYetInitialized"
}
>

but i got an error msg from operator like this

2022-07-04T07:49:17.930Z	ERROR	controller_mongo	Unable to create MongoDB cluster	{"Namespace": "mongodb-system", "Name": "mongodb-demo", "Resource Type": "MongoDB Cluster Setup", "error": "connection() error occured during connection handshake: auth error: unable to authenticate using mechanism \"SCRAM-SHA-256\": (AuthenticationFailed) Authentication failed."}

 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler

 	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311

 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem

 	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266

 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2

 	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

 2022-07-04T07:49:17.930Z	ERROR	controller.mongodbcluster	Reconciler error	{"reconciler group": "opstreelabs.in", "reconciler kind": "MongoDBCluster", "name": "mongodb-demo", "namespace": "mongodb-system", "error": "connection() error occured during connection handshake: auth error: unable to authenticate using mechanism \"SCRAM-SHA-256\": (AuthenticationFailed) Authentication failed."}

 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2

 	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

Standalone is missing a service

I deployed the stand alone instance and the container runs well but it does not have a service definition where other pods can connect to it.

I can work on this in a PR unless this is the way the chart is intended to be.

failed to populate resolver cache

I've installed the operator in OpenShift using OperatorHub

Screenshot 2024-02-28 at 12 57 14

I've been able to create a standalone db - but I don't think it works properly - OpenShift reports CoreDNS is returning SERVFAIL for X% of requests. and when I look at the logs they are littered with:

[INFO] 10.130.0.28:32931 - 10162 "AAAA IN my-mongodb-standalone. udp 43 false 512" SERVFAIL qr,aa,rd,ra 43 0.000048726s
[INFO] 10.130.0.28:58916 - 30165 "A IN my-mongodb-standalone. udp 43 false 512" SERVFAIL qr,aa,rd,ra 43 0.00003007s

I started looking for a service with that name but found none:

$ oc get pods,statefulset,svc -n my-project 
NAME                                    READY   STATUS    RESTARTS       AGE
pod/my-mongodb-standalone-0         1/1     Running   0              153m
pod/mongodb-operator-655cd8cdf4-dhj7q   1/1     Running   1 (140m ago)   146m

NAME                                         READY   AGE
statefulset.apps/my-mongodb-standalone   1/1     4h9m

Digging a bit further I found the following - which seem related:

$ oc get sub -n my-project mongodb-operator -o jsonpath='{.items[*].status.conditions[1:3]}{\n}'
{"status":"False","type":"BundleUnpacking"} {"message":"failed to populate resolver cache from source redhat-operators/openshift-marketplace: error encountered while listing bundles: rpc error: code = DeadlineExceeded desc = context deadline exceeded","reason":"ErrorPreventedResolution","status":"True","type":"ResolutionFailed"}

Please help me understand what's wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.