【问题标题】:Connect to redis instance from Istio enabled pod in a EKS cluster从 EKS 集群中启用 Istio 的 pod 连接到 redis 实例
【发布时间】:2020-07-23 03:10:38
【问题描述】:

我正在运行启用了 Istio 的 EKS 集群。我已经启动了一个运行 redis 服务器的 EC2 实例。 EKS 集群和 Redis 都在同一个 VPC 中。所有入站和出站规则都允许它们。但是,当我尝试访问 pod 内的 redis 实例时,它会抛出“Connection reset by peer”,而它在非 istio pod 上工作正常。可能是什么原因?

Istio 版本:-

image: docker.io/istio/pilot:1.4.3
imagePullPolicy: IfNotPresent
image: docker.io/istio/proxyv2:1.4.3
imagePullPolicy: IfNotPresent

我还在该命名空间中创建了一个 Serviceentry 。

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: svc-redis
  namespace: mynamespace
spec:
  hosts:
    - "redis-X.xxx.xxxx"
  location: MESH_EXTERNAL
  ports:
    - number: 6379
      name: http
      protocol: REDIS
  resolution: NONE

【问题讨论】:

    标签: amazon-web-services kubernetes redis istio amazon-eks


    【解决方案1】:

    由于您使用域名作为主机,因此您需要将分辨率设置为DNS。因为当您将分辨率设置为None。它将尝试连接到 IP 地址而不是使用域名。

    这是我用于外部 Redis 访问的服务条目。

    apiVersion: networking.istio.io/v1alpha3
    kind: ServiceEntry
    metadata:
      name: redis-svc
    spec:
      hosts:
      - redis01.example.com
      ports:
      - number: 6379
        name: redis
        protocol: TCP
      resolution: DNS
      location: MESH_EXTERNAL
    

    【讨论】:

    • 尝试禁用双向 TLS。
    • 阅读:istio.io/faq/security 您可以通过两种方式禁用。全局或使用destinationrule。
    • 好的,我也创建了一个 Destionationrule 并禁用了 mtls 模式
    • 我会检查并回复你,伙计。别担心。 istio 很有趣。
    猜你喜欢
    • 1970-01-01
    • 2021-03-10
    • 2020-06-10
    • 2019-11-04
    • 2019-04-24
    • 1970-01-01
    • 2017-01-10
    • 2019-07-13
    • 2020-07-24
    相关资源
    最近更新 更多