Application Load Balancer
- This load balancer is http aware, we can do path based routed, name based routing
- Refer Here for official docs
Path Based Routing in GCP
- Lets create two custom images
- browny
- repairs Refer Here
- Then we will create two instance groups one hosting browny and other hosting repairs
- Now lets create an external application load balancer to route requests to
- browny instance group if the path contains
/browny/* - repairs instance group if the path contains
/repairs/*
- browny instance group if the path contains
- For screenshots or creation using console refer classroom video
- We can also do header and query string based routing decisions Refer Here
Stateful Managed Instance Groups
- In stateful instance group, specfic data or state of the instances (like attached disks, ip addresses or metadata) is retained across restarts, updates and recreations
- This is useful where certain pars of instance need to persist evn if the instance is recreated
- UseCases:
- Databases
- Classic Applications with local data
Managing Virtual Machines using gcloud CLI
- Lets try creating a compute engine instance from gcloud cli
- instance creation Refer Here
#!/bin/bash
# lets get the debain image information
gcloud compute images list --filter="family:debian-12"
# Create the vm instance
gcloud compute instances create my-debian \
--image-family=debian-12 \
--image-project=debian-cloud \
--zone=us-central1-f \
--machine-type=e2-micro \
--tags=http-server
gcloud compute instances delete my-debian --zone=us-central1-f
