尽管我有外部临时地址,但gcloud计算地址列表仍返回0个结果 [英] gcloud compute addresses list returns 0 results although I have external ephemeral addresses
问题描述
我的项目中有一个带有外部IP的Google计算实例. 实例上的describe命令向我显示:
I have one google compute instance in my project with an external IP. A describe command on the instance shows me:
networkInterfaces:
- accessConfigs:
- kind: compute#accessConfig
name: External NAT
natIP: xx.yyy.nnn.mmm
networkTier: PREMIUM
type: ONE_TO_ONE_NAT
fingerprint: hjhjhjhjh=
kind: compute#networkInterface
name: nic0
network: https://www.googleapis.com/compute/v1/projects/foo-201800/global/networks/default
但是,当我在cloudshell上运行时.
However, when I run on the cloudshell.
$ gcloud config get-value project
Your active configuration is: [cloudshell-xxxx]
foo-201800
$ gcloud compute addresses list
Listed 0 items.
$ gcloud compute addresses list --global
Listed 0 items.
$ gcloud version
Google Cloud SDK 215.0.0
...snipped...
gcloud compute addresses
执行中是否不计入外部临时IP地址?
Are external ephemeral IP addresses not counted in the gcloud compute addresses
execution ?
推荐答案
"gcloud计算地址"命令仅计算在项目中分配的静态IP地址.更具体地说,您可以在命令摘要中阅读以下说明:
The ‘gcloud compute addresses’ command only counts static IP addresses assigned in a project. More specifically, you can read in the summary of the command the following description:
- "gcloud计算地址列表" :列表摘要项目中的地址信息.
- 'gcloud compute addresses list': lists summary information of addresses in a project.
在文档中,有关计算引擎IP地址的信息关于静态IP外部地址和临时IP地址的定义如下:
In the document about the compute engine IP addresses the definition about the static IP external address and the ephemeral IP address says the following:
-
静态外部IP地址已分配给项目
Static external IP addresses are assigned to a project
短暂的外部IP地址可用于VM实例和转发规则.
Ephemeral external IP addresses are available to VM instances and forwarding rules.
临时IP附加到资源而不是项目,当您使用命令"gcloud计算地址"时,您仅列出了项目中附加的IP;静态外部IP.
The ephemeral IP are attached to a resources but not a project, when you use the command ‘gcloud compute addresses’ you are only listing the IP attached in a project; the static external IP.
此处您有一个示例列出了不同类型的IP地址.
Here you have an example to list the different types of IP address.
-
这篇关于尽管我有外部临时地址,但gcloud计算地址列表仍返回0个结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!