gcloud compute addresses list returns 0 results although I have external ephemeral addresses

末鹿安然 提交于 2020-01-14 04:19:44

问题


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

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...

Are external ephemeral IP addresses not counted in the gcloud compute addresses execution ?


回答1:


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 compute addresses list': lists summary information of addresses in a project.

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:

  • Static external IP addresses are assigned to a project

  • Ephemeral external IP addresses are available to VM instances and forwarding rules.

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.

Here you have an example to list the different types of IP address.

――



来源:https://stackoverflow.com/questions/52281989/gcloud-compute-addresses-list-returns-0-results-although-i-have-external-ephemer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!