I have a problem in Task 2. Configure the load balancing service

I tried to pass task 2 and task 3 many times but it didn't make sense I used the cloud shell to complete tasks those are the commands that I used 

gcloud compute health-checks create http www-health-check --port 80 --request-path /

gcloud compute addresses create network-lb-ip-1 --region us-east1

gcloud compute instance-groups unmanaged create www-instance-group --zone us-east1-b
gcloud compute instance-groups unmanaged add-instances www-instance-group --instances web1,web2,web3 --zone us-east1-b

gcloud compute backend-services create www-backend-service \
--protocol HTTP \
--health-checks www-health-check \
--global

gcloud compute backend-services add-backend www-backend-service \
--instance-group www-instance-group \
--instance-group-zone us-east1-b \
--global

gcloud compute url-maps create www-url-map --default-service www-backend-service

gcloud compute forwarding-rules create www-forwarding-rule \
--address network-lb-ip-1 --global \
--target-http-proxy www-http-proxy \
--ports 80

and this give me the error

ERROR: (gcloud.compute.forwarding-rules.create) Could not fetch resource:
- The resource 'projects/qwiklabs-gcp-00-87a5a659ed9d/global/addresses/network-lb-ip-1' was not found

I tried another way using the navigation menu, but I encountered a problem with it as well !!


 

Solved Solved
1 2 83
1 ACCEPTED SOLUTION

Either make your compute address global by using cmd

 

gcloud compute addresses create network-lb-ip-1 --global

 

or make your forwarding rule regional by using 

 

gcloud compute forwarding-rules create www-forwarding-rule \
--region us-east1
--address network-lb-ip-1 \
--target-http-proxy www-http-proxy \
--ports 80

 

Since you have made your compute address regional but defined the forwarding rule globally, you are getting this error.


@reham_ashraf104 wrote:

ERROR: (gcloud.compute.forwarding-rules.create) Could not fetch resource:
- The resource 'projects/qwiklabs-gcp-00-87a5a659ed9d/global/addresses/network-lb-ip-1' was not found


View solution in original post

2 REPLIES 2

Either make your compute address global by using cmd

 

gcloud compute addresses create network-lb-ip-1 --global

 

or make your forwarding rule regional by using 

 

gcloud compute forwarding-rules create www-forwarding-rule \
--region us-east1
--address network-lb-ip-1 \
--target-http-proxy www-http-proxy \
--ports 80

 

Since you have made your compute address regional but defined the forwarding rule globally, you are getting this error.


@reham_ashraf104 wrote:

ERROR: (gcloud.compute.forwarding-rules.create) Could not fetch resource:
- The resource 'projects/qwiklabs-gcp-00-87a5a659ed9d/global/addresses/network-lb-ip-1' was not found


thanks for your help

Top Labels in this Space
Top Solution Authors