Meshed Gatewayとは
Meshed GatewayはService Meshに統合されたゲートウェイです。従来のIngress Controllerと異なり、外部トラフィックを受信した瞬間からService Meshの管理下で処理します。
従来のIngress Controllerとの比較
従来のNginx Ingress
[外部クライアント] --HTTPS--> [Nginx Pod] --HTTP--> [アプリPod + Sidecar]
↑ ↑
独立コンポーネント 部分的なMesh連携
Meshed Gateway
[外部クライアント] --HTTPS--> [Gateway Pod] ==mTLS==> [アプリPod]
nginx + istio-proxy app + istio-proxy
↑ ↑
Meshの完全な一員 完全なMesh管理
主な違い:
- GatewayがService Meshの一部として動作
- 外部トラフィックが即座にMesh管理下に移行
- 統一されたセキュリティポリシーと監視
内部トラフィックフロー
Gateway Pod内部では以下の処理が行われます:
┌─────────────────────────────────┐
│ Gateway Pod │
│ ┌─────────────────────────────┐ │
│ │ nginx (port 443) │ │ ← HTTPS受信
│ └──────────┬──────────────────┘ │
│ ↓ localhost転送 │
│ ┌─────────────────────────────┐ │
│ │ istio-proxy (port 15001) │ │ ← iptablesによるキャプチャ
│ │ → mTLS暗号化 │ │ 暗号化してバックエンドへ送信
│ └─────────────────────────────┘ │
│ └─────────────────────────────┘ │
└─────────────────────────────────┘
処理フロー:
- 外部クライアントからHTTPSリクエスト受信
- nginxが443ポートで処理
- nginxがバックエンドサービスへ転送
- iptablesがトラフィックをキャプチャ
- istio-proxyがmTLS暗号化して送信
統一トラフィック管理
Meshed Gatewayでは単一のVirtualServiceでトラフィック制御が可能です:
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
spec:
gateways:
- my-gateway
http:
- match:
- headers:
canary: "true"
route:
- destination:
host: backend
subset: v2
weight: 100 # カナリアユーザーを新バージョンにルーティング
Gateway API統合
Gateway APIのinfrastructure
フィールドでMesh統合を設定:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: meshed-gateway
spec:
gatewayClassName: nginx
infrastructure:
labels:
istio-injection: enabled # Istio Sidecar注入
annotations:
linkerd.io/inject: enabled # Linkerd Sidecar注入
listeners:
- name: https
protocol: HTTPS
port: 443
主要なメリット
統合管理:
- Service Meshの一員として動作
- 外部トラフィックの即座なMesh統合
- 統一されたセキュリティ、監視、トラフィック制御
運用効率:
- 単一設定での包括的制御
- Gateway APIによる標準化
- 複数Mesh環境での一貫した運用