Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
596 views
in Technique[技术] by (71.8m points)

gcloud compute backend-services provides a "not found" error

For some unclear reason the gcloud compute backend-services does not find a resource even it is listed. I run the command:

gcloud compute backend-services list

And get the output:

NAME                                                     BACKENDS                                                                                     PROTOCOL
k8s1-48550837-defaul-reverse-proxy-captcha-s-8-9edaabba  us-central1-c/networkEndpointGroups/k8s1-48550837-defaul-reverse-proxy-captcha-s-8-9edaabba  HTTP
k8s1-48550837-default-admission-service-80-ccc76f21      us-central1-c/networkEndpointGroups/k8s1-48550837-default-admission-service-80-ccc76f21      HTTP
k8s1-48550837-default-agent-service-80-46302173          us-central1-c/networkEndpointGroups/k8s1-48550837-default-agent-service-80-46302173          HTTP
k8s1-48550837-default-authproxy-service-80-f50b4f37      us-central1-c/networkEndpointGroups/k8s1-48550837-default-authproxy-service-80-f50b4f37      HTTP

But for any one of the backends I am trying to get description or edit, I get error. For example, this command:

gcloud compute backend-services describe k8s1-48550837-default-agent-service-80-46302173

returns error:

ERROR: (gcloud.compute.backend-services.describe) Could not fetch resource:
 - The resource 'projects/radware-cto/regions/us-central1/backendServices/k8s1-48550837-default-agent-service-80-46302173' was not found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

OP confirmed --global works in a comment.

The reason this works is because the 'describe' command will by default describe the resource in the default compute/region (gcloud config set compute/region...)

You can see this in your error message:
- The resource .../regions/us-central1/backendServices/...

However, as this resource is global, we need to specify --global flag to override the default region.

Additional information here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...