<p>Considering the following scenario:</p>

<ul>
<li>I have one main <strong>heavy service</strong> and many other <strong>small microservices</strong>.</li>
<li>The <strong>small microservices</strong> are consumed only the <strong>heavy service</strong>.</li>
<li>Only the main <strong>heavy service</strong> is exposed to the public internet.</li>
</ul>

<p>What is the best practice to deploy those services into ?</p>

<p>All together in the same kubernetes cluster:</p>

<ul>
<li>The main <strong>heavy service</strong> LoadBalancer</li>
<li>The other <strong>small microservices</strong> as ClusterIP (to protect them from public internet).</li>
</ul>

<p>Is that a good approach ?</p>

kilobaik
<p>There are some misunderstandings here.</p>

<p>There terminology about <em>microservice</em> is <strong>not about size</strong> but more an organizational thing. Ten years ago, the whole system was deployed as a <em>monolith</em> but now it is recommended that teams should not be bigger than 5-8 persons - and those teams should work in their own pace with their own <em>deployment cycle</em>. So the <em>monolith</em> has to be broken into smaller services. The services in such an architectural pattern is called for <em>microservices</em> - but not that they are <em>small</em> or <em>big</em>.</p>

<p>All your services should be deployed as a <code>Deployment</code> on Kubernetes, and the services should be <em>stateless</em>. So even the "main heavy service" should be stateless and possibly scaled to multiple replicas.</p>

<p>You are correct in that only services that <strong>need</strong> to be exposed to the Internet should be exposed to the Internet.</p>

<p>Wether your "heavy service" should be exposed with a <code>Service</code> of type <code>LoadBalancer</code> or <code>NodePort</code> actually depends more on what <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">Ingress Controller</a> you are using. E.g. If you are using <em><a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">Google Kubernetes Engine</a></em>, you should exposed it as a <code>NodePort</code> type. And yes, the other applications should have a <code>Service</code> of type <code>ClusterIP</code>.</p>

<p>It is worth noting that all Kubernetes <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> objects will provide <em>load balancing</em> functionality to the <em>replicas</em>. The service type, e.g. <code>LoadBalancer</code>, <code>NodePort</code> or <code>ClusterIP</code> is more about <strong>how</strong> the Service will be exposed.</p>
