Istio 인그레스 게이트웨이는 서비스에 대해 둘 이상의 복제본에 연결할 수 없습니다.

Istio 인그레스 게이트웨이는 서비스에 대해 둘 이상의 복제본에 연결할 수 없습니다.

새로운 AWS EKS 클러스터에 Istio를 설정하고 테스트할 기본 nginx 배포를 생성했습니다. 배포에 복제본이 하나만 있으면 완벽하게 작동하여 100ms 이내에 응답합니다. 하나의 복제본을 추가하면 새 포드의 응답 시간이 미친 듯이 빨라져 평균 약 10초가 됩니다.

다른 곳의 제안을 바탕으로 업데이트했습니다.메쉬 구성자동 재시도를 비활성화하려면:

meshConfig:
   defaultHttpRetryPolicy: {}

이 일이 발생한 후 두 번째 Pod에 대한 요청이 항상 실패한다는 사실을 발견했습니다.

"GET / HTTP/1.1" 503 UF upstream_reset_before_response_started{connection_failure} - "-" 0 91 10003 - "108.249.9.111,10.1.0.117" "curl/7.68.0" "6fa51be8-1441-4454-8d 1b-a03c93b257dc" "example.com" "10.1.52.62:80" outbound|80||nginx.my-namespace.svc.cluster.local - 10.1.108.189:8080 10.1.0.117:21410 - -

내 설정은 다음과 같습니다.

# AWS ALB Ingress -> istio-ingressgateway (ClusterIP) -> gateway -> virtualservice -> service -> nginx

apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: default
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"

---

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: nginx
spec:
  hosts:
  - "example.com"
  gateways:
  - default
  http:
  - route:
    - destination:
        host: nginx

---

apiVersion: v1
kind: Service
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  selector:
    app: nginx
  ports:
    - port: 80
      name: http

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
    version: v1
spec:
  replicas: 2
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: nginx
      version: v1
  template:
    metadata:
      labels:
        app: nginx
        version: v1
    spec:
      containers:
        - name: nginx
          image: nginx:latest
          ports:
            - containerPort: 80
          resources:
            requests:
              memory: 100Mi
              cpu: 100m
            limits:
              memory: 1500Mi
              cpu: 1000m

버전:

$ istioctl version
client version: 1.13.2
control plane version: 1.13.2
data plane version: 1.13.2 (1 proxies)


$ kubectl version --short
Client Version: v1.21.11
Server Version: v1.21.5-eks-bc4871b

답변1

내 문제는 노드에 대해 잘못 구성된 보안 그룹 규칙으로 인해 발생했다는 것을 알았습니다. 노드 간 트래픽을 허용하지 않아 istio 수신 게이트웨이가 다른 노드의 Pod와 통신하는 것을 방지했습니다.

AWS EKS Terraform 모듈을 사용하여 다음을 추가했습니다.


  node_security_group_additional_rules = {

    ingress_self_all = {
      description = "Node to node all ports/protocols"
      protocol    = "-1"
      from_port   = 0
      to_port     = 0
      type        = "ingress"
      self        = true
    }
    egress_all = {
      description = "Node all egress"
      protocol    = "-1"
      from_port   = 0
      to_port     = 0
      type        = "egress"
      cidr_blocks = ["0.0.0.0/0"]
    }
  }

관련 정보