Cannot connect frontend app{Angular} to Backend{SpringBoot} in kubernetes Cannot connect frontend app{Angular} to Backend{SpringBoot} in kubernetes kubernetes kubernetes

Cannot connect frontend app{Angular} to Backend{SpringBoot} in kubernetes


The front end angular application is running inside the browser of a user. This is outside of the kubernetes Cluster and you therefore can not use the kubernetes Service Name as api endpoint.You need to make the spring boot api accessible from outside of kubernetes, usually using an ingress or load balancer. You use this external ip or host name as api url in the angular application.


if your two applications run in the same kubernetes cluster so you would have to call your backend service like this: svcname:port for example

http://login:8080/login

This assuming the pods for your frontend are on the same Kubernetes namespace. If they are on a different namespace you would call something like this:

http://login.<namespace>.svc.cluster.local:5555/login


Exposing my back-end service to a Load Balancer, and than using that Load Balancer endpoint in my Front-end application worked for me.