【问题标题】:What are the endpoints of Amazon S3?Amazon S3 的端点是什么?
【发布时间】:2018-10-24 13:10:19
【问题描述】:

我创建了一个“支持 Istio”的 Kubernetes 集群,我的容器默认为“are unable to access URLs outside of the cluster”(Istio v1.0.2)。这很好,符合我的安全要求:

默认情况下,启用 Istio 的服务无法访问外部 URL 集群的原因,因为 pod 使用 iptables 透明重定向 到 sidecar 代理的所有出站流量...

现在我正在尝试创建一个 Istio Service Entry允许我的容器请求我的 s3 存储桶,这些存储桶位于 Istio 服务网格之外。

据我所知,Amazon S3 没有特定的“主机”或明确定义的 IP 地址范围。我怎样才能做到这一点?我需要使用什么协议?

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: enable-access-to-s3-buckets
spec:
  hosts:
  - ????????
  ports:
  - number: ???????
    name: ??????
    protocol: ??????
  resolution: ?????

注意:Istio v1.2 将默认出站流量策略更改为ALLOW_ANY

【问题讨论】:

    标签: amazon-s3 kubernetes istio


    【解决方案1】:

    在这里,您可以获得可能有帮助的 s3 终止点列表:https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

    另一种解决方案是在您的 K8S 集群的同一 VPC 内创建一个 s3 端点,并使用该名称通过私有 IP 规则限制访问。有关它的详细文档,请参阅 https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-s3.html

    【讨论】:

    • 感谢您的快速回答。在服务条目中使用 终止点 作为 hostsDNS 作为 resolution 似乎是合理的(或者我误解了它?)。我会做一些测试,让你知道它是否能解决我的问题。
    • 我创建了一个 ServiceEntry 和一个 VirtualService ,它们将我的存储桶名称与我所在区域的端点匹配(例如 here)。我的容器现在可以使用 aws-cli 发出 s3 请求。谢谢!
    • @EduardoBaitello 您可能希望在 ServiceEntry 和 VirtualService 中指定通配符,例如*.s3.amazonaws.com 允许访问任何 s3 服务。
    • @VadimEisenberg,感谢您的提示,但我想让它尽可能受到限制,因此使用 my-bucket-name.s3.amazonaws.com 允许我的容器仅请求明确允许的存储桶。
    • @EduardoBaitello 我认为您不需要对 ServiceEntry 进行 DNS 解析,因为在您的情况下,DNS 解析可能由应用程序本身执行(您不必由 Istio 边车代理执行)。
    猜你喜欢
    • 2010-10-21
    • 2020-08-20
    • 1970-01-01
    • 2023-02-07
    • 1970-01-01
    • 2012-03-03
    • 2012-09-28
    • 2012-06-18
    • 2016-12-17
    相关资源
    最近更新 更多