0% found this document useful (0 votes)
54 views

Load Balance

The document contains commands to: 1) Create a firewall rule allowing TCP traffic on port 80 from a specific IP range. 2) Create a compute instance template specifying machine type, disk, and other configuration details. 3) Create a managed instance group using the template across three zones and enable autoscaling based on CPU utilization. 4) Perform load testing on the instance group IP address using the siege tool.

Uploaded by

Joe Frixon
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Load Balance

The document contains commands to: 1) Create a firewall rule allowing TCP traffic on port 80 from a specific IP range. 2) Create a compute instance template specifying machine type, disk, and other configuration details. 3) Create a managed instance group using the template across three zones and enable autoscaling based on CPU utilization. 4) Perform load testing on the instance group IP address using the siege tool.

Uploaded by

Joe Frixon
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

gcloud compute --project=qwiklabs-gcp-03-18e2c1ffab94 firewall-rules create dfdf

--direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:80


--source-ranges=35.191.0.0/16 --target-tags=czxc

gcloud beta compute --project=qwiklabs-gcp-01-954e0b5889e7 instance-templates


create us-central1-template --machine-type=e2-medium --subnet=projects/qwiklabs-
gcp-01-954e0b5889e7/regions/us-central1/subnetworks/default --no-address
--metadata=startup-script-url=gs://cloud-training/gcpnet/httplb/startup.sh
--maintenance-policy=MIGRATE --service-account=388912381716-
[email protected]
--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapi
s.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://w
ww.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.manag
ement.readonly,https://www.googleapis.com/auth/trace.append --region=us-central1
--tags=allow-health-checks --image=debian-10-buster-v20210721 --image-
project=debian-cloud --boot-disk-size=10GB --boot-disk-type=pd-balanced --boot-
disk-device-name=us-central1-template --no-shielded-secure-boot --no-shielded-vtpm
--no-shielded-integrity-monitoring --reservation-affinity=any

gcloud beta compute --project=qwiklabs-gcp-01-954e0b5889e7 instance-groups managed


create us-central1-mig --base-instance-name=us-central1-mig --template=us-central1-
template --size=1 --zones=us-central1-b,us-central1-c,us-central1-f --instance-
redistribution-type=PROACTIVE --target-distribution-shape=EVEN

gcloud beta compute --project "qwiklabs-gcp-01-954e0b5889e7" instance-groups


managed set-autoscaling "us-central1-mig" --region "us-central1" --cool-down-period
"45" --max-num-replicas "5" --min-num-replicas "1" --target-cpu-utilization "0.8"
--mode "on"

gcloud config set project qwiklabs-gcp-01-954e0b5889e7

gcloud compute ssh europe-west1-mig-x4kf --zone europe-west1-b

gcloud compute ssh us-central1-mig-bvmw --zone us-central1-f

curl localhost

HTTP 34.117.170.4:80 - Premium


HTTP [2600:1901:0:d991::]:80 - Premium

gcloud compute ssh siege-vm --zone us-west1-c

sudo apt-get -y install siege

export LB_IP=[34.117.170.4]

siege -c 250 http://$LB_IP

35.247.24.217

You might also like