I want to setup web app using three components that i already have:
- Domain name registered on domains.google.com
- Frontend web app hosted on Firebase Hosting and served from
example.com
- Backend on Kubernetes cluster behind Load Balancer with external static IP
1.2.3.4
I want to serve the backend from example.com/api
or api.example.com
My best guess is to use Cloud DNS to connect IP adress and subdomain (or URL)
1.2.3.4
->api.exmple.com
1.2.3.4
->example.com/api
The problem is that Cloud DNS uses custom name servers, like this:
ns-cloud-d1.googledomains.com
So if I set Google default name servers I can reach Firebase hosting only, and if I use custom name servers I can reach only Kubernetes backend.
What is a proper way to be able to reach both api.example.com and example.com?
edit: As a temporary workaround i'm combining two default name servers and two custom name servers from cloud DNS, like this:
ns-cloud-d1.googledomains.com
(custom)ns-cloud-d2.googledomains.com
(custom)ns-cloud-b1.googledomains.com
(default)ns-cloud-b2.googledomains.com
(default)
But if someone knows the proper way to do it - please post the answer.
ExternalName
service pointing to firebase & then ingress controller in Kubernetes pointing to Firebase using that service and backend using another service. – Vishal Biyani