i m exploring GCP and i love the way it lets the developer play with such costly infrastructure. till now i have learnt a lot many things. i m no more a beginner and i have this case which i m unable to find docs or example for or i might be thinking in wrong direction.
I want to build an auto-scaling hosting solution where users can :
- Create Account
- Create multiple websites [these websites are basically tempaltes where user can define certain fields and the website is rendered in a specific manner | users are not allowed to upload file instead just some data entries]
- In a website user can connect domain [put 'A' record DNS entry in their domain]
- After that an SSl is provisioned automatically by the platform and the website is up and running. [somewhat like firebase]
I could easily create such a project on one server with the following configuration[skipped simple steps like user auth etc.]:
- I use ubunutu 16.04 as my machine type with 4GB ram and 10GB persistance disk
- Then i install
nvm
[a package to manage node.js] - after that i install specific version of node.js using
nvm
- i have written a simple javascript package in which i use express server to respond to the client requests with some html
- for managing ssl i use letsencrypt's
certbot
package - i use
pm2
to run the javascipt file as service in background
after being able to accomplish this thing i could see everything works the way i want it to.
then i started exploring GCP's load balancers there i learnt about the 4 layer and 7 layer LBs and i implemented some hello world tests [using startup scripts] in all possible configuration like
- 7 layer http
- 7 layer https
- 4 layer internal tcp
- 4 layer internal ssl
Here is the main problem i m facing : I can't find a way to dynamically allocate an SSL to an incoming request to the load balancer
In my case requests might be coming from any domain so GCP load balacer must have some sort of configuration to provision SSL for specific domain [i have read that it can alloccate an SSL for upto 100 domains but how could i automate things] or could there be a way that instead of requests being proxied[LB generates a new requeest to the internal servers], requests are just being redirected so that the internal servers can handle the SSL management themseleves
I might be wrong somewhere in my understanding of the concepts. Please help me solve the problem. i want to build firebase-hosting clone
at my own. anykind of response is welcomed ????????????