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 연동 |
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"
})
]
}
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 ]
}
사이드카가 없는 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 ]
}
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
]
}
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와 트래픽 라우팅 설정을 구성합니다.
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.io/dataplane-mode=ambient
라벨을 붙이고, Waypoint Proxy, HTTPRoute 등으로 L7 제어까지 확장할 수 있습니다.