gcloud app deploy -=> Deploy the app to the App Engine Standard environment for Pythongcloud app browse -=> To view your application user_email = request.headers.get('X-Goog-Authenticated-User-Email')
user_id = request.headers.get('X-Goog-Authenticated-User-ID')
gcloud services disable appengineflex.googleapis.com -=> To disable the Flex API def user():
assertion = request.headers.get('X-Goog-IAP-JWT-Assertion')
if assertion is None:
return None, None
info = jwt.decode(
assertion,
keys(),
algorithms=['ES256'],
audience=audience()
)
return info['email'], info['sub']

gcloud compute networks create privatenet --subnet-mode=custom -=> Create networkgcloud compute networks subnets create privatesubnet-us --network=privatenet --region=us-central1 --range=172.16.0.0/24 -=> Create subnetgcloud compute networks list -=> List the available VPC networksgcloud compute networks subnets list --sort-by=NETWORK -=> List the available VPC subnets (sorted by VPC network)gcloud compute firewall-rules create privatenet-allow-icmp-ssh-rdp --direction=INGRESS --priority=1000 --network=privatenet --action=ALLOW --rules=icmp,tcp:22,tcp:3389 --source-ranges=0.0.0.0/0gcloud compute firewall-rules list --sort-by=NETWORK -=> List all the firewall rules (sorted by VPC network)gcloud compute instances create privatenet-us-vm --zone=us-central1-f --machine-type=n1-standard-1 --subnet=privatesubnet-usgcloud compute instances list --sort-by=ZONE -=> List all the VM instances (sorted by zone)ping -c 3 <Enter IP here>sudo ifconfig -=> List the network interfaces within the VM instanceip route -=> List the routes for an instancesudo apt-get install nginx-light -y -=> In the SSH terminal to install nginxsudo nano /var/www/html/index.nginx-debian.html -=> Open the welcome page in the nano editorcat /var/www/html/index.nginx-debian.html -=> Verify the changegcloud compute instances create test-vm --machine-type=f1-micro --subnet=default --zone=us-central1-a -=> Create a test VMcurl ipAddress -=> Test connectivity in SSH terminalgcloud compute firewall-rules delete allow-http-web-server -=> To delete the allow-http-web-server firewall rulegcloud auth activate-service-account --key-file credentials.json -=> Authorize the VM with the credentials you just uploaded
sudo apt-get -y install siege -=> Install siegeexport LB_IP=[LB_IP_v4] -=> To store the IPv4 address of the HTTP Load Balancer in an environment variablesiege -c 250 -t150s http://$LB_IP -=> To simulate a loadcurl http://$LB_IP -=> To access the load balancersiege -c 250 -t150s http://$LB_IP -=> In the SSH terminal of siege-vm, to simulate a load
