Score:0

Hosting Google VM on web

cn flag

sorry for the rookie question, I'm just starting with Google Cloud and web developement. I have a Flask application, works perfectly locally, and also when deployed to a VM in GC. However I can only trigger the API now by using the external IP address, and I'd like to give it a friendly url.

So currently I have 15.15.15.15/triggerawesomapi And I want to have: https://awesomeapplication.com/triggerawesomapi

What should I do to achieve this?

c4f4t0r avatar
nl flag
create a dns record point to that ip
Score:0
st flag

Option 1) The easier and faster way, but less reliable:

1.1. Assign an external/static IP to your VM server
1.2. Change your DNS entry awesomeapplication.com to point to your static external IP

In this case, your application is supposed to have an outage in case your server goes down

Option 2) Demands a little more work, but it's more reliable

2.1. Create a VM image with your application
2.2. Create a MIG (Managed Instance Group)
2.3. Configure a load balancer with health-check pointing to your MIG
2.4. Change your DNS entry to point to your load balancer

In this case, GCP is supposed to launch a new healthy VM, in case of an application failure

Option 3) Recommended one: Easier to maintain e reliable

3.1. Create a docker image and deploy it to AppEngine
3.2. Change your DNS entry to point to your AppEngine's URL

In this case, you're supposed to have automatic scale and reliability. Besides, AppEngine standard can downscale to zero when idle, in order to save costs. In addition, you can leverage canary deployments and cache from default's AppEngine infrastructure.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.