google-cloud-platform - 将 GCP 服务帐户密钥传递给 GKE pod
问题描述
我在 TF ( 0.11.14
) 中创建了一个 GCP 角色,将其附加到服务帐户,并为后者创建了一个密钥,如下所示:
resource "google_service_account_key" "my_service_account_key" {
service_account_id = "${google_service_account.my_service_account.id}"
}
然后我private_key
通过以下方式将 as 输出:
output "my_service_account_private_key" {
value = "${google_service_account_key.my_service_account_key.private_key}"
sensitive = true
}
这给我打印了一个很长的字符串,例如
ewogICJK49fo34KFo4 .... 49k92kljg==
假设该角色具有允许对 GCS 存储桶进行读/写的权限,我如何将上述凭证/私钥传递给(GKE)吊舱/部署,以便吊舱被授予特定的服务帐户(因此能够执行相应的权限允许什么,例如读取/写入存储桶)?
解决方案
推荐阅读
- python - 在测试执行期间重定向文件中的所有类型的异常和标准输出日志 - Python 3
- notepad++ - notepad++ 用户定义语言折叠打开和关闭
- i2c - 什么是广播地址,它在 I2C 中的用途是什么?
- python - 为什么 Python 只使用 4% 的 CPU?
- git - 更改推送到 GitHub 的提交...删除文件
- python - 在 Python 中从 .xlsx 文件中读取图表
- json - 使用 JSON 数组访问数据
- php - Imagemagick - 不知道如何解决
- wordpress - 403响应代码与http但不是在wordpress上的https
- python - 分组后如何获取所有行的数据框?