게시 2026-11-21Published 2026-11-21Container읽는 시간 20분20 min read직접 테스트: 서울 리전의 Amazon EKS 환경 하나, 측정 횟수는 표마다 표기Tested first-hand: One Amazon EKS environment in the Seoul Region, the number of runs is given with each table

OpenWeight on AWS GPU 3부: 10개 단계로 따라 하는 구축 과정OpenWeight on AWS GPU, Part 3: Building the environment in ten steps

오픈 웨이트 모델 두 개를 서빙하는 환경은 어떤 순서로 만들고 단계마다 무엇을 확인해야 할까요? 이 환경은 VPC와 Amazon EKS, 모델 적재, vLLM, 게이트웨이, Strands Decider 12B, sleep 컨트롤러, 앱 계층, 관측의 순서로 만들었습니다. 단계마다 정한 확인을 마친 뒤 다음 단계로 넘어갔습니다. 9단계인 정리는 아직 실행하지 않아 계획한 순서만 적었습니다.In what order do you build an environment that serves two open-weight models, and what do you check after each step? This one was built in the order VPC and Amazon EKS, model sync, vLLM, the gateway, Strands Decider 12B, the sleep controller, the app layer and observability, and each step moved on only after its checks passed. Step 9, cleanup, has not been run yet, so only the planned order is given.

#Amazon EKS#vLLM#Karpenter#Terraform#Gateway API Inference Extension#LLM inference

두 모델이 답하는 로그인 페이지까지 10개 단계

0단계에서 8단계까지 마치면 로그인 페이지에서 요청을 보내고 두 모델의 답을 토큰 단위로 받습니다. 요청은 Amazon CloudFront, 내부 Application Load Balancer(ALB), BFF(Backend for Frontend), 게이트웨이를 차례로 지납니다. 그 끝에 GPU 노드의 vLLM 파드가 있습니다. BFF는 로그인 토큰을 검증하고 요청을 어느 모델로 보낼지 정하는 앱입니다.

그림 1은 완성된 환경의 구성 요소마다 그것을 만드는 단계의 번호를 붙인 구조도입니다. 아래쪽 카드 10개가 이 글에서 따라갈 단계입니다.

완성된 환경의 구조도에 구성 요소를 만든 단계의 번호를 붙인 그림. 요청 경로의 CloudFront, 내부 ALB, BFF, Cognito, S3 페이지는 7단계, 게이트웨이는 4단계, Decider 12B는 5단계, 깨우기 API는 6단계, GPU 노드의 Gemma 4 31B와 Qwen3.8-27B, compile 캐시는 3단계, S3 모델 버킷과 Pod Identity, Karpenter NodePool은 1단계, 모델 적재 Job은 2단계, AMP는 8단계에 만들고 아래쪽에 0단계에서 9단계의 이름과 도구를 카드로 정리했다.
그림 1. 구축 단계와 아키텍처. 원 안의 번호는 그 구성 요소를 만든 단계이고 파란 글자는 사용한 도구입니다. 웹 검색은 8단계 뒤에 BFF의 도구로 더해 +로 표시했습니다.

이 글은 시리즈 "OpenWeight on AWS GPU(OW on GPU)"의 3부입니다. 이 시리즈는 오픈 웨이트 모델을 AWS의 GPU 인스턴스에서 직접 서빙하는 방법을 다룹니다. 예제 환경은 Amazon Elastic Kubernetes Service(Amazon EKS)에서 오픈 소스 추론 엔진 vLLM으로 Gemma 4 31B와 Qwen3.8-27B를 함께 서빙합니다. 1부는 API 호출 한 건이 지나는 8개 단계를 따라갔습니다. 2부는 두 모델을 서빙하는 구조와 Amazon EKS 최적화를 설명했습니다.

3부는 이 환경을 처음부터 만드는 순서입니다. VPC를 만드는 것에서 시작해 로그인한 브라우저에 두 모델의 답이 스트리밍될 때까지를 10개 단계(0단계에서 9단계)로 나눴습니다. 단계마다 만드는 것, 명령, 확인 방법, 측정한 값, 막히기 쉬운 곳을 같은 순서로 적었습니다. 코드와 매니페스트는 공개 저장소 ow-on-gpu에 있으므로 저장소를 열어 두고 읽는 것을 권합니다. 본문의 값은 2026년 11월 14일과 15일에 서울 리전(ap-northeast-2)에서 측정했고 측정 횟수는 표에 적었습니다. 5단계 Strands Decider 12B의 값은 2026년 11월 24일에 측정했습니다. 이 글은 Kubernetes와 AWS의 기본 개념(파드, Deployment, VPC, IAM)을 알고 LLM 서빙 환경을 처음 구축하는 엔지니어를 대상으로 합니다.

모든 구성 요소가 실행 중일 때 클러스터의 노드는 9대입니다.

노드 그룹 또는 NodePool인스턴스대수실행하는 것
addons (관리형 노드 그룹)m7g.large2Karpenter, CoreDNS, AWS Load Balancer Controller
systemc7i-flex.xlarge2게이트웨이 계층, 지표 수집기
appc7g.large2BFF 파드 2개
gemma-od, qwen-odg6e.4xlarge (NVIDIA L40S 1장)2Gemma 4 31B, Qwen3.8-27B
deciderg6e.xlarge (NVIDIA L40S 1장)1Strands Decider 12B

표 1. 완성된 환경의 노드 9대(2026년 11월 26일 확인). addons를 뺀 노드는 Karpenter가 NodePool의 조건에 맞춰 만듭니다.

01

준비물과 작업 규칙

시작하기 전에 계정의 할당량, 명령줄 도구, 비용을 확인합니다.

준비물내용
AWS 계정서울 리전에서 g6e.4xlarge 2대와 g6e.xlarge 1대를 실행할 수 있는 G 계열 On-Demand 할당량(36 vCPU)
명령줄 도구AWS CLI, kubectl, Helm, Terraform 1.14 이상, Docker, Node.js와 npm
저장소의 훅과 시험이 사용하는 도구jq, python3, Bash 4 이상
작업 장비arm64와 amd64 이미지를 만들 수 있는 장비. BFF 이미지는 arm64, Decider 12B 이미지는 amd64입니다
비용모든 구성 요소가 실행 중일 때 시간당 약 11.35 USD

표 2. 준비물. 비용은 고정 비용의 세전 USD 추정치입니다. 2026년 11월 15일의 추정값 약 10.05 USD에 11월 24일에 바꾼 Decider 노드의 가격 차이(시간당 1.2984 USD)를 더했고 사용량에 따라 부과되는 요금은 포함하지 않았습니다.

GPU 노드는 실행 중인 동안 과금됩니다. 실습을 멈출 때 지우는 순서는 9단계에 적었습니다. 모든 단계는 저장소의 AGENT.md에 적힌 작업 규칙을 따릅니다.

  • AWS 리소스를 만들거나 바꾸기 전에 terraform plan 또는 kubectl diff의 결과를 먼저 읽고 적용합니다.
  • CRD 필드, Helm values, vLLM 플래그는 설치한 버전에서 확인합니다. kubectl explain, helm show values, 이미지 안의 vllm serve --help를 사용합니다.
  • 자격 증명은 코드와 매니페스트에 넣지 않습니다. AWS 권한은 EKS Pod Identity로 연결한 IAM 역할로만 부여합니다.
  • 환경마다 다른 값이 든 파일 5개는 저장소에 없고 자리 표시만 든 *.example이 있습니다.
  • GPU 노드가 뜨는 적용은 실행하기 전에 따로 확인합니다.
  • 문서에는 측정한 값만 적고 원시 자료는 results/ 아래에 둡니다.

저장소 준비

bash
git clone https://github.com/whchoi98/ow-on-gpu.git
cd ow-on-gpu
bash scripts/setup.sh
bash tests/run-all.sh

scripts/setup.sh는 AWS 리소스를 만들지 않습니다. 도구 확인, git 훅 설치, *.example 파일 복사, 확인용 페이지의 의존성 설치만 합니다. 복사된 파일의 자리 표시는 표 3의 값으로 바꿉니다. Terraform 출력에서 읽는 값은 1단계를 적용한 뒤에 채웁니다.

파일채울 값
infra/terraform/terraform.tfvarsEKS API에 접근을 허용할 작업 장비의 공인 IP
k8s/base/params.yaml, jobs/model-sync/params.env, bench/coldstart/k8s/storage-s3.yaml모델 버킷 이름. terraform -chdir=infra/terraform output -raw model_bucket
k8s/observability/prometheus.ymlPrometheus 워크스페이스 ID. terraform -chdir=infra/terraform output -raw amp_workspace_id

표 3. 환경마다 다른 값이 든 파일 5개와 채울 값.

02

AWS CDK, Terraform, kubectl로 나눈 10개 단계의 순서

도구는 맡는 범위가 나뉘어 있습니다. AWS CDK는 VPC와 서브넷, 엔드포인트를 만듭니다. Terraform은 그 VPC를 조회해 Amazon EKS와 계정 수준의 리소스를 만듭니다. kubectl과 Helm은 클러스터 안의 리소스를 적용합니다. 표 4는 단계마다 만드는 것과 도구, 코드의 위치입니다.

