Google Cloud Run service url (discovery)

后端 未结 2 557
夕颜
夕颜 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.

    0 讨论(0)
  • 2021-01-27 21:21

    https://github.com/ahmetb/runsd I've released an external tool called runsd that lets you do this. Check it out.


    Thanks for this question! The "Service discovery by name" for Cloud Run is very much an active area of work. Though, there are no active timelines we can share yet.

    You can see a prototype of me running this on Cloud Run here: https://twitter.com/ahmetb/status/1233147619834118144

    APIs like Google Cloud Service Directory linked are geared more towards custom/DIY service discovery you might want to build to your RPC stack such as gRPC. It's more of a managed domain name directory, that you can integrate with your RPC.

    If you are interested in participating an alpha for this feature in the future, drop me an email at ahmetb at google.

    0 讨论(0)
提交回复
热议问题