ElastiCache Redis群集和Istio

时间:2019-02-19 15:01:45

标签: redis amazon-elasticache istio redis-cluster amazon-eks

我正在尝试从具有Istio作为辅助代理的EKS容器中连接到我的ElastiCache Redis Cluster 5.0,但我经常遇到MOVED错误循环。

我有1个分片和2个副本,并且为每个分片+配置端点添加了ServiceEntry和VirtualService。

用于Istio路由的示例配置:

kind: ServiceEntry
metadata:
  name: redis-test-cluster
spec:
  hosts:
  - redis-cluster-test.XXXX.clustercfg.euw1.cache.amazonaws.com
  ports:
  - number: 6379
    name: tcp
    protocol: TCP
  resolution: NONE
  location: MESH_EXTERNAL
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: redis-test-cluster
spec:
  hosts:
  - redis-cluster-test.XXXX.clustercfg.euw1.cache.amazonaws.com
  http:
  - timeout: 30s
    route:
    - destination:
        host: redis-cluster-test.XXXX.clustercfg.euw1.cache.amazonaws.com

1 个答案:

答案 0 :(得分:1)

请注意,Redis协议不是HTTP,因此不能使用http VirtualService。

要控制Redis等TCP协议的出口访问,请选中Egress Control for TLS section of the Consuming External MongoDB Services blog post