I have a nextjs fronted application and a api hosted inside a kubernetes cluster. I am using istio for this implementation. So what I want to do now is whenever I do ssr I want to be able to get data from internal network without reaching out to my actual domain which I have exposed the API though Gateway.
Basically when from the server-side if I call api.example.com I want it to resolve to api.namespace.cluster.local so that my rendering and data fetching from server side will be lot faster and efficient
What is a good approach I can take in this scenario. Note that I have exposed this api service using gateway resolve to api.example.com too for client side rendering