admin管理员组文章数量:1387438
I need run a python app in docker container on k8s. This app needs to use gcloud stuff like gemini-2.0-flash
, google_vertexai
and
vertexai.init(project=os.environ.get("GOOGLE_CLOUD_PROJECT"), location=os.environ.get("GOOGLE_CLOUD_LOCATION"))
I can install the gcloud
CLI in Dockerfile. What's next after that? Any reference?
I need run a python app in docker container on k8s. This app needs to use gcloud stuff like gemini-2.0-flash
, google_vertexai
and
vertexai.init(project=os.environ.get("GOOGLE_CLOUD_PROJECT"), location=os.environ.get("GOOGLE_CLOUD_LOCATION"))
I can install the gcloud
CLI in Dockerfile. What's next after that? Any reference?
1 Answer
Reset to default 2As commented by @DazWilkin, your issue could be resolved if you leverage the instructions to use ADC for local development. Using your user credentials (Google Account) or impersonating a Service Account will create a key (on Linux in ${HOME}/.config/gcloud/application_default_credentials.json
) that you can (volume) mount into the container, then reference using the environment variable GOOGLE_APPLICATION_CREDENTIALS
. You need only have gcloud installed on the host not the container.
Posting the answer as community wiki for the benefit of the community that might encounter this use case in the future. Feel free to edit this answer for additional information.
本文标签: kubernetesDocker image running in k8s which needs gcloud auth credentialsStack Overflow
版权声明:本文标题:kubernetes - Docker image running in k8s which needs gcloud auth credentials - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744572217a2613411.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
${HOME}/.config/gcloud/application_default_credentials.json
) that you can (volume) mount into the container, then reference using the environment variableGOOGLE_APPLICATION_CREDENTIALS
. You need only havegcloud
installed on the host not the container. – DazWilkin Commented Mar 17 at 15:57