Has anyone been able to deploy MongoDB Charts on Kubernetes (on-premise)

311 views
Skip to first unread message

Aaron Newsome

unread,
Dec 23, 2019, 9:46:35 PM12/23/19
to mongodb-user
I've searched around a bit for this but I haven't found a way to spin up MongoDB Charts on an on-premise Kubernetes Cluster. All of my Google searches point me to how to install a MongoDB database in a Kubernetes Cluster using a Helm chart, which is not at all what I'm trying to do.

I'm using the image: "quay.io/mongodb/charts"

After trying to deploy on Kubernetes, the pod log shows this:

 ✔ parsedArgs 

 ✔ installDir ('/mongodb-charts')

 ✔ log 

 ✔ salt 

 ✔ productNameAndVersion ({ productName: 'MongoDB Charts Frontend', version: '1.9.1' })

 ✔ gitHash ('1a46f17f')

 ✔ supportWidgetAndMetrics (undefined)

 ✔ tileServer (undefined)

 ✔ tileAttributionMessage (undefined)

 ✔ rawFeatureFlags (undefined)

 ✔ chartsMongoDBUri 

 ✔ stitchMigrationsLog ({ completedStitchMigrations: [] })

 ✔ featureFlags ({})

 ✖ tokens failure: ENOENT: no such file or directory, open '/mongodb-charts/volumes/keys/charts-tokens.json'

 ✖ encryptionKeyPath failure: ENOENT: no such file or directory, open '/mongodb-charts/volumes/keys/mongodb-charts.key'

 ✔ lastAppJson ({})

 ✔ stitchConfigTemplate 

 ✔ libMongoIsInPath (true)

 ✔ mongoDBReachable (true)


In fact, here the entire Yaml of my Kubernetes Deployment:

apiVersion: extensions/v1beta1

kind: Deployment

metadata:

  name: mongodb-charts

  namespace: mongodb

spec:

  replicas: 1

  selector:

    matchLabels:

      app: mongodb-charts

  template:

    metadata:

      labels:

        app: mongodb-charts

    spec:

      containers:

      - image: quay.io/mongodb/charts

        name: mongodb-charts

        env:

           - name: CHARTS_MONGODB_URI

             value: "mongodb://kmaster-01.swiftlab.local:32010/"

        ports:

        - containerPort: 80

        resources: {}

        volumeMounts:

      restartPolicy: Always


If I get a shell to the pod, I can see a few processes:

 PID TTY      STAT   TIME COMMAND

    1 ?        Ss     0:00 /bin/sh -c /mongodb-charts/bin/charts-cli $STARTUP_COMMAND

    6 ?        S      0:00 /bin/sh /mongodb-charts/bin/charts-cli startup

    7 ?        Sl     0:00 node --no-deprecation /mongodb-charts/bin/charts-cli.js star

   25 pts/0    Ss     0:00 /bin/bash

   30 pts/0    R+     0:00 ps ax


In the pod's shell if I run "curl http://localhost", I get connection refused. 


I've got an instance of MongoDB Charts running on a standalone Docker host. That works with no problems but I'm tryin to move my standalone Docker apps to Kubernetes and now I'm a bit stuck since I can't find any help on how to do this.


I think I've tracked it down to the issue being that /mongodb-charts/volumes/keys does not exist. If I manually copy the keys directory into the container, then it seems to startup after that.


What's the proper way to deploy this on Kubernetes? If someone could point me to a guide, I'd really appreciate it.



Thanks, Aaron

ARUNIMA CHAURASIA

unread,
Jan 9, 2020, 4:50:30 AM1/9/20
to mongodb-user
Hi Aaron

We are trying to do the same thing in our organization, We are also facing issues with the deployment in kubernetes, but our error pops up as Access denied in stitchConfigWritten step.
From our standalone on premise setup of charts in docker, we ended up contacting Tom from mongoDb charts, He has sent a deployment file which we are trying to use for the setup. Please find it attached , If you are successful in installation process, do let me know.

Thanks
Arunima
charts-kubernetes.yaml
Reply all
Reply to author
Forward
0 new messages