helm / charts

⚠️(OBSOLETE) Curated applications for Kubernetes
Apache License 2.0
15.49k stars 16.8k forks source link

Is there a helm chart with support for MongoDB sharded cluster? #11672

Closed arunjp closed 5 years ago

arunjp commented 5 years ago

Is this a request for help?: Yes


Is this a BUG REPORT or FEATURE REQUEST? (choose one): Feature Request We wanted to create MongoDB sharded cluster for Kubernetes for Azure cloud platform. Wanted to know if there's a helm chart that supports MongoDB sharded cluster.

Version of Helm and Kubernetes: Helm - 2.11.0 Kubernetes - 1.12.5

steven-sheehy commented 5 years ago

Nope, you're welcome to help add it to either stable/mongodb or stable/mongodb-replicaset charts.

arunjp commented 5 years ago

Hi @steven-sheehy, Thanks for responding.

steven-sheehy commented 5 years ago

@arunjp This repository might be a good starting point:

https://github.com/pkdone/gke-mongodb-shards-demo

arunjp commented 5 years ago

@steven-sheehy thanks so much. Will look into it.

oldluke92 commented 5 years ago

@arunjp I have created one for internal use at work. At the moment, it only deploys a minimal setup using 3 mongos routers and 2 replicasets (as subcharts) for configdb and shard0. It also has authentication enabled. If you are interested, I can investigate if my employer agrees to publish the source code.

oldluke92 commented 5 years ago

@arunjp I now uploaded it to my fork of the charts repo. I currently really don't have the time to take care of fullfilling the technical contribution Guidelines - I will get back to that and create a PR when I have some spare time. You can have a look here: mongodb-sharded at oldluke92's repo

@steven-sheehy I am asking myself if this should be added to the stable/mongodb-replicaset chart or be an own one, since it is using at least 2 replica-sets ...

steven-sheehy commented 5 years ago

I think it could be integrated into mongodb-replicaset if it was cleaned up. Some issues I see that would have to be addressed:

  1. Use of job on install. Be better to be initContainer or lifecycle hook and add check if already ran
  2. Hardcodes DNS names
  3. Replica count doesn't support > 3 replicas
  4. Since no config servers, where would sharding data get stored?

cc @unguiculus

oldluke92 commented 5 years ago

Oh well - some explanation:

  1. I did not really look into initContainers yet, that might indeed be better - but if I make the job a lifecycle-hook (like post-install), the 'helm install' will halt further script execution until that hook was successfully executed - which can take some minutes. As we are running ansible scripts to deploy our clusters, this is not acceptable for us ..
  2. Yeah - I know. Wnated to fix that somewhen.
  3. That wasn't considered because we didn't need it. We'd rather add another shard than scaling up a shard-replicaset
  4. One of the replica sets is configured as config servers.
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

Adriien-M commented 5 years ago

There is the MongoDB Enterprise Kubernetes Operator but sadly, it is not free... :/ This feature requires big changes but it could be really useful!

luishdez commented 5 years ago

Check as well https://github.com/styxlab/kubernetes-mongodb-shard it's a config generator.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue is being automatically closed due to inactivity.

biddwan09 commented 5 years ago

HI @steven-sheehy I have implemented mongodb sharding in kubernetes recently . Can I create a helm chart and create a pull request for it ?

steven-sheehy commented 5 years ago

I don't think the maintainers of helm/charts would accept a third mongodb chart. You should add it to one of the existing mongodb charts as an optional feature.

oldluke92 commented 4 years ago

hi @biddwan09 I took a step back, because the requirement to implement it in one of the other 2 charts makes this suuper ugly to do - because a sharded db would use one of the other charts 2 - n times to deploy replicasets for configdb and shard db's and using a chart multiple times within itself is not possible.

Also the mongodb-replicaset chart is pretty much dying - it doesn't seem like it will be upgraded to mongodb 4 and the regular mongodb chart (done by bitnami) can deploy replicasets now.

I tried upgrading my first try to the regular mongodb chart using mongodb 4 - with no success so far. I also currently have no time to do so as upgrading is rather uncritical atm (EOL for 3.6 is not even announced yet).

Actually I'm not even sure if I want to use helm for this at all anymore due to lacking the ability to deploy an arbitrary amount of shardservers on deploy / using helm upgrade in an easy way. I might create a chart for the mongos router itself and then use ansible to deploy it and as many replicasets as I want. But maybe I'm just missing something how to do that with helm.

ncmans commented 4 years ago

How about https://github.com/bitnami/charts/tree/master/bitnami/mongodb-sharded