GCE Network Load Balancer

NETWORK LOAD BALANCING

# Create a basic health check for /

gcloud compute http-health-checks create basic-check

# Add a target pool in the same region as the web servers

gcloud compute target-pools create fe-web-pool --region us-central1 --health-check basic-check

# Add instances to the target pool

gcloud compute target-pools add-instances fe-web-pool --instances web1 --zone us-central1-a

# Add a static IP address

gcloud compute addresses create fe-web-address --region us-central1

# Set a forwarding rule to send traffic to the pool

gcloud compute forwarding-rules create fe-web-rule --address IP-ADDRESS --region us-central1 --port-range 80 --target-pool fe-web-pool

# Lookup IP of forwarding rule

gcloud compute forwarding-rules describe fe-web-rule --region us-central1

# Set IP shell variable to IP of forwarding rule

IP=`gcloud compute forwarding-rules describe fe-web-rule --region us-central1 | egrep '^IPAddress:' | awk '{print $2}'`

# Test load-balancer

while true; do curl -m1 $IP; done

2 thoughts on “GCE Network Load Balancer

  1. astrologiaagapikaisxeseis.wordpress.com

    Thanks for shaaring such a good opinion, pot is good,
    thats why i have read it completely

    Reply

Leave a comment