Reputation: 47
Instead of the usual way of deployment via Gcloud command line, I simply sshed the GCP Ubuntu instance and deployed my flask app via WinSCP by transferring the files onto the Ubuntu instance I have created. I was able to get it to run like so:
I have also reserved a static address so that I could allow users to view the Flask app.
However, when I tried to access the external ip address, GCP refused to connect and I can't view my flask app.
What could I have possibly done wrong?
Upvotes: 3
Views: 1309
Reputation: 6340
There is no VPC Firewall rule to allow ingress traffic to your instance on tcp/8080.
First step: Add a network tag on your GCE instance, allow-8080-ingress
.
Second step: Under the web menu, go to VPC Network
- Firewall
- Create Firewall Rule
and create a new rule with following properties:
You did not attached the your flask code, but if you launch it like this, it will just work:
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)
...being able to access it by the public IP:
Upvotes: 4