You are viewing documentation for a release that is no longer maintainedSee documentation for the latest supported version 3 or the latest supported version 4.
12.10. 在容器中使用服务帐户凭证
创建 pod 时,它指定一个服务帐户(或使用默认服务帐户),并使用该服务帐户的 API 凭证并引用 secret。
包含 pod 服务帐户的 API 令牌的文件会自动挂载到 /var/run/secrets/kubernetes.io/serviceaccount/token。
该令牌可用于发出 API 调用作为 pod 的服务帐户。这个示例调用 users/~ API 来获取有关令牌标识的用户的信息: