<p>I used to test installed mongodb-shard on kubernetes by helm,but I found that those helm charts are not really a qualified mongodb shard.These helm charts can correctly create Pods with names like <code>mongos-1</code> <code>mongod-server-1</code> <code>mongod-shard-1</code>,this seems to be a correct shard cluster configuration, but the appropriate mongos, mongod server instance is not created on the corresponding Pod.They just create a normal mongod instance on the corresponding pod, and there is no connection between them.Do I need to add scripts to execute commands similar to <code>rs.addShard(config)</code>?Encountered the same problem when installing mysql cluster using helm.</p>

<p>What I want to know is, is it not appropriate to install mysql/mongodb cluster on kubernetes in general scenarios?Is the database installed independently or deployed on Kubernetes?</p>

jiangyongbing24
<p>Yes, you can deploy MongoDB instances on Kubernetes clusters. </p>

<p>Use <a href="https://docs.opsmanager.mongodb.com/current/tutorial/deploy-standalone/" rel="nofollow noreferrer">standalone instance</a> if you want to test and develop and <a href="https://docs.opsmanager.mongodb.com/current/tutorial/deploy-replica-set/" rel="nofollow noreferrer">replica set</a> for production like deployments.</p>

<p>Also to make things easier you can use <a href="https://github.com/mongodb/mongodb-enterprise-kubernetes#mongodb-enterprise-kubernetes-operator" rel="nofollow noreferrer">MongoDB Enterprise Kubernetes Operator</a>:</p>

<blockquote>
  <p>The Operator enables easy deploys of MongoDB into Kubernetes clusters,
  using our management, monitoring and backup platforms, Ops Manager and
  Cloud Manager. By installing this integration, you will be able to
  deploy MongoDB instances with a single simple command.</p>
</blockquote>

<p>This guide has references to the official MongoDB documentation with more necessary details regarding:</p>

<ul>
<li><p>Install Kubernetes Operator</p></li>
<li><p>Deploy Standalone</p></li>
<li><p>Deploy Replica Set</p></li>
<li><p>Deploy Sharded Cluster</p></li>
<li><p>Edit Deployment</p></li>
<li><p>Kubernetes Resource Specification</p></li>
<li><p>Troubleshooting Kubernetes Operator</p></li>
<li><p>Known Issues for Kubernetes Operator</p></li>
</ul>

<p>So basically all you need to know in this topic.</p>

<p>Please let me know if that helped. </p>
