From 3770b2a88a9745d391b21cb1953efc4b635ef9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=9E=AC=EC=A4=91?= <126754298+m-a-king@users.noreply.github.com> Date: Wed, 14 Oct 2026 21:47:53 +0900 Subject: [PATCH] =?UTF-8?q?infra:=20extractor=20=EC=98=9B=20=EC=9E=85?= =?UTF-8?q?=EA=B5=AC=208090=20=EC=A0=9C=EA=B1=B0=20(2=EB=8B=A8=EA=B3=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - nginx 의 8090 listen 삭제 - SG 인바운드에서 8090 삭제. 포트는 정본 값 하나 - 배포의 옛 슬롯 인자(18090·18091) 삭제 - 원인: 새 슬롯으로 이미 배포됨. core dev·prod 가 정본으로 계산한 8081 을 부름 --- .github/workflows/deploy.yml | 3 --- infra/extractor/main.tf | 18 +++++++----------- infra/nginx/extractor.conf | 2 -- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 94253f0..3b3975c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -270,12 +270,9 @@ jobs: # 배포 끝에서 정리하면 디스크가 찬 상태에서 pull 이 먼저 죽는다(renderer 2026-09-13). 규칙 정본은 infra conventions/infra.md. bash /tmp/piki-blocks/prune_images.sh - # --legacy-slot: 옛 슬롯(8090 시절 규칙) 중 서빙 중인 쪽을 알아보게 한다(#108). 이 인자가 없으면 옛 blue 가 - # 서빙 중일 때 새 blue 기동 전에 지워진다. 새 슬롯으로 한 번 배포된 뒤 제거. bash /tmp/piki-blocks/deploy_slot.sh \ --state-file /etc/nginx/piki-extractor-upstream.conf \ --service-port "$SERVICE_PORT" --name-prefix piki-extractor \ - --legacy-slot blue:18090 --legacy-slot green:18091 \ --health-path /actuator/health --health-interval 5 --health-attempts 36 --health-expect-body '"status":"UP"' \ --verify-cmd "bash /tmp/piki-blocks/healthcheck.sh --url http://localhost:$SERVICE_PORT/actuator/health --interval 2 --attempts 10 --expect-body '\"status\":\"UP\"'" \ -- --image "$IMAGE" --restart unless-stopped --env-file "$ENV_FILE" --pull \ diff --git a/infra/extractor/main.tf b/infra/extractor/main.tf index 5a84d1f..03114fc 100644 --- a/infra/extractor/main.tf +++ b/infra/extractor/main.tf @@ -124,8 +124,7 @@ data "http" "ports" { } locals { - # 8090 은 옛 입구다. core 가 정본으로 extractor 주소를 계산하게 되면 뺀다(#108). - extractor_ports = [jsondecode(data.http.ports.response_body).extractor.port, 8090] + extractor_port = jsondecode(data.http.ports.response_body).extractor.port } # --- SG: inbound = piki app SG 에서 추출 포트만, egress = 전체(임의 상품 링크 fetch + Gemini + 헤드리스) --- @@ -134,15 +133,12 @@ resource "aws_security_group" "extractor" { description = "piki extractor: inbound only from app SG on extractor port, egress all" vpc_id = data.aws_vpc.main.id - dynamic "ingress" { - for_each = local.extractor_ports - content { - description = "extraction API from piki app servers only" - from_port = ingress.value - to_port = ingress.value - protocol = "tcp" - security_groups = [data.aws_security_group.app.id] # IP 대신 SG 참조 = '우리 서버만' - } + ingress { + description = "extraction API from piki app servers only" + from_port = local.extractor_port + to_port = local.extractor_port + protocol = "tcp" + security_groups = [data.aws_security_group.app.id] # IP 대신 SG 참조 = '우리 서버만' } egress { diff --git a/infra/nginx/extractor.conf b/infra/nginx/extractor.conf index 317f520..2a6e989 100644 --- a/infra/nginx/extractor.conf +++ b/infra/nginx/extractor.conf @@ -16,8 +16,6 @@ upstream piki_extractor { server { listen __SERVICE_PORT__ default_server; - # 옛 입구. core 가 정본으로 extractor 주소를 계산하게 되면 제거한다(#108). - listen 8090; location / { proxy_pass http://piki_extractor;