cvallance / mongo-k8s-sidecar

Kubernetes sidecar for Mongo
MIT License
440 stars 298 forks source link

Replication has not yet been configured #99

Open meirhazonAnyVision opened 5 years ago

meirhazonAnyVision commented 5 years ago

Hello,

I am getting the following error, 2019-04-04T07:58:49.234+0000 I CONTROL [initandlisten] options: { replication: { replSet: "rs0" }, storage: { mmapv1: { preallocDataFiles: false, smallFiles: true } } } 2019-04-04T07:58:50.435+0000 I REPL [initandlisten] Did not find local replica set configuration document at startup; NoMatchingDocument: Did not find replica set configuration document in local.system.replset

I am using mongo:latest cvallance/mongo-k8s-sidecar:latest docker 18.09.3 kubelet kubelet/kubernetes-xenial 1.14.0-00 on top of Ubuntu 18.4 LTS

I am using local storage as storage at this time

The statefulset is created correctly, oot@ceph-2-1:~/mongo/mongo-k8s-sidecar/example/StatefulSet# kubectl get nodes NAME STATUS ROLES AGE VERSION ceph-2-1 Ready master 22h v1.13.4 ceph-2-2 Ready 21h v1.13.4 ceph-2-3 Ready 21h v1.13.4 root@ceph-2-1:~/mongo/mongo-k8s-sidecar/example/StatefulSet# kubectl get pods NAME READY STATUS RESTARTS AGE mongo-0 2/2 Running 0 15m mongo-1 2/2 Running 0 15m mongo-2 2/2 Running 0 15m root@ceph-2-1:~/mongo/mongo-k8s-sidecar/example/StatefulSet#

I have used the default examples that you provide and added fabric8-rbac.yaml,

apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: fabric8-rbac subjects:

Thanks so much, Meir

yaoice commented 5 years ago

I have the same issue

smyth64 commented 5 years ago

me too

ChangJoo-Park commented 5 years ago

@meirhazonAnyVision @yaoice @smyth64

If yaml has not MONGO_PORT env, must add in your yaml. https://github.com/cvallance/mongo-k8s-sidecar/blob/master/src/lib/config.js#L79 is not set 27017 by default.