amazon-ec2 - 如何在 Mesos 中为容器级访问设置 IAM 角色

标签 amazon-ec2 mesos

我正在通过 Mesos 将我的微服务部署到 EC2 实例中。问题是我正在与其他团队的微服务共享我的 EC2 实例。所有这些微服务都处理不同的 S3 存储桶,我们不希望其他人访问我们的存储桶。我需要为我的容器分配 IAM 角色,这样只有我才能通过部署在 EC2 实例中的微服务访问我的 S3 存储桶。 我们没有使用 ECS,而是使用 Mesos 进行部署。任何输入或评论表示赞赏。提前致谢。

最佳答案

AWS 对此不提供原生支持。在此期间,您可以使用 Lyft 的 metadataproxy (另请参见 blog post)。

引用博客:

We had an idea to build a web service that proxies calls to the metadata service on http://169.254.169.254 and pass through most of the calls to the real metadata service, but capture calls to the IAM endpoints. By capturing the IAM endpoints we can decide which IAM credentials we’ll hand back.

...

To know which IAM roles should be assumed, the metadataproxy has access to the docker socket. When it gets a request, it looks up the container, based on its request IP, finds that container’s environment variables and uses the value of the IAM_ROLE environment variable as the role to assume. It then uses STS to assume the role, caches the credentials in memory (for further requests) and returns them back to the caller. If the credentials cached in memory are set to expire, the proxy will re-assume the credentials.

关于amazon-ec2 - 如何在 Mesos 中为容器级访问设置 IAM 角色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35653511/

相关文章:

python - 在 AWS 上拍摄 RabbitMq 实例的快照是否会损害我的应用程序产品?

java - Mesos java 应用程序监控

java - mesos hadoop org.apache.hadoop.mapred.JobTracker 未启动

apache - 使用 Kubernetes 或 Apache mesos

java - 使用 RSE 通过 Eclipse 将远程源作为 Java 项目 check out

java - 在 Amazon Linux AMI 2013.03 上托管 Java Webservice

amazon-web-services - 使用 Jenkins 和 Cloud Formation 的 AWS AMI 自动化

Mesos:mesos-slave 提供额外的端口

docker - 如何彻底关闭 mesos-slave?

amazon-web-services - EC2 在网络 ACL 中自动添加 DENY All Traffic 规则(无法编辑规则)