将 pod 从 k8s 连接到 google 存储

connect pod from k8s to google storage

我需要使用 Camel google-存储组件将 Camel 连接到 GCP 存储(桶)。 k8s (GCP) 中的骆驼 运行。

该组件接受密钥文件。这在提供密钥文件时在本地工作。

出于安全原因,我不想将密钥文件包含在 POD 中,而是以某种方式使 POD 能够访问 GCP 服务。

我有哪些选择?

Workload Identity 是从 Google Kubernetes Engine 中的应用程序 运行 访问 Google 云服务的推荐方式。 Using Workload Identity.

否则,您可以创建和使用服务帐户并为其分配存储角色。密钥可以与服务帐户一起使用。 Using Service account for authentication to Google Cloud. Camel documentation has also the steps to use service account keys Camel with Google Storage.

我处于类似情况(除了我想使用 google pubsub)。

检查相关代码向我建议使用工作负载身份来授权 google 使用 camel 服务的 ATM 是不可能的。

查看 relevant code(第 170-188 行):它要么使用提供的密钥,要么根本不使用凭据。