<p>I have a cluster with multiple databases. Applications on my cluster can access the database using the clusterIP service. For security reasons, I do not want to expose these databases publicly using a nodeport or a loadbalancer. </p>

<p>What I would like to do is upload a web based database client to Kubernetes and expose this client as a service, so that the database can be accessed.</p>

<p>Is something like this possible?</p>

jdoe
<p><em>Personal opinion aside on 'web based database client' and security concern</em></p>

<p>What you are trying to achieve seems to be proxying your databases through a web app.</p>

<p>This would go like this:</p>

<pre><code>NodePort/LB --&gt; [WebApp] --&gt; (DB1 ClusterIP:Port)--[DB1]
                         \--&gt; (DB2 ClusterIP:Port)--[DB2]
                          \--&gt; (DB3 ClusterIP:Port)--[DB3]
</code></pre>

<p>You just have to define a NodePort/LB Service to expose your WebApp publicly, and ClusterIP Services for each Database you want to be able to reach. As long as the WebApp is running in the same cluster, it will be able to connect to your internal databases, while they wouldn't be directly reachable from outside the Kubernetes cluster.</p>
