[英]Application Default Credentials not available
I have some Java applications running on Google Compute Engine instances in a Container Engine cluster. 我在容器引擎集群中的Google Compute Engine实例上运行了一些Java应用程序。 I upgraded the cluster to newest version (1.7.8) and changed the node images from the container optimised OS to Ubuntu.
我将群集升级到最新版本(1.7.8),并将节点映像从容器优化的操作系统更改为Ubuntu。 Now my pods are crashing when trying to connect to the cloud sql database with this error message:
现在,当尝试使用此错误消息连接到云SQL数据库时,我的豆荚崩溃了:
The Application Default Credentials are not available. They are available if running in Google Compute Engine.
Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials.
See https://developers.google.com/accounts/docs/application-default-credentials for more information.
The service account is the same as before the upgrade with the scope https://www.googleapis.com/auth/sqlservice.admin
该服务帐户与升级之前的帐户相同,范围为
https://www.googleapis.com/auth/sqlservice.admin
Does anyone have an idea why I'm getting this error now? 有谁知道为什么我现在会收到此错误? Is the best solution is to create the environment variable?
最好的解决方案是创建环境变量吗?
Ideally you should be using GOOGLE_APPLICATION_CREDENTIALS
environment variable. 理想情况下,您应该使用
GOOGLE_APPLICATION_CREDENTIALS
环境变量。 Otherwise you are using the "Compute Engine default service account" of the VMs. 否则,您将使用虚拟机的“ Compute Engine默认服务帐户”。
See this tutorial for the best practices: https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform 有关最佳做法,请参见本教程: https : //cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.