Skip to content

feat: Blue/Green 배포를 위한 Green 슬롯 management 포트(9081) ingress rule 추가#45

Merged
Hexeong merged 1 commit into
mainfrom
feat/44-add-ingress-rule
Jun 15, 2026
Merged

feat: Blue/Green 배포를 위한 Green 슬롯 management 포트(9081) ingress rule 추가#45
Hexeong merged 1 commit into
mainfrom
feat/44-add-ingress-rule

Conversation

@Hexeong

@Hexeong Hexeong commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

작업 내용

Blue/Green 무중단 배포 도입으로 Green 슬롯의 actuator management 포트가 9081로 변경됨에 따라, 모니터링 서버(Prometheus)가 9081에 접근할 수 있도록 보안 그룹 ingress rule을 추가합니다.

변경 파일: config/secrets/app_stack.tfvars (서브모듈)

  • api_ingress_rules에 9081 포트 추가
    • 소스: 8081과 동일하게 모니터링 서버 보안 그룹으로 제한
    • Blue active → Prometheus가 8081 scrape, Green active → 9081 scrape 모두 정상 동작

특이 사항

리뷰 요구사항 (선택)

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 설정 및 보안 관련 내부 구성요소를 업데이트했습니다.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

config/secrets 서브모듈의 참조 커밋 해시가 40fe5a2에서 f76d2ff로 갱신되었습니다. 연결된 이슈(#44)에 따르면, 해당 변경은 Blue/Green 배포의 Green 슬롯 actuator 포트(9081)에 대한 ingress rule 추가를 포함합니다.

Changes

config/secrets 서브모듈 갱신

Layer / File(s) Summary
서브모듈 커밋 갱신
config/secrets
서브모듈 참조 커밋 해시가 40fe5a2에서 f76d2ff로 교체되었습니다. 이슈 #44 기준으로, app_stack.tfvarsapi_ingress_rules에 Green 슬롯 management 포트 9081 ingress rule이 추가된 내용이 반영된 것으로 추정됩니다.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 토끼가 살포시 submodule을 바꿨네,
9081 포트, 이제 열렸다네!
Green 슬롯도 Prometheus 눈에 띄고,
Blue와 Green이 사이좋게 scrape되리~
커밋 한 줄이 세상을 바꿨다네 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 설명합니다. Blue/Green 배포를 위한 Green 슬롯 management 포트(9081) ingress rule 추가라는 구체적인 목적이 잘 드러나 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경사항이 이슈 #44의 요구사항을 충족합니다. api_ingress_rules에 9081 포트를 모니터링 서버 보안 그룹을 소스로 추가하여 Green 슬롯 모니터링 접근을 가능하게 했습니다.
Out of Scope Changes check ✅ Passed PR의 모든 변경사항은 이슈 #44의 요구범위 내에 있습니다. config/secrets 서브모듈 커밋만 업데이트되었으며, 이는 9081 ingress rule 추가라는 명확한 목적 범위 내의 변경입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed PR 설명이 템플릿의 모든 필수 섹션을 포함하고 있으며, 작업 내용이 명확하게 설명되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/44-add-ingress-rule

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/secrets`:
- Line 1: The submodule pointer change in config/secrets is not being caught by
the existing Terraform workflow filters because the filters in both
.github/workflows/terraform-plan.yml and .github/workflows/terraform-apply.yml
only specify concrete files within config/secrets (like prod.tfvars and
app_stack.tfvars) but not the directory path itself. When submodule pointers
change, they are reported as changes to the config/secrets path directly, not to
individual files within it. Add config/secrets as a direct path entry to the
prod/stage filters in both terraform-plan.yml and terraform-apply.yml workflow
files so that submodule pointer changes are properly detected and trigger the
appropriate plan and apply workflows.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ee2413af-89dd-46d1-92b7-46caa7bcd0eb

📥 Commits

Reviewing files that changed from the base of the PR and between c68bdbd and a6b0d52.

📒 Files selected for processing (1)
  • config/secrets

Comment thread config/secrets
@@ -1 +1 @@
Subproject commit 40fe5a23122f5b5fe84c1ecbcec237318ba6358d
Subproject commit f76d2ff79e7535eae814f8974e87029a014b4736

@coderabbitai coderabbitai Bot Jun 15, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base_ref="${GITHUB_BASE_REF:-}"
if [ -n "$base_ref" ] && git rev-parse --verify "origin/${base_ref}" >/dev/null 2>&1; then
  base="origin/${base_ref}"
else
  base="origin/HEAD"
fi

merge_base="$(git merge-base "$base" HEAD)"

printf '\n[PR 변경 경로]\n'
git diff --name-only "$merge_base" HEAD | sed 's/^/- /'

printf '\n[서브모듈 포인터 diff]\n'
git diff --submodule=short "$merge_base" HEAD -- config/secrets

printf '\n[Terraform workflow의 config/secrets 필터]\n'
rg -n -C2 "config/secrets" .github/workflows/terraform-plan.yml .github/workflows/terraform-apply.yml

Repository: solid-connection/solid-connection-infra

Length of output: 65


🏁 Script executed:

#!/bin/bash
# Repository 구조 확인
echo "[Repository 파일 목록 - 최상위 및 주요 디렉토리]"
ls -la | head -20

echo -e "\n[.github/workflows 디렉토리 확인]"
ls -la .github/workflows/ 2>/dev/null || echo "Directory not found"

echo -e "\n[config 디렉토리 확인]"
ls -la config/ 2>/dev/null || echo "Directory not found"

Repository: solid-connection/solid-connection-infra

Length of output: 1725


🏁 Script executed:

#!/bin/bash
# Terraform workflow 파일 존재 여부 및 내용 확인
echo "[terraform-plan.yml 파일 확인]"
if [ -f .github/workflows/terraform-plan.yml ]; then
  wc -l .github/workflows/terraform-plan.yml
  echo -e "\n[terraform-plan.yml에서 path-filter 관련 부분]"
  grep -n "paths\|config/secrets" .github/workflows/terraform-plan.yml | head -30
else
  echo "File not found"
fi

echo -e "\n[terraform-apply.yml 파일 확인]"
if [ -f .github/workflows/terraform-apply.yml ]; then
  wc -l .github/workflows/terraform-apply.yml
  echo -e "\n[terraform-apply.yml에서 path-filter 관련 부분]"
  grep -n "paths\|config/secrets" .github/workflows/terraform-apply.yml | head -30
else
  echo "File not found"
fi

Repository: solid-connection/solid-connection-infra

Length of output: 2095


🏁 Script executed:

#!/bin/bash
# Git 상태 확인
echo "[현재 브랜치 및 상태]"
git status

echo -e "\n[Git 로그 (최근 커밋)]"
git log --oneline -5

echo -e "\n[config/secrets 상태]"
ls -la config/secrets 2>/dev/null || echo "Directory not found"
cat config/secrets 2>/dev/null | head -10 || echo "File not found or not readable"

Repository: solid-connection/solid-connection-infra

Length of output: 354


🏁 Script executed:

#!/bin/bash
# 실제 git diff 상태 확인
echo "[config/secrets의 git diff]"
git diff HEAD~1 HEAD -- config/secrets 2>/dev/null || git show HEAD -- config/secrets 2>/dev/null || echo "Can't show diff"

echo -e "\n[전체 changed files]"
git diff --name-only HEAD~1 HEAD 2>/dev/null || echo "Can't list changed files"

echo -e "\n[.gitmodules 확인]"
cat .gitmodules

Repository: solid-connection/solid-connection-infra

Length of output: 667


🏁 Script executed:

#!/bin/bash
# terraform-plan.yml의 실제 path filter 구조 확인 (특히 prod와 stage 섹션)
echo "[terraform-plan.yml의 30-60 라인 (path filter 정의)]"
sed -n '30,60p' .github/workflows/terraform-plan.yml

echo -e "\n[terraform-apply.yml의 29-60 라인 (path filter 정의)]"
sed -n '29,60p' .github/workflows/terraform-apply.yml

Repository: solid-connection/solid-connection-infra

Length of output: 2369


🏁 Script executed:

#!/bin/bash
# GitHub path filter 로직 확인: submodule 포인터 변경 시 어떤 경로로 보고되는지
echo "[git ls-files로 config/secrets 상태 확인]"
git ls-files --stage config/secrets

echo -e "\n[git status로 submodule 상태 확인]"
git status --porcelain config/secrets

echo -e "\n[Current commit hash vs HEAD~1]"
git rev-parse HEAD
git rev-parse HEAD~1

Repository: solid-connection/solid-connection-infra

Length of output: 504


🌐 Web query:

dorny paths-filter submodule pointer changes detection

💡 Result:

dorny/paths-filter detects changes by comparing the git ref(s) you provide (via inputs base/ref) and then matching the resulting list of changed file paths against your glob filters; it does not include a first-class “submodule pointer vs submodule contents” mode. 1) What it will detect for submodules - Git records a submodule pointer as a change to the submodule directory path (the “gitlink”) in the superproject. - Since dorny/paths-filter matches “paths of all changed files” against your glob rules [1], it can detect that the submodule path itself changed (added/modified/deleted) when the gitlink changed—e.g., your filter could be something like submoduleDir/ or just submoduleDir. 2) What it will NOT automatically detect - It does not have a documented option for “filter inside submodule contents” (i.e., treat changes inside the submodule repo as changed files under that submodule path in the superproject) [2]. An open issue requests “option to filter paths in submodule” because the current behavior only returns the submodule name/pointer rather than the internal files [2]. 3) Practical workflow/workarounds - If you only care whether the submodule gitlink changed (pointer changed): - Add a filter that matches the submodule directory itself, because the superproject will show that path as changed [1]. - Example concept (you’d adapt paths): - submoduleA: ['path/to/submoduleA'] - If you care about files changed inside the submodule(s): - You must run additional logic outside paths-filter (e.g., checkout submodules and then run a git diff inside each submodule, or compute changed files via git for the submodule commits) because paths-filter doesn’t provide a native submodule-content detection knob [2]. 4) Where the comparison inputs come in - Change detection is done by using git ref(s) and diffing the current branch against base (or merge-base) depending on the event and inputs [1]. The set of paths you can match (including any submodule gitlink path) is derived from that diff step [1]. If you tell me which GitHub event you use (pull_request vs push vs workflow_dispatch) and what you mean by “pointer changes detection” (gitlink changed only, or internal submodule file changes), I can propose an exact filter config and/or a robust shell snippet.

Citations:


서브모듈 포인터 변경도 Terraform plan/apply 필터에 포함시켜 주세요.

현재 PR에서 config/secrets submodule 포인터가 변경되지만, .github/workflows/terraform-plan.yml.github/workflows/terraform-apply.yml의 prod/stage 필터는 config/secrets/prod.tfvars, config/secrets/app_stack.tfvars 등 구체적 파일들만 명시하고 있습니다. Submodule 포인터 변경은 config/secrets 경로로 보고되므로, 필터에 이 경로를 직접 추가하지 않으면 prod/stage plan/apply가 스킵될 수 있습니다. 결과적으로 9081 ingress rule 변경이 검증·적용되지 않을 위험이 있습니다.

🔧 필터 보강 방법
             prod:
               - 'environment/prod/**'
               - 'modules/app_stack/**'
               - 'modules/common/**'
+              - 'config/secrets'
               - 'config/secrets/prod.tfvars'
               - 'config/secrets/app_stack.tfvars'
             stage:
               - 'environment/stage/**'
               - 'modules/app_stack/**'
               - 'modules/common/**'
+              - 'config/secrets'
               - 'config/secrets/stage.tfvars'
               - 'config/secrets/app_stack.tfvars'

위 변경을 .github/workflows/terraform-plan.yml.github/workflows/terraform-apply.yml 양쪽에 동일하게 적용하면, submodule 포인터 변경이 prod/stage 필터와 매칭됩니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/secrets` at line 1, The submodule pointer change in config/secrets is
not being caught by the existing Terraform workflow filters because the filters
in both .github/workflows/terraform-plan.yml and
.github/workflows/terraform-apply.yml only specify concrete files within
config/secrets (like prod.tfvars and app_stack.tfvars) but not the directory
path itself. When submodule pointers change, they are reported as changes to the
config/secrets path directly, not to individual files within it. Add
config/secrets as a direct path entry to the prod/stage filters in both
terraform-plan.yml and terraform-apply.yml workflow files so that submodule
pointer changes are properly detected and trigger the appropriate plan and apply
workflows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai 필터에서 서브모듈의 어떤부분이 변경되었는지 알고 저 해쉬값을 가지고 판단 가능한가요?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hexeong, 안타깝게도 dorny/paths-filter는 서브모듈 내부를 직접 들여다보지 못합니다.

기술적인 이유를 설명하면:

레이어 Git이 기록하는 것 필터가 보는 것
슈퍼프로젝트 config/secrets 경로에 commit hash 포인터 변경 (gitlink) config/secrets 하나의 경로 변경으로만 인식
서브모듈 내부 app_stack.tfvars 등 실제 파일 변경 보이지 않음

즉, 워크플로우 필터 입장에서는 40fe5a2f76d2ff 라는 해시 변경만 알 수 있을 뿐, 그 해시 안에서 어떤 파일(prod.tfvars, app_stack.tfvars 등)이 바뀌었는지는 알 수 없습니다.

만약 서브모듈 내부 변경 파일을 기준으로 필터링하려면, 다음과 같은 커스텀 스크립트가 필요합니다:

- name: Check submodule internal changes
  run: |
    git submodule update --init config/secrets
    git -C config/secrets diff 40fe5a2 f76d2ff --name-only

그러나 이는 복잡도가 높아집니다. 따라서 원래 제안처럼 config/secrets 경로 자체를 필터에 추가하여, 서브모듈 포인터가 바뀌면 항상 plan/apply가 트리거되도록 하는 것이 더 간단하고 안전한 접근입니다. 서브모듈 변경이 어떤 파일이든 간에 Terraform 검증이 실행되어야 하는 상황이기 때문입니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그럼 해당 내용은 다른 PR에서 작업하겠습니다.

@Hexeong Hexeong merged commit 7419217 into main Jun 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Blue/Green 배포를 위한 Green 슬롯 management 포트(9081) ingress rule 추가

2 participants