단계만드는 것도구코드
0버전 조합, 체크포인트, 할당량 확인 (리소스 없음)AWS CLI-
1VPC, EKS, Karpenter, 모델 버킷, NodePoolAWS CDK, Terraform, kubectlinfra/cdk-vpc, infra/terraform, k8s/base
2Amazon S3에 모델 3종 적재kubectl (Job)jobs/model-sync
3vLLM 파드 2개, compile 캐시 게시kubectlk8s/gemma, k8s/qwen, jobs/cache-publish
4게이트웨이 계층Helm, kubectlk8s/gateway
5Strands Decider 12BTerraform, Docker, kubectlk8s/decider, infra/terraform
6sleep 컨트롤러kubectlk8s/sleep-controller
7CloudFront, AWS WAF, Amazon Cognito, 내부 ALB, BFFTerraform, kubectl, Dockerapp/bff, app/web, k8s/bff, infra/terraform
8지표 수집과 측정kubectl, Pythonk8s/observability, bench
9정리 (아직 실행하지 않음)계획만 있음-

표 4. 10개 단계와 코드의 위치. 단계 번호는 그림 1의 원 안의 번호와 같습니다.

단계의 순서는 의존 관계를 따릅니다. 뒤 단계의 스크립트는 앞 단계의 Terraform 출력에서 이미지 주소와 Amazon Cognito 값을 읽습니다. 서빙 파드는 2단계가 Amazon S3에 올린 객체만 읽습니다. GPU 노드는 미리 만들어 두지 않고 파드가 생길 때 Karpenter가 만듭니다. 7단계에서는 내부 ALB를 AWS Load Balancer Controller가 만든 뒤에야 CloudFront를 연결할 수 있어 Terraform을 앞뒤로 두 번 적용합니다.

03

기반을 만드는 0단계에서 2단계

0단계 사전 확인

이 단계에서는 리소스를 만들지 않습니다. 버전 조합, 체크포인트, 서비스 할당량을 읽기 전용 조회로 확인합니다. 체크포인트는 학습된 가중치를 저장한 파일 묶음입니다. 확인한 내용은 docs/00-versions.md에 있습니다.

bash
aws service-quotas list-service-quotas --service-code ec2 --region ap-northeast-2

AZ별 제공 여부는 aws ec2 describe-instance-type-offerings --location-type availability-zone으로 조회했습니다.

확인한 것값
버전 조합EKS 1.37, Karpenter v1.15.2, AWS Load Balancer Controller v3.6.3, Gateway API CRD v1.6.3, GAIE CRD v1.6.2, llm-d-router v1.0.0, agentgateway v1.7.0, vLLM v0.33.0
체크포인트Gemma 4 31B는 RedHatAI/gemma-4-31B-it-FP8-dynamic(33.30GB), Qwen3.8-27B는 AzatAI/Qwen3.8-27B-FP8-dynamic(36.80GB)
G 계열 On-Demand 할당량이 계정은 768 vCPU. 이 구성에 필요한 양은 36 vCPU
AZ별 제공g6e.4xlarge와 g6e.xlarge는 2a와 2b

표 5. 0단계에서 확인한 값(2026년 11월 14일 조회, g6e.xlarge의 AZ는 11월 24일 조회). 크기는 저장소 파일 크기의 합이고 1GB는 10^9바이트입니다.

막히기 쉬운 곳입니다.

  • 최신 버전끼리도 지원 범위가 어긋납니다. Gateway API CRD는 최신 v1.7.0이 agentgateway 1.7.x의 지원 범위(1.4에서 1.6) 밖이어서 v1.6.3을 사용했습니다.
  • 체크포인트는 GPU에 맞춰 고릅니다. L40S(Ada 세대)에는 vLLM 문서가 지원을 명시한 FP8 체크포인트를 골랐습니다. FP8은 가중치를 8비트 부동소수점으로 줄인 양자화 형식입니다. Qwen3.8-27B의 공식 block FP8은 CUTLASS 커널이 SM 9.0 이상에서만 지원되는데 L40S는 SM 8.9입니다. 그래서 per-channel FP8-dynamic을 사용했습니다.

1단계 네트워크와 EKS 기반

VPC는 AWS CDK 스택 EksVpcStack으로 만듭니다. 대역은 10.200.0.0/16이고 4개 AZ에 Public, Private, Isolated 서브넷을 두며 워크로드는 Private 서브넷에서 실행합니다. Terraform은 이 VPC를 조회해 EKS 1.37 클러스터, 애드온, Karpenter, AWS Load Balancer Controller, 모델 버킷, IAM 역할을 만듭니다. k8s/base는 네임스페이스, NodePool 4개(gemma-od, qwen-od, decider, system), EC2NodeClass, NVIDIA device plugin을 적용합니다.

bash
(cd infra/cdk-vpc && npx cdk deploy)
terraform -chdir=infra/terraform plan
terraform -chdir=infra/terraform apply
# 아래 명령은 kubeconfig를 만드는 명령을 출력합니다. 출력된 명령을 확인한 뒤 실행합니다
terraform -chdir=infra/terraform output -raw update_kubeconfig
export KUBECONFIG=$PWD/infra/terraform/.kubeconfig
kubectl apply -k k8s/base
확인할 것결과
terraform validate, kubectl apply --dry-run=server두 검사가 통과
kubectl get nodes클러스터에 연결됨. 애드온용 관리형 노드 그룹은 m7g.large 2대
VPC10.200.0.0/16, AZ 4개
GPU 노드이 단계에서는 없음. 3단계와 5단계에서 파드가 생길 때 Karpenter가 만듦

표 6. 1단계의 확인 항목.

막히기 쉬운 곳입니다.

  • kubectl apply -k k8s/base 전에 k8s/base/params.yaml의 모델 버킷 이름을 Terraform 출력으로 채웁니다.
  • GPU NodePool에는 taint를 두고 NodePool마다 GPU를 1장까지만 허용합니다. 노드가 의도하지 않게 늘어나는 것을 막는 설정입니다.
  • EC2NodeClass는 NVIDIA 드라이버가 든 EKS 최적화 AMI를 사용합니다. userData로 vLLM 이미지를 미리 받고 로컬 NVMe를 인스턴스 스토어로 사용합니다.
  • kubectl은 프로젝트 전용 kubeconfig로 실행합니다. 공유 장비의 기본 컨텍스트를 바꾸지 않기 위해서입니다.

2단계 모델 적재

적재 Job이 Hugging Face의 저장소 3개를 Amazon S3의 모델 버킷에 올립니다. Gemma 4 31B, Qwen3.8-27B, 5단계에서 배포할 Strands Decider 12B입니다. Decider 12B의 체크포인트는 가중치를 모두 담고 있어 기반 모델을 따로 올리지 않습니다. Job은 한 번만 실행하고 그 뒤로 서빙 파드는 Amazon S3에서만 읽습니다. 파일을 받는 대로 s5cmd pipe로 올려 가중치를 로컬 디스크에 쌓지 않습니다. 파일은 8개를 동시에 처리합니다.

bash
kubectl apply -k jobs/model-sync
kubectl -n model-jobs logs -f job/model-sync
kubectl -n model-jobs wait --for=condition=complete job/model-sync --timeout=60m
확인할 것첫 적재 (2026년 11월 14일)Decider 12B 추가 (2026년 11월 24일)
Job 로그의 verified 줄객체 수와 크기가 기대값과 일치객체 수와 크기가 기대값과 일치
Job 로그의 summary 줄객체 73개, 74.90GB객체 13개, 23.97GB. 이미 있는 32개는 건너뜀
전송과 검증에 걸린 시간491.4초314.9초
Job 시작부터 완료까지9분 8초6분 35초

표 7. 2단계의 확인 항목과 측정한 값(1회씩). 첫 적재의 값에는 당시 사용하던 Decider v1과 그 기반 모델이 들어 있습니다. 지금의 저장소 3개를 합치면 객체 45개, 94.07GB입니다.

막히기 쉬운 곳입니다.

  • jobs/model-sync/params.env의 BUCKET은 Terraform 출력 model_bucket과 같아야 합니다.
  • 다시 실행하려면 kubectl -n model-jobs delete job model-sync로 Job을 지우고 적용합니다. Job의 파드 템플릿은 바꿀 수 없기 때문입니다. Job을 지우면 로그도 사라지므로 먼저 저장합니다.
  • 저장소는 리비전 해시로 고정했습니다. Job은 받으면서 계산한 해시를 Hugging Face가 알려 준 값과 비교합니다. 끝나면 S3의 객체 목록을 기대값과 비교하고 다르면 실패합니다.

04

모델을 서빙하는 3단계에서 6단계

3단계 vLLM 배포

Gemma 4 31B와 Qwen3.8-27B를 g6e.4xlarge 노드에 한 대씩 배포합니다. 이 단계에서 GPU 노드 2대가 뜹니다. 가중치는 runai_streamer 로더로 Amazon S3에서 직접 읽습니다. initContainer는 S3의 compile 캐시를 노드의 hostPath로 내려받습니다. compile 캐시는 vLLM이 엔진을 초기화할 때 만드는 torch.compile 결과물입니다. 첫 기동 뒤에는 캐시 게시 Job이 이 캐시를 S3에 올려 다음 기동이 사용하게 합니다.

bash
kubectl diff -k k8s/gemma
kubectl apply -k k8s/gemma
kubectl apply -k k8s/qwen
kubectl apply -k jobs/cache-publish

확인은 네임스페이스 inference에 있는 vLLM 파드(vllm-gemma, vllm-qwen)의 로그에서 합니다. 가중치 로드와 엔진 초기화가 끝나면 아래 두 줄이 나옵니다. Gemma 4 31B의 첫 기동에서 나온 값입니다.

text
Model loading took 30.63 GiB memory and 19.106861 seconds
init engine (profile, create kv cache, warmup model) took 95.84 s (compilation: 61.03 s)
항목Gemma 4 31BQwen3.8-27B
가중치 로드19.1초34.3초
가중치가 차지한 GPU 메모리30.63GiB34.39GiB
KV 캐시5.37GiB (34,052토큰)2.46GiB (42,780토큰)
엔진 초기화95.84초 (compile 캐시 없음)57.85초 (compile 캐시 적중)
게시한 compile 캐시객체 522개, 90.8MB객체 2,056개, 216.7MB

표 8. 3단계에서 측정한 값(2026년 11월 14일, 첫 기동 1회). KV 캐시는 처리 중인 요청의 토큰별 중간 계산 결과를 담는 GPU 메모리입니다. Qwen3.8-27B의 2.46GiB는 이 첫 기동 로그의 값이고 2부의 처리량 측정 때 로그에는 2.45GiB로 기록됐습니다.

막히기 쉬운 곳입니다.

  • 플래그는 이미지 안에서 vllm serve --help로 확인한 뒤 사용합니다. v0.33.0 이미지에 이 구성의 플래그 14개가 모두 있었습니다.
  • Qwen3.8-27B는 --gpu-memory-utilization 0.85에서 엔진이 시작하지 못해 컨테이너가 다시 시작됐고 0.90에서 시작했습니다. 원인은 2부에 있습니다. --max-num-seqs도 기본값 1024에서는 엔진이 시작하지 못해 32로 두었습니다.
  • Qwen3.8-27B의 readinessProbe는 /health가 아닌 /is_sleeping을 확인하고 그 이유는 2부에 있습니다.
  • compile 캐시의 S3 prefix에는 vLLM 버전, 모델, 정밀도, GPU 아키텍처를 넣습니다. 구성이 하나라도 바뀌면 새 prefix로 게시합니다.

4단계 GAIE와 게이트웨이

요청 본문의 model 값으로 모델별 파드 묶음을 고르는 게이트웨이 계층을 설치합니다. Gateway API Inference Extension(GAIE)은 추론 요청을 모델 서버 파드의 묶음인 InferencePool로 보내는 Gateway API 확장입니다. EPP(Endpoint Picker)는 풀 안에서 요청을 보낼 파드를 고릅니다. 게이트웨이 구현체는 agentgateway입니다. agentgateway가 본문의 model 값을 헤더로 옮기고 HTTPRoute가 그 헤더로 풀을 고릅니다.

bash
k8s/gateway/install.sh render | kubectl diff -f -
k8s/gateway/install.sh apply

apply는 CRD, agentgateway, 모델별 EPP와 InferencePool, Gateway를 순서대로 적용하고 72초 걸렸습니다. 표 9는 클러스터 안의 임시 파드에서 게이트웨이의 Service로 요청을 보낸 결과입니다.

확인할 것결과
/v1/chat/completions, model이 gemma-4-31b200, Gemma 4 31B가 응답
/v1/chat/completions, model이 qwen38-27b200, Qwen3.8-27B가 응답
등록하지 않은 model 값404
POST /sleep?level=1404
Gateway, HTTPRoute, InferencePool의 상태Accepted=True, ResolvedRefs=True

표 9. 4단계의 확인 항목(2026년 11월 14일, 요청마다 1회).

막히기 쉬운 곳입니다.

  • HTTPRoute에는 /v1/chat/completions와 /v1/models만 등록합니다. /sleep과 /wake_up 같은 관리 경로는 게이트웨이로 노출되지 않습니다.
  • EPP는 풀마다 2개지만 리더 하나만 요청을 처리합니다. 대기 복제본이 NotReady로 보이는 것은 설계된 동작입니다.
  • 게이트웨이 파드 2개를 AZ 두 곳에 나누려면 topologySpreadConstraints에 minDomains: 2와 matchLabelKeys: [pod-template-hash]를 함께 둬야 했습니다.
  • 게이트웨이의 내부 Network Load Balancer(NLB)는 클러스터 밖의 배치 클라이언트용입니다. BFF는 게이트웨이의 Service를 직접 호출합니다.

5단계 Strands Decider 12B

Strands Decider 12B(이하 Decider 12B)는 요청을 읽고 어느 모델이 맡을지 판단하는 모델입니다. BFF는 규칙과 업무 종류로 모델이 정해지지 않은 요청만 Decider 12B에 묻습니다. g6e.xlarge 노드에 파드 하나로 배포합니다. 게이트웨이의 HTTPRoute가 POST /decide를 Decider 12B의 /v1/systemone으로 경로를 바꿔 보냅니다. InferencePool은 사용하지 않습니다. 이 환경은 2026년 11월 24일에 Decider를 v1의 2B 모델(g6.xlarge)에서 Strands Decider v2의 12B 모델로 바꿨고 아래는 v2의 절차와 측정값입니다.

서빙 이미지는 직접 빌드합니다. v2의 체크포인트는 strands-decider 0.4.0 이상에서만 읽히는데 저장소가 안내하는 공개 서빙 이미지는 2026년 11월 20일 빌드까지 0.3.1.dev1을 담고 있었습니다. 그래서 strands-decider 저장소 v0.4.0 태그의 deploy/sagemaker/Dockerfile을 수정 없이 빌드합니다. 빌드한 이미지는 Amazon Elastic Container Registry(Amazon ECR)에 올립니다.

bash
terraform -chdir=infra/terraform apply -target=aws_ecr_repository.decider
k8s/decider/install.sh build
k8s/decider/install.sh diff
k8s/decider/install.sh apply
확인할 것결과와 측정한 값
이미지 빌드 (arm64 장비에서 amd64 에뮬레이션)8분 25초, 압축 크기 3.72GB
/health 응답model이 strands-decider-12B-gemma4-v2-2611, device가 cuda:0
컨테이너 시작부터 Ready43초 (가중치 적재와 예열 포함)
노드가 새로 뜰 때 적용부터 Ready5분 33초 (노드 83초, 모델 받기 101초, 이미지 pull 90.5초)
판단 1회, 게이트웨이 /decide 경유중앙값 89.7ms에서 90.6ms (판단 종류마다 50회)
GPU 메모리L40S의 46,068MiB 가운데 23,725MiB 사용

표 10. 5단계의 확인 항목과 측정한 값(2026년 11월 24일, 1회).

막히기 쉬운 곳입니다.

  • 공개 서빙 이미지에 든 strands-decider의 버전은 태그로 알 수 없습니다. 이미지 설정의 레이블과 패키지 레이어로 확인했습니다. 공개 이미지가 0.4.0 이상을 담으면 그 이미지를 사용하고 빌드 단계를 생략할 수 있습니다.
  • 작업 장비가 arm64이면 amd64 에뮬레이션(binfmt)을 등록한 뒤 빌드합니다. install.sh build는 docker buildx build --platform linux/amd64를 실행합니다. 장비를 재부팅하면 등록이 사라집니다.
  • kubectl apply -k k8s/decider로 직접 적용하지 않습니다. 이미지 주소에 계정 ID가 들어가므로 매니페스트의 ${DECIDER_IMAGE} 자리를 install.sh가 Terraform 출력으로 채웁니다.
  • 예열이 끝날 때까지 /health가 실패하므로 파드는 예열 뒤에 Ready가 됩니다.
  • HF_HUB_OFFLINE=1로 Hugging Face 접근을 막았습니다. 가중치는 initContainer가 Amazon S3에서 받습니다.
  • 이 서버에는 인증이 없습니다. ClusterIP Service와 게이트웨이의 /decide로만 닿게 둡니다.

6단계 sleep 컨트롤러

업무 시간 밖에 Qwen3.8-27B를 재우고 필요할 때 깨우는 구성입니다. vLLM의 sleep mode는 파드를 내리지 않고 GPU 메모리를 비우는 기능이고 동작과 깨어나는 시간은 2부에 있습니다. CronJob 2개가 평일 19:00에 재우고 08:30에 깨웁니다(Asia/Seoul). 깨우기 API는 POST /wake만 제공합니다. BFF가 Qwen3.8-27B로 갈 요청 앞에서 이 API를 호출합니다.

bash
kubectl apply -k k8s/sleep-controller
확인할 것결과와 측정한 값
sleep 진입 (/sleep 응답까지)2.98초
깨우기 응답 뒤 게이트웨이 요청이 성공하기까지1.34초에서 1.40초
잠든 동안 게이트웨이로 보낸 Qwen3.8-27B 요청503
라벨 없는 파드에서 Qwen3.8-27B의 8000 포트와 깨우기 API로 보낸 요청차단

표 11. 6단계의 확인 항목과 측정한 값(2026년 11월 14일, 시간은 5회 측정의 범위).

막히기 쉬운 곳입니다.

  • NetworkPolicy는 Amazon VPC CNI 애드온의 enableNetworkPolicy를 켜야 적용됩니다. 기본값은 꺼짐이어서 그 전에는 정책을 만들어도 적용되지 않습니다. 설정은 infra/terraform/eks.tf에 있습니다.
  • 재울 때는 /sleep?level=1&mode=wait를 호출합니다. 기본값 abort는 진행 중인 요청을 끊습니다.
  • 잠든 파드는 NotReady가 되어 일반 Service에서 빠집니다. 관리 요청은 NotReady 파드의 주소도 반환하는 헤드리스 Service vllm-qwen-admin으로 보냅니다.
  • 파드가 뜬 뒤 첫 sleep은 31.71초 걸렸고 그 뒤로는 2.98초였습니다.

05

사용자 경로와 관측을 만드는 7단계와 8단계

7단계 앱 계층

사용자가 닿는 앞단을 만듭니다. CloudFront와 AWS WAF, Amazon Cognito 사용자 풀, 확인용 페이지를 담는 S3 버킷, BFF 파드, 내부 ALB입니다. BFF는 네임스페이스 app의 파드 2개이고 Karpenter NodePool app이 만든 Graviton 노드(c7g.large) 2대에서 실행합니다. 웹 검색 도구도 BFF에 들어 있습니다. BFF의 IAM 역할에는 Amazon Bedrock AgentCore Web Search(이하 Web Search)를 호출하는 권한 하나만 있습니다. 호출 리전은 us-east-1입니다. 서울 리전에는 이 API가 없기 때문입니다.

내부 ALB는 Terraform이 아닌 AWS Load Balancer Controller가 Ingress에서 만듭니다. 그래서 Terraform, k8s/bff/install.sh, Terraform의 순서로 적용합니다.

bash
terraform -chdir=infra/terraform apply -target=aws_ecr_repository.bff
app/bff/build.sh
app/web/build.sh
terraform -chdir=infra/terraform plan
terraform -chdir=infra/terraform apply
k8s/bff/install.sh diff
k8s/bff/install.sh apply
terraform -chdir=infra/terraform apply
app/bff/create-user.sh <이메일>

순서마다 이유가 있습니다. ECR 저장소가 있어야 app/bff/build.sh가 이미지를 올립니다. 이 스크립트는 arm64 이미지를 만들고 이미지 안에서 BFF 시험을 실행한 뒤 태그를 infra/terraform/bff.auto.tfvars에 적습니다. 가운데 terraform apply는 BFF의 역할과 Pod Identity 연결을 만듭니다. 파드가 만들어질 때 이 연결이 없으면 자격 증명이 주입되지 않아 웹 검색이 실패합니다. k8s/bff/install.sh apply가 NodePool, 파드, Ingress를 적용하면 컨트롤러가 내부 ALB를 만듭니다. 마지막 terraform apply는 그 ALB를 태그로 조회해 CloudFront의 VPC origin에 연결합니다.

확인할 것결과와 측정한 값
kubectl -n app rollout status deploy/bff --timeout=300s파드 2개가 Ready
토큰 없는 POST /v1/chat/completions401
로그인 토큰으로 보낸 상담 요청200, 내용 이벤트 53개가 중앙값 53.5ms 간격으로 도착
CloudFront VPC origin 생성9분 18초
앱 계층의 고정 비용시간당 0.1857 USD (내부 ALB 0.0225, c7g.large 2대 0.1632)

표 12. 7단계의 확인 항목과 측정한 값(2026년 11월 15일, 요청마다 1회). 금액은 세전 USD이고 사용량에 따라 부과되는 요금은 포함하지 않았습니다.

막히기 쉬운 곳입니다.

  • 스트리밍에 맞춰 타임아웃을 늘렸습니다. CloudFront 오리진 응답 타임아웃은 60초(기본 30초), ALB 유휴 제한 시간은 120초(기본 60초)입니다.
  • BFF는 응답을 모으지 않고 받은 Chunk(한 번에 전송되는 응답 단위)를 그대로 전달합니다. 모아서 내보내면 스트리밍이 깨집니다.
  • 가입은 막아 두었고 사용자는 create-user.sh로만 만듭니다. 비밀번호는 프롬프트나 환경 변수 USER_PASSWORD로 받아 Amazon Cognito에만 저장합니다.
  • k8s/bff/install.sh는 자기 디렉터리로 옮겨 가 실행하므로 KUBECONFIG를 절대 경로로 지정합니다. 상대 경로면 localhost:8080에 연결하려다 실패합니다.

8단계 관측과 측정

지표를 Amazon Managed Service for Prometheus(AMP)로 모으고 측정 스크립트를 실행합니다. agent 모드의 Prometheus v3.16.0 하나가 vLLM 파드 2개, EPP 파드 4개, 게이트웨이 파드 2개를 수집해 AMP로 보냅니다. 측정은 콜드 스타트의 구간 분해, 구간별 첫 내용까지의 시간, SLO(서비스 수준 목표) 하 처리량, 우선순위 효과의 4가지이고 스크립트는 bench/ 아래에 있습니다. 부하 발생기는 측정 전용 NodePool bench에서 Job으로 실행합니다.

bash
kubectl apply -k k8s/observability
python3 bench/coldstart/measure.py --model gemma --scenario cold-optimized --out results/2026-11-14-coldstart
python3 bench/job.py --name slo-gemma --service-account gemma --out results/2026-11-14-slo/gemma \
  --env MODEL_NAME=gemma-4-31b --env MODEL_DIR=gemma-4-31B-it-FP8-dynamic \
  --env BASE_URL=http://vllm-gemma.inference.svc:8000 -- bash /bench/run-bench.sh

적용 전에 k8s/observability/prometheus.yml의 워크스페이스 ID를 Terraform 출력 amp_workspace_id로 채웁니다.

확인할 것결과
수집 대상 8개모두 up
대시보드 k8s/observability/dashboards/serving.json의 쿼리 27개모두 값이 나옴

표 13. 8단계의 확인 항목(2026년 11월 14일).

측정 4가지의 결과는 구간별 첫 내용까지의 시간이 1부에, 콜드 스타트와 처리량, 우선순위 효과가 2부에 있습니다.

막히기 쉬운 곳입니다.

  • EPP의 /metrics는 토큰 없이는 401입니다. 수집기의 ServiceAccount 토큰과 ClusterRole ow-on-gpu-metrics-reader로 수집합니다. Qwen3.8-27B의 NetworkPolicy에도 수집기를 허용하는 항목을 더합니다.
  • vllm bench serve는 GPU가 없는 노드에서 "Failed to infer device type"으로 시작하지 못합니다. 측정 파드는 bench/slo/bench_serve.py로 같은 벤치마크 모듈을 직접 호출합니다.
  • 평일 19:00부터 08:30까지는 Qwen3.8-27B가 잠들어 있습니다. 그 시간대에 측정하려면 CronJob qwen-sleep을 suspend합니다.
  • CloudFront 주소로 부하를 걸 때는 Terraform 변수 waf_rate_limit을 올리거나 측정 장비를 예외로 둡니다. AWS WAF 속도 제한(IP당 5분 300회)을 넘기면 한동안 요청이 모두 403으로 돌아옵니다. 제한이 작동한 결과는 1부에 있습니다.

06

로그인부터 모델까지 전체 동작 확인

8단계까지 마쳤다면 노드 목록, 사이트 주소, 인증, 모델까지의 경로를 차례로 확인합니다.

bash
export KUBECONFIG=$PWD/infra/terraform/.kubeconfig
kubectl get nodes -L node.kubernetes.io/instance-type,karpenter.sh/nodepool
terraform -chdir=infra/terraform output -raw app_url
python bench/bff/lang_check_live.py "$(terraform -chdir=infra/terraform output -raw app_url)"
kubectl -n app exec -i <bff-pod> -- python - < bench/bff/lang_check_in_pod.py

노드 목록에는 표 1의 9대가 보입니다. 세 번째 명령이 출력하는 https://<cloudfront-domain> 주소를 열고 7단계에서 만든 사용자로 로그인한 뒤 요청을 보냅니다. 응답 헤더 x-bff-model, x-bff-decision, x-bff-search, x-bff-timing이 그 요청의 모델, 결정 근거, 웹 검색 여부, BFF 안의 구간 시간을 알려 줍니다. 헤더를 읽는 방법은 1부에 있습니다.

나머지 두 명령은 비밀번호 없이 실행하는 확인입니다. lang_check_live.py는 토큰 없는 요청이 401로 돌아오는지와 페이지 오류를 봅니다. lang_check_in_pod.py는 BFF 파드 안에서 같은 앱을 토큰 검증기만 바꿔 띄우고 요청을 실제 모델까지 보냅니다.

07

증상으로 찾는 자주 막히는 곳

표 14에는 이 환경을 만들면서 실제로 겪은 증상 가운데 단계별 목록에 적지 않은 것을 모았습니다. 오류 문구로 찾을 수 있게 증상을 먼저 적었습니다.

증상원인조치단계
terraform plan이 helm_release.karpenter에서 실패-target 없이 전체를 plan하면 레지스트리 로그인에서 실패변경 범위를 -target으로 좁힘7
보안 그룹 교체가 couldn't find all security groups로 실패AWS Load Balancer Controller가 어노테이션의 이름을 Name 태그에서 찾음Terraform의 보안 그룹에 Name 태그를 붙임7
배치 요청이 429로 거절됨batch의 priority가 -1이어서 풀이 포화되면 대기하지 않고 거절됨배치 클라이언트의 재시도 간격을 늘림4
kubectl diff에 작성하지 않은 줄이 보임서버 dry-run이라 클러스터의 웹훅이 더하는 줄까지 보임적용하지 않고 무엇이 더하는지 먼저 확인모든 단계
AMP에 보낸 쿼리가 403PromQL을 GET의 쿼리 문자열로 보내면 서명이 맞지 않음본문(POST)으로 보냄8

표 14. 증상별 원인과 조치. 단계는 그 증상을 만나는 단계입니다.

08

9단계 정리 계획과 작게 시작하는 순서

정리는 아직 실행하지 않았습니다. 아래는 계획한 순서이고 실행 결과가 아닙니다.

  1. GPU 노드가 먼저 사라지도록 Deployment와 NodePool을 지웁니다.
  2. terraform destroy를 실행합니다.
  3. S3의 models와 vllm-cache prefix는 기본으로 남깁니다. 별도 플래그를 줬을 때만 지웁니다.
  4. 남은 EC2, NLB, ALB, CloudFront 리소스를 조회해 확인합니다.
  5. VPC는 CDK 스택이므로 따로 지웁니다.

지울 때 지킬 규칙이 하나 있습니다. 서로 참조하는 보안 그룹은 참조하는 쪽의 규칙을 먼저 고친 뒤 지웁니다. 순서가 반대면 삭제가 DependencyViolation으로 실패합니다.

10개 단계를 한 번에 끝까지 갈 필요는 없습니다. 각 단계는 그 단계의 확인을 마친 뒤 다음 단계로 넘어갔으므로, 어느 단계에서 멈춰도 그때까지 만든 것은 표 15처럼 동작했습니다.

여기까지 만들면사용할 수 있는 것더하지 않은 것
3단계클러스터 안에서 모델별 Service의 OpenAI 호환 API하나의 엔드포인트, 로그인, 지표
4단계게이트웨이 하나에 model 값만 바꿔 두 모델을 호출모델을 대신 골라 주는 계층, 로그인
5단계와 6단계모델 판단을 맡는 Decider 12B, Qwen3.8-27B의 sleep과 깨우기사용자가 닿는 경로
7단계로그인한 브라우저에서 CloudFront 주소로 받는 스트리밍 응답지표와 대시보드
8단계지표 대시보드와 측정 스크립트정리

표 15. 단계별로 사용할 수 있는 것. 각 단계가 끝난 시점에 그 단계의 확인 항목으로 본 범위입니다.

처음이라면 3단계에서 k8s/gemma만 적용해 모델 하나가 응답하는 것부터 확인하는 것을 권합니다. 이때는 Gemma 4 31B 파드 하나만 GPU를 요청하므로 Karpenter가 만드는 GPU 노드도 gemma-od NodePool의 한 대입니다. 두 모델을 하나의 엔드포인트로 묶을 필요가 생기면 4단계를, 사용자에게 공개할 때 7단계를 더합니다.

이 환경에 다음으로 더할 일은 3가지입니다. 9단계 정리를 실행해 스크립트로 남기는 것, 한 번씩 측정한 값을 반복해 편차를 확인하는 것, EPP와 게이트웨이 파드가 내려갔을 때의 동작을 시험하는 것입니다.

Ten steps to a signed-in page answered by two models

After steps 0 to 8 you send a request from a sign-in page and receive the answers of two models token by token. The request passes Amazon CloudFront, an internal Application Load Balancer (ALB), the BFF (Backend for Frontend) and the gateway in that order. The vLLM pods on the GPU nodes are at the end. The BFF is the app that verifies the sign-in token and decides which model a request goes to.

Figure 1 is the architecture of the finished environment with the number of the step that builds each component. The ten cards at the bottom are the steps this post follows.

The architecture of the finished environment with the build step on each component. On the request path CloudFront, the internal ALB, the BFF, Cognito and the S3 pages come from step 7, the gateway from step 4, Decider 12B from step 5 and the wake API from step 6. Gemma 4 31B, Qwen3.8-27B and the compile cache on the GPU nodes come from step 3, the S3 model bucket, Pod Identity and the Karpenter NodePools from step 1, the model sync Job from step 2 and AMP from step 8. Cards at the bottom list steps 0 to 9 with their names and tools.
Figure 1. Build steps on the architecture. The number in a circle is the step that built the component and the blue text is the tool used. Web search was added to the BFF as a tool after step 8 and is marked with a plus sign.

This post is Part 3 of the series "OpenWeight on AWS GPU (OW on GPU)". The series covers how to serve open-weight models yourself on AWS GPU instances. The example environment serves Gemma 4 31B and Qwen3.8-27B together with vLLM, an open source inference engine, on Amazon Elastic Kubernetes Service (Amazon EKS). Part 1 followed the eight stages one API call goes through. Part 2 explained the architecture for serving two models and the Amazon EKS optimizations.

Part 3 is the order in which to build this environment from the start. It runs from creating the VPC to the moment the answers of two models stream into a signed-in browser, split into ten steps (step 0 to step 9). Each step is written in the same order: what it creates, the commands, how to check it, the measured values, and where it tends to go wrong. The code and manifests are in the public repository ow-on-gpu, so it helps to read with the repository open. The values were measured on November 14 and 15, 2026, in the Seoul Region (ap-northeast-2), and the tables give the number of runs. The values for Strands Decider 12B in step 5 were measured on November 24, 2026. The post is written for engineers who know the basics of Kubernetes and AWS (pods, Deployments, VPC, IAM) and are building an LLM serving environment for the first time.

With every component running, the cluster has 9 nodes.

Node group or NodePoolInstanceCountWhat runs on it
addons (managed node group)m7g.large2Karpenter, CoreDNS, AWS Load Balancer Controller
systemc7i-flex.xlarge2The gateway layer, the metrics collector
appc7g.large22 BFF pods
gemma-od, qwen-odg6e.4xlarge (1 NVIDIA L40S)2Gemma 4 31B, Qwen3.8-27B
deciderg6e.xlarge (1 NVIDIA L40S)1Strands Decider 12B

Table 1. The 9 nodes of the finished environment (checked November 26, 2026). Except for addons, Karpenter creates the nodes to match the NodePools.

01

What you need and the working rules

Before you start, check the quota of the account, the command line tools and the cost.

What you needDetails
AWS accountA G instance On-Demand quota that can run two g6e.4xlarge and one g6e.xlarge in the Seoul Region (36 vCPU)
Command line toolsAWS CLI, kubectl, Helm, Terraform 1.14 or later, Docker, Node.js and npm
Tools used by the hooks and tests of the repositoryjq, python3, Bash 4 or later
WorkstationA machine that can build arm64 and amd64 images. The BFF image is arm64 and the Decider 12B image is amd64
CostAbout 11.35 USD per hour with every component running

Table 2. What you need. The cost is a pre-tax USD estimate of the fixed cost: the estimate of about 10.05 USD from November 15, 2026, plus the price difference of the Decider node changed on November 24 (1.2984 USD per hour). It leaves out charges that depend on usage.

GPU nodes are billed while they run. The order for deleting things when you stop is in step 9. Every step follows the working rules written in AGENT.md of the repository.

  • Before creating or changing an AWS resource, read the result of terraform plan or kubectl diff, then apply.
  • Check CRD fields, Helm values and vLLM flags against the installed version, with kubectl explain, helm show values and vllm serve --help inside the image.
  • Do not put credentials in code or manifests. AWS permissions are granted only through IAM roles attached with EKS Pod Identity.
  • Five files with values that differ per environment are not in the repository. Only *.example files with placeholders are.
  • Confirm separately before an apply that starts GPU nodes.
  • Only measured values go into the docs. Raw data stays under results/.

Preparing the repository

bash
git clone https://github.com/whchoi98/ow-on-gpu.git
cd ow-on-gpu
bash scripts/setup.sh
bash tests/run-all.sh

scripts/setup.sh creates no AWS resources. It only checks the tools, installs the git hooks, copies the *.example files and installs the dependencies of the check page. Replace the placeholders in the copied files with the values in Table 3. Fill in the values that come from Terraform outputs after you apply step 1.

FileValue to fill in
infra/terraform/terraform.tfvarsThe public IP of the workstation allowed to reach the EKS API
k8s/base/params.yaml, jobs/model-sync/params.env, bench/coldstart/k8s/storage-s3.yamlThe model bucket name. terraform -chdir=infra/terraform output -raw model_bucket
k8s/observability/prometheus.ymlThe Prometheus workspace ID. terraform -chdir=infra/terraform output -raw amp_workspace_id

Table 3. The five files with values that differ per environment, and what to fill in.

02

The order of the ten steps across AWS CDK, Terraform and kubectl

Each tool has its own scope. AWS CDK creates the VPC, its subnets and its endpoints. Terraform looks up that VPC and creates Amazon EKS and the account-level resources. kubectl and Helm apply the resources inside the cluster. Table 4 lists what each step creates, its tools and where the code is.

StepWhat it createsToolsCode
0Checks of the version matrix, checkpoints and quotas (no resources)AWS CLI-
1VPC, EKS, Karpenter, model bucket, NodePoolsAWS CDK, Terraform, kubectlinfra/cdk-vpc, infra/terraform, k8s/base
2Three models loaded into Amazon S3kubectl (Job)jobs/model-sync
3Two vLLM pods, compile cache publishkubectlk8s/gemma, k8s/qwen, jobs/cache-publish
4The gateway layerHelm, kubectlk8s/gateway
5Strands Decider 12BTerraform, Docker, kubectlk8s/decider, infra/terraform
6The sleep controllerkubectlk8s/sleep-controller
7CloudFront, AWS WAF, Amazon Cognito, internal ALB, BFFTerraform, kubectl, Dockerapp/bff, app/web, k8s/bff, infra/terraform
8Metrics collection and measurementkubectl, Pythonk8s/observability, bench
9Cleanup (not run yet)Plan only-

Table 4. The ten steps and where the code is. The step numbers are the numbers in the circles of Figure 1.

The order of the steps follows their dependencies. The scripts of a later step read the image URL and the Amazon Cognito values from the Terraform outputs of an earlier step. The serving pods read only the objects that step 2 loaded into Amazon S3. GPU nodes are not created in advance, and Karpenter creates them when pods appear. Step 7 applies Terraform twice, before and after, because CloudFront can be connected only after the AWS Load Balancer Controller has created the internal ALB.

03

Steps 0 to 2: laying the base

Step 0: Preflight

This step creates no resources. It checks the version matrix, the checkpoints and the service quotas with read-only queries. A checkpoint is the set of files that stores trained weights. What was checked is in docs/00-versions.md.

bash
aws service-quotas list-service-quotas --service-code ec2 --region ap-northeast-2

Availability by AZ was queried with aws ec2 describe-instance-type-offerings --location-type availability-zone.

What was checkedValue
Version matrixEKS 1.37, Karpenter v1.15.2, AWS Load Balancer Controller v3.6.3, Gateway API CRD v1.6.3, GAIE CRD v1.6.2, llm-d-router v1.0.0, agentgateway v1.7.0, vLLM v0.33.0
CheckpointsRedHatAI/gemma-4-31B-it-FP8-dynamic (33.30 GB) for Gemma 4 31B, AzatAI/Qwen3.8-27B-FP8-dynamic (36.80 GB) for Qwen3.8-27B
G instance On-Demand quota768 vCPU in this account. This setup needs 36 vCPU
Availability by AZg6e.4xlarge and g6e.xlarge in 2a and 2b

Table 5. Values checked in step 0 (queried November 14, 2026, the AZs of g6e.xlarge on November 24). Sizes are the sum of the file sizes in the repository, and 1 GB is 10^9 bytes.

Where it tends to go wrong:

  • Even the latest versions do not always fall inside each other's supported range. For the Gateway API CRDs the latest v1.7.0 is outside the range agentgateway 1.7.x supports (1.4 to 1.6), so v1.6.3 was used.
  • Pick the checkpoint for the GPU. For the L40S (Ada generation) the FP8 checkpoints that the vLLM docs list as supported were chosen. FP8 is a quantization format that reduces weights to 8-bit floating point. The CUTLASS kernel of the official block FP8 checkpoint of Qwen3.8-27B is supported only on SM 9.0 and later, and the L40S is SM 8.9. That is why the per-channel FP8-dynamic checkpoint was used.

Step 1: Network and EKS base

The VPC comes from the AWS CDK stack EksVpcStack. Its range is 10.200.0.0/16, it has public, private and isolated subnets in four AZs, and workloads run in the private subnets. Terraform looks up this VPC and creates the EKS 1.37 cluster, the add-ons, Karpenter, the AWS Load Balancer Controller, the model bucket and the IAM roles. k8s/base applies the namespaces, four NodePools (gemma-od, qwen-od, decider, system), the EC2NodeClass and the NVIDIA device plugin.

bash
(cd infra/cdk-vpc && npx cdk deploy)
terraform -chdir=infra/terraform plan
terraform -chdir=infra/terraform apply
# The next command prints the command that creates the kubeconfig. Read the printed command, then run it
terraform -chdir=infra/terraform output -raw update_kubeconfig
export KUBECONFIG=$PWD/infra/terraform/.kubeconfig
kubectl apply -k k8s/base
What to checkResult
terraform validate, kubectl apply --dry-run=serverBoth checks pass
kubectl get nodesThe cluster is reachable. The managed node group for add-ons has 2 m7g.large nodes
VPC10.200.0.0/16, 4 AZs
GPU nodesNone in this step. Karpenter creates them when pods appear in steps 3 and 5

Table 6. Checks for step 1.

Where it tends to go wrong:

  • Before kubectl apply -k k8s/base, fill in the model bucket name in k8s/base/params.yaml from the Terraform output.
  • The GPU NodePools carry a taint and allow at most 1 GPU each. This setting keeps the number of nodes from growing unintentionally.
  • The EC2NodeClass uses the EKS optimized AMI with the NVIDIA drivers. Its userData pre-pulls the vLLM image, and the local NVMe is used as instance store.
  • Run kubectl with the project kubeconfig, so the default context of a shared machine does not change.

Step 2: Model sync

A sync Job loads three Hugging Face repositories into the model bucket in Amazon S3. They are Gemma 4 31B, Qwen3.8-27B and Strands Decider 12B, which step 5 deploys. The Decider 12B checkpoint holds the full weights, so no separate base model is loaded. The Job runs once, and after that the serving pods read only from Amazon S3. It uploads each file with s5cmd pipe as it downloads, so weights are not staged on local disk. It handles 8 files at a time.

bash
kubectl apply -k jobs/model-sync
kubectl -n model-jobs logs -f job/model-sync
kubectl -n model-jobs wait --for=condition=complete job/model-sync --timeout=60m
What to checkFirst sync (November 14, 2026)Decider 12B added (November 24, 2026)
The verified lines in the Job logObject counts and sizes match the expected valuesObject counts and sizes match the expected values
The summary line in the Job log73 objects, 74.90 GB13 objects, 23.97 GB. The 32 objects already there were skipped
Time to transfer and verify491.4 s314.9 s
From Job start to completion9 min 8 s6 min 35 s

Table 7. Checks and measured values for step 2 (one run each). The first sync includes the Decider v1 in use then and its base model. The three repositories now add up to 45 objects, 94.07 GB.

Where it tends to go wrong:

  • BUCKET in jobs/model-sync/params.env must equal the Terraform output model_bucket.
  • To run it again, delete the Job with kubectl -n model-jobs delete job model-sync and apply. The pod template of a Job cannot be changed. Deleting the Job also deletes its log, so save the log first.
  • The repositories are pinned by revision hash. The Job compares the hashes it computes during download with the values from Hugging Face. At the end it compares the S3 object listing with the expected values and fails if they differ.

04

Steps 3 to 6: serving the models

Step 3: vLLM deployment

Gemma 4 31B and Qwen3.8-27B are each deployed on their own g6e.4xlarge node. Two GPU nodes start in this step. Weights are read directly from Amazon S3 with the runai_streamer loader. An initContainer downloads the compile cache from S3 to a hostPath on the node. The compile cache is the torch.compile output that vLLM produces while it initializes the engine. After the first start, a cache publish Job uploads this cache to S3 so the next start can use it.

bash
kubectl diff -k k8s/gemma
kubectl apply -k k8s/gemma
kubectl apply -k k8s/qwen
kubectl apply -k jobs/cache-publish

The check is in the logs of the vLLM pods (vllm-gemma, vllm-qwen) in the inference namespace. When weight loading and engine initialization finish, the two lines below appear. These values are from the first start of Gemma 4 31B.

text
Model loading took 30.63 GiB memory and 19.106861 seconds
init engine (profile, create kv cache, warmup model) took 95.84 s (compilation: 61.03 s)
ItemGemma 4 31BQwen3.8-27B
Weight load19.1 s34.3 s
GPU memory taken by the weights30.63 GiB34.39 GiB
KV cache5.37 GiB (34,052 tokens)2.46 GiB (42,780 tokens)
Engine initialization95.84 s (no compile cache)57.85 s (compile cache hit)
Compile cache published522 objects, 90.8 MB2,056 objects, 216.7 MB

Table 8. Values measured in step 3 (November 14, 2026, first start, one run). The KV cache is the GPU memory that holds the per-token intermediate results of the requests being processed. The 2.46 GiB of Qwen3.8-27B is the value in this first start log; the log read 2.45 GiB during the throughput measurements in Part 2.

Where it tends to go wrong:

  • Check flags with vllm serve --help inside the image before using them. All 14 flags of this setup were present in the v0.33.0 image.
  • At --gpu-memory-utilization 0.85 the Qwen3.8-27B engine failed to start and the container restarted, and it started at 0.90. The cause is in Part 2. With the default --max-num-seqs of 1024 the engine also failed to start, so it is set to 32.
  • The readinessProbe of Qwen3.8-27B checks /is_sleeping, not /health, and Part 2 explains why.
  • The S3 prefix of the compile cache includes the vLLM version, the model, the precision and the GPU architecture. If any part of the setup changes, publish to a new prefix.

Step 4: GAIE and the gateway

This step installs the gateway layer that picks the pod group of a model from the model value in the request body. Gateway API Inference Extension (GAIE) is the Gateway API extension that sends inference requests to an InferencePool, a group of model server pods. The EPP (Endpoint Picker) chooses the pod inside the pool that receives the request. The gateway implementation is agentgateway. agentgateway copies the model value of the body into a header, and an HTTPRoute picks the pool by that header.

bash
k8s/gateway/install.sh render | kubectl diff -f -
k8s/gateway/install.sh apply

apply applies the CRDs, agentgateway, the EPP and InferencePool of each model and the Gateway in order, and it took 72 s. Table 9 shows requests sent from a temporary pod inside the cluster to the Service of the gateway.

What to checkResult
/v1/chat/completions with model set to gemma-4-31b200, Gemma 4 31B answers
/v1/chat/completions with model set to qwen38-27b200, Qwen3.8-27B answers
A model value that is not registered404
POST /sleep?level=1404
Status of the Gateway, HTTPRoutes and InferencePoolsAccepted=True, ResolvedRefs=True

Table 9. Checks for step 4 (November 14, 2026, one request each).

Where it tends to go wrong:

  • The HTTPRoutes register only /v1/chat/completions and /v1/models. Admin paths such as /sleep and /wake_up are not exposed through the gateway.
  • Each pool has 2 EPP replicas, but only the leader handles requests. A standby replica that shows NotReady is by design.
  • To spread the 2 gateway pods across two AZs, topologySpreadConstraints needed both minDomains: 2 and matchLabelKeys: [pod-template-hash].
  • The internal Network Load Balancer (NLB) of the gateway is for batch clients outside the cluster. The BFF calls the Service of the gateway directly.

Step 5: Strands Decider 12B

Strands Decider 12B (Decider 12B below) is a model that reads a request and judges which model should take it. The BFF asks Decider 12B only for requests whose model is not settled by the rules or the task type. It is deployed as one pod on a g6e.xlarge node. An HTTPRoute of the gateway rewrites POST /decide to /v1/systemone of Decider 12B. No InferencePool is used. This environment moved the Decider from the v1 2B model (g6.xlarge) to the 12B model of Strands Decider v2 on November 24, 2026, and the procedure and values below are those of v2.

You build the serving image yourself. A v2 checkpoint loads only with strands-decider 0.4.0 or later, and the public serving image the repository points to still held 0.3.1.dev1 in its November 20, 2026 build. So the deploy/sagemaker/Dockerfile at the v0.4.0 tag of the strands-decider repository is built unchanged. The image goes to Amazon Elastic Container Registry (Amazon ECR).

bash
terraform -chdir=infra/terraform apply -target=aws_ecr_repository.decider
k8s/decider/install.sh build
k8s/decider/install.sh diff
k8s/decider/install.sh apply
What to checkResult and measured value
Image build (amd64 emulation on an arm64 machine)8 min 25 s, 3.72 GB compressed
/health responsemodel is strands-decider-12B-gemma4-v2-2611, device is cuda:0
From container start to Ready43 s (weight load and warm-up included)
From apply to Ready when the node is new5 min 33 s (node 83 s, model download 101 s, image pull 90.5 s)
One decision through /decide on the gatewayMedian 89.7 ms to 90.6 ms (50 runs per decision type)
GPU memory23,725 MiB of the 46,068 MiB of the L40S in use

Table 10. Checks and measured values for step 5 (November 24, 2026, one run).

Where it tends to go wrong:

  • The tag of the public serving image does not tell you which strands-decider version is inside. I checked the labels in the image config and the package layer. Once the public image carries 0.4.0 or later, you can use it and skip the build.
  • On an arm64 machine, register amd64 emulation (binfmt) before the build. install.sh build runs docker buildx build --platform linux/amd64. The registration is lost on reboot.
  • Do not apply with kubectl apply -k k8s/decider. The image address contains the account ID, so install.sh fills the ${DECIDER_IMAGE} placeholder in the manifest from the Terraform output.
  • /health fails until warm-up finishes, so the pod becomes Ready after warm-up.
  • HF_HUB_OFFLINE=1 blocks access to Hugging Face. The initContainer downloads the weights from Amazon S3.
  • This server has no authentication. Keep it reachable only through the ClusterIP Service and /decide on the gateway.

Step 6: Sleep controller

This setup puts Qwen3.8-27B to sleep outside business hours and wakes it when needed. Sleep mode in vLLM frees GPU memory without taking the pod down, and Part 2 covers how it behaves and how long waking takes. Two CronJobs put the model to sleep at 19:00 and wake it at 08:30 on weekdays (Asia/Seoul). The wake API serves only POST /wake. The BFF calls this API before a request that goes to Qwen3.8-27B.

bash
kubectl apply -k k8s/sleep-controller
What to checkResult and measured value
Entering sleep (until /sleep responds)2.98 s
From the wake response until a gateway request succeeds1.34 s to 1.40 s
A Qwen3.8-27B request sent through the gateway while asleep503
Requests from a pod without labels to port 8000 of Qwen3.8-27B and to the wake APIBlocked

Table 11. Checks and measured values for step 6 (November 14, 2026, times are the range of 5 runs).

Where it tends to go wrong:

  • NetworkPolicies take effect only with enableNetworkPolicy turned on in the Amazon VPC CNI add-on. The default is off, so before that a policy can exist and still not be enforced. The setting is in infra/terraform/eks.tf.
  • Put the model to sleep with /sleep?level=1&mode=wait. The default abort cuts off requests in progress.
  • A sleeping pod becomes NotReady and drops out of the regular Service. Admin requests go to the headless Service vllm-qwen-admin, which also returns the addresses of NotReady pods.
  • The first sleep after the pod started took 31.71 s, and 2.98 s after that.

05

Steps 7 and 8: the user path and observability

Step 7: App layer

This step creates the front end that users reach: CloudFront and AWS WAF, the Amazon Cognito user pool, the S3 bucket for the check page, the BFF pods and the internal ALB. The BFF is 2 pods in the app namespace and runs on 2 Graviton nodes (c7g.large) created by the Karpenter NodePool app. The web search tool is part of the BFF. The IAM role of the BFF has a single permission, to call Amazon Bedrock AgentCore Web Search (Web Search below). The call goes to us-east-1, because this API is not offered in the Seoul Region.

The internal ALB is created by the AWS Load Balancer Controller from an Ingress, not by Terraform. So the order is Terraform, k8s/bff/install.sh, then Terraform again.

bash
terraform -chdir=infra/terraform apply -target=aws_ecr_repository.bff
app/bff/build.sh
app/web/build.sh
terraform -chdir=infra/terraform plan
terraform -chdir=infra/terraform apply
k8s/bff/install.sh diff
k8s/bff/install.sh apply
terraform -chdir=infra/terraform apply
app/bff/create-user.sh <email>

Each position in the order has a reason. app/bff/build.sh can push the image only when the ECR repository exists. The script builds an arm64 image, runs the BFF tests inside the image and writes the tag to infra/terraform/bff.auto.tfvars. The terraform apply in the middle creates the BFF role and its Pod Identity association. If the association is missing when a pod is created, no credentials are injected and web search fails. When k8s/bff/install.sh apply applies the NodePool, the pods and the Ingress, the controller creates the internal ALB. The last terraform apply looks up that ALB by tag and connects it to the VPC origin of CloudFront.

What to checkResult and measured value
kubectl -n app rollout status deploy/bff --timeout=300s2 pods Ready
POST /v1/chat/completions without a token401
A support request sent with a sign-in token200, 53 content events arriving at a median interval of 53.5 ms
Creating the CloudFront VPC origin9 min 18 s
Fixed cost of the app layer0.1857 USD per hour (internal ALB 0.0225, two c7g.large 0.1632)

Table 12. Checks and measured values for step 7 (November 15, 2026, one request each). Amounts are pre-tax USD and leave out charges that depend on usage.

Where it tends to go wrong:

  • The timeouts were raised for streaming. The CloudFront origin response timeout is 60 s (default 30 s) and the ALB idle timeout is 120 s (default 60 s).
  • The BFF does not buffer the response. It passes each chunk (the unit of response sent at one time) on as it arrives. Buffering breaks streaming.
  • Sign-up is disabled, and users are created only with create-user.sh. The password comes from a prompt or the environment variable USER_PASSWORD and is stored only in Amazon Cognito.
  • k8s/bff/install.sh changes into its own directory before it runs, so give KUBECONFIG as an absolute path. With a relative path it tries to connect to localhost:8080 and fails.

Step 8: Observability and measurement

