OBS.: A pasta onde os projetos django serão hospedadas nesse tutorial é /home/sysadmin/webapps/
.
Por isso, criando a pasta:
cd /home/sysadmin/
mkdir webapps
https://realpython.com/blog/python/asynchronous-tasks-with-django-and-celery/
$ pip install celery
$ sudo apt-get install rabbitmq-server
This gist aims to show how to configure debug for VScode and python development on the Google App Engine Standard Environment. This tutorial is based on this article, with some additional information that didn't seem much clear for me.
Step 1: Open the application directory in VSCode.
Step 2: Download the latest version of ptvsd
module here. Copy it to your working directory, extract it, than enter the extracted folder (the one that contains setup.py
) and copy the ptvsd
folder to your root project (where app.yaml
resides).
Step 3: Create a tasks.json
file with the VSCode command. Press CTRL+SHIFT+B
to "Run build task". As no task is configured it will create one from a template which you will have to choose. Once created, place the following content into taksks.json
:
This steps assume we already have a Cluster created with VPC-native traffic routing
enabled.
Before the need of the HTTP(S) LoadBalancer, I would just apply the manifests provided by the NGINX DOCS page for the installation of the Nginx Ingress Controller and It would create a service of type LoadBalancer
which would, then, create a regional L4 LoadBalancer automatically.
But now that I need need to have Cloud Armor and WAF, the L4 Loadbalancer doesn't support it. A HTTP(S) Load Balancer is needed in order to Cloud Armor to work.
In order to have Nginx Ingress controller working with the new HTTPS(S) LoadBalancer we need to change the type: LoadBalancer
on the Nginx Ingress Controller service to ClusterIP
instead, and add the NEG annotation to it cloud.google.com/neg: '{"exposed_ports": {"80":{"name": "ingress-nginx-80-neg"}}}'
. We do that because we don't want it to generate a L4 LoadBalancer for us. Instead, we will manually create an HTTP(S) LoadBalancer and bind it t
These are the steps to Deploy a Cloud Run service that will:
NOTE: If your VPC has a Nat Gateway and Router with an static IP address, then your Cloud Run will have a static Outbound IP allowing things like database whitelisting.
Now with the steps: