Istio의 사이드카(Sidecar) 기반 아키텍처는 각 Pod 옆에 Envoy Proxy를 배치하여 트래픽을 제어합니다.
이 패턴은 관찰성과 보안을 향상시키지만, 리소스 오버헤드가 있는 구조입니다.
본 글에서는 Terraform을 이용해 AWS EKS 클러스터 상에 사이드카 모드 Istio를 설치하고, ALB Ingress Controller와 연동하여 외부 트래픽을 수용하는 구조를 구성합니다.
컴포넌트 | 설명 |
---|---|
istio-base | Istio 공통 리소스 설치 (CRDs 등) |
istiod | 사이드카 기반 Istio 제어 플레인 |
istio-ingressgateway | 외부 진입점 게이트웨이 (NodePort로 배포) |
Gateway 리소스 | Istio Gateway CR |
ALB용 Ingress 리소스 | 서비스/모니터링용 ALB Ingress 정의 |
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"
})
]
}
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
depends_on = [ helm_release.istio_base ]
}
resource "helm_release" "istio_ingress" {
namespace = "istio-ingress"
create_namespace = true
name = "istio-ingress"
repository = "https://istio-release.storage.googleapis.com/charts"
chart = "gateway"
upgrade_install = true
values = [
yamlencode({
_internal_defaults_do_not_set = {
service = {
type = "NodePort"
}
}
extraManifests = []
})
]
depends_on = [ helm_release.istio_base, helm_release.istiod ]
}
resource "kubectl_manifest" "istio_gateway" {
yaml_body = file("${path.module}/manifests/istio-gateway.yaml")
depends_on = [
helm_release.istio_base,
helm_release.istiod,
helm_release.istio_ingress
]
}
resource "kubectl_manifest" "ingress_for_services" {
yaml_body = templatefile("${path.module}/manifests/ingress-for-serivces.yaml", {
ALB_NAME_SVC = "${local.cluster_name}-svc-ingress"
PUBLIC_SUBNET_IDS = join(",", aws_subnet.public[*].id)
ACM_CERT_ARN = data.aws_acm_certificate.cert.arn
ISTIO_INGRESS_HEALTHCHECK_PORT = tostring([
for p in data.kubernetes_service.istio_ingressgateway.spec[0].port :
p.node_port if p.port == 15021
][0])
WAF_ACL_ARN = ""
})
depends_on = [
helm_release.istio_base,
helm_release.istiod,
helm_release.istio_ingress,
kubectl_manifest.istio_gateway
]
}
resource "kubectl_manifest" "ingress_for_addons" {
yaml_body = templatefile("${path.module}/manifests/ingress-for-addons.yaml", {
ALB_NAME_ADDON = "${local.cluster_name}-addon-ingress"
PUBLIC_SUBNET_IDS = join(",", aws_subnet.public[*].id)
ACM_CERT_ARN = data.aws_acm_certificate.cert.arn
ISTIO_INGRESS_HEALTHCHECK_PORT = tostring([
for p in data.kubernetes_service.istio_ingressgateway.spec[0].port :
p.node_port if p.port == 15021
][0])
WAF_ACL_ARN = ""
})
depends_on = [
helm_release.istio_base,
helm_release.istiod,
helm_release.istio_ingress,
kubectl_manifest.istio_gateway
]
}
본 구성은 다음의 특징을 가집니다:
실제 운영에서도 활용 가능한 안정적인 Sidecar + ALB 아키텍처입니다.