I have 2 kubernetes cluster
cluster 2 - exposed loadblancer nginx with regional IP IP_PRIVATE
service 1 - website `/website`
service 2 - blog `blog`
service 3 - api `api`
cluster 1 - exposed loadblancer gce with global IP IP_PUBLIC
I want to implement this behaviour
IP_PUBLIC/api -> service 2 response
IP_PUBLIC/* -> cdn -> service 1 response
To implement this I have created cdn service layer in cluster 1 as defined here https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#expandable-1
Now my domain will be mapped to IP_PUBLIC hence any request will hit cluster 1 first then it should pass the request to cluster 2 and get the response.
Note: I have to create 2 clusters because
- I don't want to change anything in cluster
- I cant have global IP with nginx ingress
- I cant have 2 loadbalancer (both gce and nginx) in one cluster
I want to pass the exact request (domain, headers etc) from cluster 1 to cluster 2 as if the request is directly hiting the cluster 2.
What is the correct way to do this? In case there is any alternate solution to achieve the above with minimum changes then please suggest.