This step collects metrics in Amazon Managed Service for Prometheus (AMP) and runs the measurement scripts. One Prometheus v3.16.0 in agent mode scrapes 2 vLLM pods, 4 EPP pods and 2 gateway pods and writes to AMP. There are four measurements, the cold start breakdown, the time to first content by segment, throughput under the SLO (service level objective) and the effect of priority, and the scripts are under bench/. The load generator runs as a Job on the dedicated NodePool bench.

bash
kubectl apply -k k8s/observability
python3 bench/coldstart/measure.py --model gemma --scenario cold-optimized --out results/2026-11-14-coldstart
python3 bench/job.py --name slo-gemma --service-account gemma --out results/2026-11-14-slo/gemma \
  --env MODEL_NAME=gemma-4-31b --env MODEL_DIR=gemma-4-31B-it-FP8-dynamic \
  --env BASE_URL=http://vllm-gemma.inference.svc:8000 -- bash /bench/run-bench.sh

Before applying, fill in the workspace ID in k8s/observability/prometheus.yml from the Terraform output amp_workspace_id.

What to checkResult
The 8 scrape targetsAll up
The 27 queries of the dashboard k8s/observability/dashboards/serving.jsonAll return values

Table 13. Checks for step 8 (November 14, 2026).

The results of the four measurements are in the other parts: the time to first content by segment in Part 1, and the cold start, throughput and the effect of priority in Part 2.

Where it tends to go wrong:

  • /metrics of the EPP returns 401 without a token. The collector scrapes it with its ServiceAccount token and the ClusterRole ow-on-gpu-metrics-reader. The NetworkPolicy of Qwen3.8-27B also needs an entry that allows the collector.
  • vllm bench serve does not start on a node without a GPU and fails with "Failed to infer device type". The measurement pod calls the same benchmark module directly through bench/slo/bench_serve.py.
  • Qwen3.8-27B is asleep from 19:00 to 08:30 on weekdays. To measure in that window, suspend the CronJob qwen-sleep.
  • When you put load on the CloudFront address, raise the Terraform variable waf_rate_limit or exempt the measurement machine. Past the AWS WAF rate limit (300 requests per 5 minutes per IP), every request returns 403 for a while. What the limit did when it triggered is in Part 1.

06

Checking everything from sign-in to the models

After step 8, check the node list, the site address, authentication and the path to the models in that order.

bash
export KUBECONFIG=$PWD/infra/terraform/.kubeconfig
kubectl get nodes -L node.kubernetes.io/instance-type,karpenter.sh/nodepool
terraform -chdir=infra/terraform output -raw app_url
python bench/bff/lang_check_live.py "$(terraform -chdir=infra/terraform output -raw app_url)"
kubectl -n app exec -i <bff-pod> -- python - < bench/bff/lang_check_in_pod.py

The node list shows the 9 nodes of Table 1. Open the https://<cloudfront-domain> address the third command prints, sign in as the user created in step 7 and send a request. The response headers x-bff-model, x-bff-decision, x-bff-search and x-bff-timing tell you the model of that request, the basis of the decision, whether web search was attached, and the time spent in each part of the BFF. Part 1 explains how to read the headers.

The other two commands are checks that need no password. lang_check_live.py checks that a request without a token comes back as 401 and looks for page errors. lang_check_in_pod.py starts the same app inside a BFF pod with only the token verifier replaced and sends requests all the way to the real models.

07

Common failures, listed by symptom

Table 14 lists symptoms that actually occurred while building this environment and are not in the per-step lists. The symptom comes first so you can search by the error text.

SymptomCauseFixStep
terraform plan fails at helm_release.karpenterPlanning everything without -target fails at the registry loginNarrow the change with -target7
Replacing a security group fails with couldn't find all security groupsThe AWS Load Balancer Controller looks up the name in the annotation by the Name tagAdd a Name tag to the security group in Terraform7
Batch requests are rejected with 429The priority of batch is -1, so a saturated pool rejects them instead of queueingLengthen the retry interval of the batch client4
kubectl diff shows lines you did not writeIt is a server dry-run, so it includes lines added by webhooks in the clusterDo not apply. Find out what adds them firstEvery step
A query sent to AMP returns 403Sending PromQL in the query string of a GET breaks the signatureSend it in the body (POST)8

Table 14. Causes and fixes by symptom. The step is where you meet the symptom.

08

The plan for step 9 and where to start smaller

Cleanup has not been run yet. The list below is the planned order, not a result.

  1. Delete the Deployments and NodePools first, so the GPU nodes go away first.
  2. Run terraform destroy.
  3. Keep the models and vllm-cache prefixes in S3 by default. Delete them only with an explicit flag.
  4. List any remaining EC2, NLB, ALB and CloudFront resources to confirm.
  5. The VPC is a CDK stack, so delete it separately.

One rule applies when deleting. For security groups that reference each other, change the rules of the referencing side first, then delete. In the opposite order the delete fails with DependencyViolation.

You do not have to go through all ten steps in one run. Each step moved on only after its own checks passed, so wherever you stop, what was built up to that point worked as Table 15 shows.

If you build up toWhat you can useWhat is not added yet
Step 3The OpenAI-compatible API of each model's Service, inside the clusterA single endpoint, sign-in, metrics
Step 4Both models through one gateway, by changing only the model valueA layer that picks the model for you, sign-in
Steps 5 and 6Decider 12B for the model decision, sleep and wake for Qwen3.8-27BA path users can reach
Step 7Streamed answers at the CloudFront address from a signed-in browserMetrics and a dashboard
Step 8The metrics dashboard and the measurement scriptsCleanup

Table 15. What you can use at each step. The scope is what the checks of that step covered when the step ended.

If this is your first time, start by applying only k8s/gemma in step 3 and confirm that one model answers. Only the Gemma 4 31B pod requests a GPU then, so Karpenter creates a single GPU node, from the gemma-od NodePool. Add step 4 when you need both models behind one endpoint, and step 7 when you open it to users.

Three things come next for this environment: running the cleanup of step 9 and keeping it as a script, repeating the measurements that were taken once to see their spread, and testing what happens when the EPP or gateway pods go down.

참고 자료References

No.출처Source종류Kind확인한 날Checked
1ow-on-gpuGitHub 저장소GitHub repository2026-11-21
2Learn how EKS Pod Identity grants pods access to AWS servicesAmazon EKS 사용 설명서Amazon EKS User Guide2026-11-21
3Assign an IAM role to a Kubernetes service accountAmazon EKS 사용 설명서Amazon EKS User Guide2026-11-21
4Use EKS-optimized accelerated Linux AMIs for GPU instancesAmazon EKS 사용 설명서Amazon EKS User Guide2026-11-21
5Restrict Pod network traffic with Kubernetes network policiesAmazon EKS 사용 설명서Amazon EKS User Guide2026-11-21
6Amazon EC2 G6e Instances제품 페이지Product page2026-11-21
7NodePoolsKarpenter 문서Karpenter docs2026-11-21
8NodeClassesKarpenter 문서Karpenter docs2026-11-21
9vllm serve (v0.33.0)vLLM CLI 레퍼런스vLLM CLI reference2026-11-21
10Loading models with Run:ai Model StreamervLLM 문서vLLM docs2026-11-21
11torch.compile integrationvLLM 문서vLLM docs2026-11-21
12QuantizationvLLM 문서vLLM docs2026-11-21
13Sleep ModevLLM 문서vLLM docs2026-11-21
14RedHatAI/gemma-4-31B-it-FP8-dynamicHugging Face 모델 카드Hugging Face model card2026-11-21
15AzatAI/Qwen3.8-27B-FP8-dynamicHugging Face 모델 카드Hugging Face model card2026-11-21
16IntroductionGateway API Inference Extension 문서Gateway API Inference Extension docs2026-11-21
17InferencePoolGateway API Inference Extension 문서Gateway API Inference Extension docs2026-11-21
18Inference routingagentgateway 문서agentgateway docs2026-11-21
19Multiple inference poolsagentgateway 문서agentgateway docs2026-11-21
20strands-deciderGitHub 저장소GitHub repository2026-11-21
21Restrict access with VPC originsAmazon CloudFront 개발자 안내서Amazon CloudFront Developer Guide2026-11-21
22Origin settingsAmazon CloudFront 개발자 안내서Amazon CloudFront Developer Guide2026-11-21
23Rate-based rule caveats in AWS WAFAWS WAF 개발자 안내서AWS WAF Developer Guide2026-11-21
24Ingress annotationsAWS Load Balancer Controller 문서AWS Load Balancer Controller docs2026-11-21
25Security Groups for Load BalancersAWS Load Balancer Controller 문서AWS Load Balancer Controller docs2026-11-21
26Search the web using Amazon Bedrock AgentCore Web SearchAmazon Bedrock AgentCore 개발자 안내서Amazon Bedrock AgentCore Developer Guide2026-11-21
27Set up ingestion from an existing Prometheus server in Kubernetes on EC2Amazon Managed Service for Prometheus 사용 설명서Amazon Managed Service for Prometheus User Guide2026-11-21
28Prometheus Agent ModePrometheus 문서Prometheus docs2026-11-21
29Introducing Strands Decider v2Strands Agents 블로그Strands Agents blog2026-11-26