<p>Consul can be used for service discovery in Springboot applications. I am new to Kubernates and found Kubernates also has service discovery functionality. I searched how this service discovery can be used like consul but could not find any. All I found was, service discovery for pods is available in K8s. Anyone let me know how this service discovery of Kubernates can be used for Springboot applications deployed in pods for inter communication so that consul can be avoided.</p>

Débora
<p>Look into using a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> per Spring Boot application deployment.</p>

<p>In case all Spring Boot applications and their clients are running on the same Kubernetes cluster, the Services can be created as type ClusterIP. Clients simply use the Service name as the host name in the application's endpoint URL, and Kubernetes will take care of routing the calls to an available application instance; clients need not to know on which node the application pods are running in the cluster or how many instances are running.</p>

<p>In case clients are external to the Kubernetes cluster, the respective Service has to be exposed outside of the cluster. See <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types</a> for which service types can be used in this case.</p>
