gpt4 book ai didi

amazon-web-services - 将 Istio 与 AWS IAM 集成

转载 作者:行者123 更新时间:2023-12-04 15:50:25 25 4
gpt4 key购买 nike

我目前正在探索使用 EKS 在 AWS 上运行 Istio/Kubernetes 集群。我希望能够为集群中运行的每个服务分配不同的 IAM 角色,以限制每个服务的 AWS 权限。
在非 Istio Kubernetes 集群中,此功能由 kube2iam 等项目提供。但这在 Istio 世界中似乎并不理想,因为 kube2iam依赖 iptables规则和 Istio 已经在使用 iptables将所有出站流量转移到 Envoy sidecar 的规则。
Istio security documentation说身份模型迎合了不同的底层实现,而在 AWS 上,该实现是 IAM:

In the Istio identity model, Istio uses the first-class service identity to determine the identity of a service. This gives great flexibility and granularity to represent a human user, an individual service, or a group of services. On platforms that do not have such identity available, Istio can use other identities that can group service instances, such as service names.

Istio service identities on different platforms:

Kubernetes: Kubernetes service account
GKE/GCE: may use GCP service account
GCP: GCP service account
AWS: AWS IAM user/role account


但是我还没有遇到任何关于如何将 IAM 角色分配给 Istio ServiceRoles 的额外文档。 .
有没有人找到解决方案?
更新:见 IRSA

最佳答案

我也在为此苦苦挣扎,但几乎没有找到帮助。我确实在这个人的建议上取得了成功
https://groups.google.com/forum/m/#!topic/istio-users/3-fp2JPb2dQ

在我添加那个 serviceentry 之前,我没有运气让 kube2iam 工作(见下文或点击链接)

基本上你添加这个

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: apipa
spec:
hosts:
- 169.254.169.254
ports:
- number: 80
name: http
protocol: HTTP
resolution: DNS
location: MESH_EXTERNAL

通过在应用 serviceentry 之前查看 istio-proxy sidecar,您可能会在日志中出现大量 404 错误,并且所有路径看起来都像 aws api 调用。在服务条目之后,那些变成了 200 年代。

更新....
后来我发现这是使用 istio 进行任何外部网格通信时的预期要求。见 https://istio.io/docs/concepts/traffic-management/#service-entries

关于amazon-web-services - 将 Istio 与 AWS IAM 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52732417/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com