Istio Ambient Mesh는 사이드카(Sidecar) 없이 서비스 메시를 구성할 수 있는 새로운 아키텍처입니다.
운영 오버헤드를 줄이고, 필요한 컴포넌트만 점진적으로 도입할 수 있다는 점에서 기존 Istio 구조보다 효율적입니다.
또한, Kubernetes Gateway API는 기존 Ingress의 단점을 보완하는 네트워크 표준으로, Istio Ambient Mesh와 자연스럽게 결합됩니다.
이 글에서는 Terraform으로 AWS EKS 클러스터에 Istio Ambient Mesh와 Gateway API를 설치하고, ALB와 연동해 외부 트래픽을 받는 환경을 구성합니다.
설치 개요
Terraform으로 아래 컴포넌트를 설치합니다.
| 컴포넌트 | 설명 |
|---|---|
istio-base |
Istio 공통 리소스 설치 (CRDs 등) |
gateway-api CRDs |
Gateway API 리소스 정의 |
istiod (ambient) |
Ambient Mesh 전용 제어 플레인 |
istio-cni |
Ambient Mesh용 CNI |
ztunnel |
L4 터널링 기능을 수행하는 Proxy |
gateway-api.yaml |
Gateway + HTTPRoute 정의, ACM 인증서 기반 ALB 연동 |
Istio Ambient Mesh와 Gateway API의 Terraform 리소스 관계
Istio Ambient Mesh와 Gateway API의 Terraform 리소스 관계
그림 관계를 글로 읽기
- Gateway API CRD는 istio-base에 의존한다.
- istiod(profile ambient)는 istio-base와 Gateway API CRD에 의존한다.
- istio-cni(profile ambient)는 istio-base, CRD, istiod에 의존한다.
- ztunnel(L4 프록시)은 istio-base, CRD, istiod, istio-cni에 의존한다.
- Gateway 리소스(gateway-api.yaml)는 Gateway API CRD에 의존한다.
- Gateway는 ACM_CERT_ARN을 aws-load-balancer-ssl-cert 주석으로 받는다.
- 리스너 allowedRoutes는 shared-gateway-access: "true" 라벨이 있는 Namespace만 허용한다.
1. istio-base 설치
Ambient Mesh 설치의 기본이 되는 Helm 차트입니다.
resource "helm_release" "istio_base" {
namespace = "istio-system"
create_namespace = true
name = "istio-base"
repository = "https://istio-release.storage.googleapis.com/charts"
chart = "base"
upgrade_install = true
values = [
yamlencode({
defaultRevision = "default"
})
]
}
2. Gateway API CRD 설치
Gateway API는 Ingress를 대체할 수 있는 API이며, Istio가 공식 지원합니다.
data "http" "gateway_api_crds" {
url = "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml"
}
data "kubectl_file_documents" "gateway_api_docs" {
content = data.http.gateway_api_crds.response_body
}
resource "kubectl_manifest" "gateway_api_crds" {
for_each = data.kubectl_file_documents.gateway_api_docs.manifests
yaml_body = each.value
depends_on = [ helm_release.istio_base ]
}
3. istiod 설치 (Ambient 모드)
사이드카가 없는 Ambient Mesh용으로 profile = "ambient" 옵션을 사용합니다.
resource "helm_release" "istiod" {
namespace = "istio-system"
create_namespace = true
name = "istiod"
repository = "https://istio-release.storage.googleapis.com/charts"
chart = "istiod"
upgrade_install = true
values = [
yamlencode({
profile = "ambient"
})
]
depends_on = [ helm_release.istio_base, kubectl_manifest.gateway_api_crds ]
}
4. Istio CNI 및 Ztunnel 설치
Ztunnel은 L4 프록시 역할을 하는 Ambient Mesh의 핵심 구성요소입니다.
resource "helm_release" "istio_cni" {
name = "istio-cni"
chart = "cni"
repository = "https://istio-release.storage.googleapis.com/charts"
namespace = "istio-system"
create_namespace = true
upgrade_install = true
values = [
yamlencode({
profile = "ambient"
})
]
depends_on = [
helm_release.istio_base,
kubectl_manifest.gateway_api_crds,
helm_release.istiod
]
}
resource "helm_release" "ztunnel" {
name = "ztunnel"
chart = "ztunnel"
repository = "https://istio-release.storage.googleapis.com/charts"
namespace = "istio-system"
create_namespace = true
upgrade_install = true
depends_on = [
helm_release.istio_base,
kubectl_manifest.gateway_api_crds,
helm_release.istiod,
helm_release.istio_cni
]
}
5. Gateway API 리소스 설치
ALB를 통해 외부에서 접근 가능한 Gateway를 구성합니다. 이때 ACM 인증서를 활용합니다.
resource "kubectl_manifest" "gateway" {
yaml_body = templatefile("${path.module}/manifests/gateway-api.yaml", {
ACM_CERT_ARN = data.aws_acm_certificate.cert.arn
})
depends_on = [
kubectl_manifest.gateway_api_crds
]
}
위 gateway-api.yaml은
GatewayClass,Gateway,HTTPRoute등을 포함하며 ALB와 트래픽 라우팅 설정을 구성합니다.
gateway-api.yaml
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: gateway
namespace: istio-system
annotations:
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-attributes: "load_balancing.cross_zone.enabled=true"
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "${ACM_CERT_ARN}"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
spec:
gatewayClassName: istio
listeners:
- name: http
hostname: "*.dongdorrong.com"
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
shared-gateway-access: "true"
- name: https
hostname: "*.dongdorrong.com"
port: 443
protocol: HTTP
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
shared-gateway-access: "true"
마무리
Terraform으로 자동화한 구성은 아래와 같습니다.
- Istio Ambient Mesh의 구성 요소 전체 설치
- Gateway API CRD 및 리소스 구성
이후에는 서비스 네임스페이스에 istio.io/dataplane-mode=ambient 라벨을 붙이고, Waypoint Proxy, HTTPRoute 등으로 L7 제어까지 확장할 수 있습니다.