Gcloud Command Structure
Gcloud Command Structure
Gcloud Command Structure
-------------------------------------------------------------------------
export PROJECT_ID=$qwiklabs-gcp-03-9499ff5686ea
export ZONE=$us-west3-c
gcloud -h
-----------------------------------
--zone=us-east4-c \
--tags=network-lb-tag \
--machine-type=e2-medium \
--image-family=debian-11 \
--image-project=debian-cloud \
--metadata=startup-script='#!/bin/bash
apt-get update
echo "
--zone=us-east4-c \
--tags=network-lb-tag \
--machine-type=e2-medium \
--image-family=debian-11 \
--image-project=debian-cloud \
--metadata=startup-script='#!/bin/bash
apt-get update
echo "
--zone=us-east4-c \
--tags=network-lb-tag \
--machine-type=e2-medium \
--image-family=debian-11 \
--image-project=debian-cloud \
--metadata=startup-script='#!/bin/bash
apt-get update
echo "
curl http://[IP_ADDRESS]
____________________________________________
LB Services
____________________________________________
When you configure the load balancing service, your virtual machine instances will receive packets
that are destined for the static external IP address you configure. Instances made with a Compute
Engine image are automatically configured to handle this IP address.
--region us-east4
--instances www1,www2,www3
--region us-east4 \
--ports 80 \
--address network-lb-ip-1 \
--target-pool www-pool
Sending traffic to LB
echo $IPADDRESS
___________________________________________
Requests are always routed to the instance group that is closest to the user, if that group has enough
capacity and is appropriate for the request. If the closest group does not have enough capacity, the
request is sent to the closest group that does have capacity.
To set up a load balancer with a Compute Engine backend, your VMs need to be in an instance
group. The managed instance group provides VMs running the backend servers of an external HTTP
load balancer. For this lab, backends serve their own hostnames.
--region=us-east4 \
--network=default \
--subnet=default \
--tags=allow-health-check \
--machine-type=e2-medium \
--image-family=debian-11 \
--image-project=debian-cloud \
--metadata=startup-script='#!/bin/bash
apt-get update
a2ensite default-ssl
a2enmod ssl
vm_hostname="$(curl -H "Metadata-Flavor:Google" \
http://169.254.169.254/computeMetadata/v1/instance/name)"
tee /var/www/html/index.html
--network=default \
--action=allow \
--direction=ingress \
--source-ranges=130.211.0.0/22,35.191.0.0/16 \
--target-tags=allow-health-check \
--rules=tcp:80
4. Now that the instances are up and running, set up a global static external IP address that your
customers use to reach your load balancer:
--ip-version=IPV4 \
--global
--format="get(address)" \
--global
--port 80
--protocol=HTTP \
--port-name=http \
--health-checks=http-basic-check \
--global
--instance-group=lb-backend-group \
--instance-group-zone=us-east4-c \
--global
8. Create a URL map to route the incoming requests to the default backend service:
--default-service web-backend-service
--url-map web-map-http
10. Create a global forwarding rule to route incoming requests to the proxy:
--global \
--target-http-proxy=http-lb-proxy \
--ports=80
-----------------------------------------------------------------------
______________________________________________________________________
App Engine
cd default-service
cd ../my-first-service/
__________________________________________________________________
Kubernetes
2: Here are some of the commands we will run in the next few steps (Refer back to this if you have
any problems!)
curl 35.184.204.214:8080/hello-world
____________________________________________________________________
# Cloud SQL
use todos
describe user;
# Cloud Spanner
UserName STRING(1024)
) PRIMARY KEY(UserId);
# Cloud BigTable
bq show bigquery-public-data:samples.shakespeare
gcloud --version
cat ~/.cbtrc
cbt listinstances
____________________________________________________________________
PUBSUB