Приложение выдает эту ошибку при попытке запустить LOG.info("Учетные данные по умолчанию: " + ServiceAccountCredentials.getApplicationDefault());
Код: Выделить всё
"Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc.","message":"Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc.","name":"java.io.IOException","extendedStackTrace":[{"class":"com.google.auth.oauth2.DefaultCredentialsProvider","method":"getDefaultCredentials","file":"DefaultCredentialsProvider.java","line":127,"exact":false,"location":"com.google.auth.google-auth-library-oauth2-http-1.22.0.jar","version":"1.22.0"},{"class":"com.google.auth.oauth2.GoogleCredentials","method":"getApplicationDefault","file":"GoogleCredentials.java","line":152,"exact":false,"location":"com.google.auth.google-auth-library-oauth2-http-1.22.0.jar","version":"1.22.0"},
Я выполнил шаги, описанные в этом документе. Google Doc и настройте KSA и GSA, привяжите и аннотируйте их, как описано. GSA назначена роль редактора.
В контейнере, на котором работает мой сервис, я могу видеть соответствующий GSA в качестве активной учетной записи при запуске списка аутентификации gcloud. Я также могу успешно выполнить следующие команды Curl в контейнере.
Код: Выделить всё
curl http://metadata.google.internal/computeMetadata/v1/ -H "Metadata-Flavor: Google"
Код: Выделить всё
curl http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token -H "Metadata-Flavor: Google"
Подробнее здесь: https://stackoverflow.com/questions/793 ... on-gke-clu
Мобильная версия