Получение ошибки с конечными точками Google Cloud с Cloudrun для переменной среды ENDPOINTS_SERVICE_NAME - PullRequest
0 голосов
/ 01 февраля 2020

Получение следующего сообщения об ошибке после настройки бэкэнда с контейнером ESPv2 Beta.

Serverless ESPv2 expects ENDPOINTS_SERVICE_NAME in environment variables.

 Did you forget to build the Endpoints service configuration
 into the ESPv2 image? Please refer to the official serverless
 quickstart tutorials (below) for more information.

 https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-run#configure_esp
 https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-functions#configure_esp

 If you are following along with these tutorials but have not
 reached the step above yet, this error is expected. Feel free
 to temporarily disregard this error message.

 If you wish to skip this step, please specify the name of the
 service in the ENDPOINTS_SERVICE_NAME environment variable.
 Note this deployment mode is **not** officially supported.
 It is recommended that you follow the tutorials linked above.

Похоже, я смог правильно настроить службу облачного запуска, способную получать ответы непосредственно из API.

Просмотр gcloud_build_image, похоже, не имеет переменной.

https://github.com/GoogleCloudPlatform/esp-v2/blob/9a5a03d439867b0d5563081ac574e94d51922c32/docker/serverless/gcloud_build_image#L53

1 Ответ

1 голос
/ 01 февраля 2020

Обновите переменную среды Cloud Run, в которой развернута облачная конечная точка, например

gcloud beta run services update <SERVICE NAME> \
--set-env-vars ENDPOINTS_SERVICE_NAME=<SERVICE NAME>-<hash>-<REGION>.a.run.app \
--region <REGION> --platform managed

Подробнее в моей статье

...