<p>I am new to Kubernetes and if I am not wrong, a service can be exposed inside the cluster using <code>ClusterIP</code>, and to the outside world using <code>NodePort</code> or <code>LoadBalancer</code> types. But my requirement is that I have a single container that has few REST APIs. I want that one API (the basic health check API) should be exposed to the outside, and the rest of the APIs should be available only within the cluster (accessible by other nodes). How can I achieve this?</p>

<p>You can keep your service as <strong>ClusterIP</strong> and use the <strong>ingress</strong>.</p>
<p>With <strong>ingress</strong> and <strong>ingress controller</strong>, you can setup and expose the desired path outside of cluster.</p>
<p><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a>, you can install the <strong>Nginx ingress controller</strong> and create the <strong>ingress</strong> resource.</p>
<p>Read more about the <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">nginx ingress controller</a> setup and <strong>ingress</strong> reosuce setup.</p>
