Google Cloud Run service url (discovery)

后端 未结 2 592
夕颜
夕颜 2021-01-27 20:52

I am running several gcloud services which have assigned urls automatically in following format:

https://SERVICE_NAME-XXXXXXX-ew.a.run.app/

This is not particula

2条回答
  •  不知归路
    2021-01-27 21:19

    You can use a beta service Service Directory.

    At service deployment

    • Create your service with a name and the URL as metadata

    In your code

    • Request the service metadata with its name, and get the URL
    • Use the url

    You can't use the endpoint feature of the service because your don't have IP/Port.

    However, for now, there is client library and you have to use API directly.

提交回复
热议问题