Istio Ingress ゲートウェイは、サービスに対して複数のレプリカに接続できません。

Istio Ingress ゲートウェイは、サービスに対して複数のレプリカに接続できません。

新しい AWS EKS クラスターに Istio を設定し、テスト用に基本的な nginx デプロイメントを作成しました。デプロイメントにレプリカが 1 つしかない場合、100 ミリ秒未満で応答し、完璧に動作します。レプリカを 1 つ追加すると、新しいポッドの応答時間が大幅に増加し、平均で約 10 秒になります。

他の方からの提案に基づいて、メッシュ構成自動再試行を無効にするには:

meshConfig:
   defaultHttpRetryPolicy: {}

この問題が発生した後、2 番目のポッドへのリクエストが常に失敗していることがわかりました。

"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 イングレス ゲートウェイが他のノードのポッドと通信できませんでした。

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"]
    }
  }

関連情報