Deployed a rest API(go lang) in kubernetes cluster and also created a service for the pod.
i need to access the rest API via service name or service URL?
Deployed a rest API(go lang) in kubernetes cluster and also created a service for the pod.
i need to access the rest API via service name or service URL?
It depends from where are you accessing the service.
If you are accessing from the kubernetes cluster nodes, you can access through service IP;
curl <service-ip>should provide access to your rest API.If you are accessing the service from another pod, then you can use internal kubernetes DNS resolution. Something like
curl <service-name>.<namespace>.svc.cluster.localshould access your rest API.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.