<p>Deployed a rest API(go lang) in kubernetes cluster and also created a service for the pod.</p>
<p>i need to access the rest API via service name or service URL?</p>

sumith
<p>It depends from where are you accessing the service.</p>
<p>If you are accessing from the kubernetes cluster nodes, you can access through service IP;  <code>curl &lt;service-ip&gt;</code> should provide access to your rest API.</p>
<p>If you are accessing the service from another pod, then you can use internal kubernetes DNS resolution. Something like <code>curl &lt;service-name&gt;.&lt;namespace&gt;.svc.cluster.local</code> should access your rest API.</p>
<p>If you want to access rest API outside of the cluster, you need a load balancer with the IP of the cluster external network (the network where cluster resides). If you have deployed cluster on-premise, you may consider using metallb for managing external IPs. If the cluster is deployed in the cloud, then you can use cloud provided IPs.</p>
