Giter Club home page Giter Club logo

Comments (8)

fabianlindfors avatar fabianlindfors commented on July 17, 2024

Hi, James!

I haven't seen the PersistentVolumeClaims error before. What version of Kubernetes are you using and what does your environment look like?

Regarding the second error, we have a fix for this which we'll release later today. I can ping you once it has been published.

To connect to the database, we recommend using the URI available from your MongoDB resource. You can get the URI by running kubectl describe mdb/example-mongodb.

from mongodb-kubernetes-operator.

jameszhengruiqing avatar jameszhengruiqing commented on July 17, 2024

Hi Fabian,

Thanks for the quick reply. I'm using Windows docker desktop to run kubernetes (V1.16.5) with visual studio code cli.

PS C:\demo> kubectl describe mdb/example-mongodb
Name: example-mongodb
Namespace: default
Labels:
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"mongodb.com/v1","kind":"MongoDB","metadata":{"annotations":{},"name":"example-mongodb","namespace":"default"},"spec":{"memb...
API Version: mongodb.com/v1
Kind: MongoDB
Metadata:
Creation Timestamp: 2020-07-15T09:37:34Z
Generation: 1
Resource Version: 1956
Self Link: /apis/mongodb.com/v1/namespaces/default/mongodb/example-mongodb
UID: 0824f544-509e-47a5-901f-b9348284f172
Spec:
Members: 3
Type: ReplicaSet
Version: 4.2.6
Events:

The only link I can think of is Self Link. Doesn't seem to work.

I use the following code to connect to mongodb:

const client = new MongoClient(url);
client.connect();

Thanks and regards,
James Zheng

from mongodb-kubernetes-operator.

fabianlindfors avatar fabianlindfors commented on July 17, 2024

We've now released version 0.0.8 of the operator which should fix the issue you've been experiencing. Please pull the repository and try installing the operator again.

Regarding the URI, I think this could be related to the other issue. Could you try updating and get back to me?

from mongodb-kubernetes-operator.

jameszhengruiqing avatar jameszhengruiqing commented on July 17, 2024

Hi Fabian, @fabianlindfors

I got failed FailedScheduling error. Do you know where to add the PersistentVolumeClaims? Is this critical error?

Warning FailedScheduling 106s (x2 over 106s) default-scheduler pod has unbound immediate PersistentVolumeClaims Normal Scheduled 104s default-scheduler Successfully assigned default/example-mongodb-0 to docker-desktop Normal Pulling 103s kubelet, docker-desktop Pulling image "quay.io/mongodb/mongodb-kubernetes-operator-pre-stop-hook:1.0.1" Normal Pulled 100s kubelet, docker-desktop Successfully pulled image "quay.io/mongodb/mongodb-kubernetes-operator-pre-stop-hook:1.0.1" Normal Created 100s kubelet, docker-desktop Created container mongod-prehook Normal Started 100s kubelet, docker-desktop Started container mongod-prehook Normal Pulling 99s kubelet, docker-desktop Pulling image "quay.io/mongodb/mongodb-agent:10.15.1.6468-1" Normal Created 96s kubelet, docker-desktop Created container mongodb-agent Normal Pulled 96s kubelet, docker-desktop Successfully pulled image "quay.io/mongodb/mongodb-agent:10.15.1.6468-1" Normal Started 95s kubelet, docker-desktop Started container mongodb-agent Normal Pulling 95s kubelet, docker-desktop Pulling image "mongo:4.2.7" Normal Pulled 84s kubelet, docker-desktop Successfully pulled image "mongo:4.2.7" Normal Created 84s kubelet, docker-desktop Created container mongod Normal Started 84s kubelet, docker-desktop Started container mongod Warning Unhealthy 75s kubelet, docker-desktop Readiness probe failed:

I tried to use connecting string based on the recommendation from @StMarian https://github.com/mongodb/mongodb-kubernetes-operator/issues/108

mongodb://example-mongodb-0.example-mongodb-svc.mongodb.svc.cluster.local:27017,example-mongodb-1.example-mongodb-svc.mongodb.svc.cluster.local:27017/?replicaSet=example-mongodb

Having the following error:

(node:1) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [example-mongodb-1.example-mongodb-svc.mongodb.svc.cluster.local:27017] on first connect [Error: getaddrinfo ENOTFOUND example-mongodb-1.example-mongodb-svc.mongodb.svc.cluster.local

Thanks and regards,
James Zheng

from mongodb-kubernetes-operator.

fabianlindfors avatar fabianlindfors commented on July 17, 2024

The PersistentVolumeClaims error seems to indicate that Kubernetes couldn't create a corresponding Persistent Volume for the claim that is created by the operator. I'm not too familiar with Docker on Windows but it's possible that it can't create persistent volumes dynamically. One option is to manually set up Persistent Volumes which should then be automatically bound for the claims.

I think it's worth testing in your environment if it's possible to set up a pod with a PersistentVolumeClaim: https://kubernetes.io/docs/concepts/storage/persistent-volumes/.

Regarding the other issue with the URI, I'm guessing that the cluster is not running if the persistent volumes couldn't be created. Once that is fixed your cluster should work.

from mongodb-kubernetes-operator.

theburi avatar theburi commented on July 17, 2024

This issue is labeled as stale because it has been open for more than 30 days with no activity. Remove stale label or comment or this will be closed in a few days.

from mongodb-kubernetes-operator.

github-actions avatar github-actions commented on July 17, 2024

This issue is being marked stale because it has been open for 60 days with no activity. Please comment if this issue is still affecting you. If there is no change, this issue will be closed in 30 days.

from mongodb-kubernetes-operator.

github-actions avatar github-actions commented on July 17, 2024

This issue was closed because it became stale and did not receive further updates. If the issue is still affecting you, please re-open it, or file a fresh Issue with updated information.

from mongodb-kubernetes-operator.

Related Issues (20)

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.