Skip to content

chore: 템플릿 변경 시 기존 인스턴스 보호#22

Merged
doup2001 merged 1 commit intomainfrom
chore/#12
Apr 8, 2026
Merged

chore: 템플릿 변경 시 기존 인스턴스 보호#22
doup2001 merged 1 commit intomainfrom
chore/#12

Conversation

@doup2001
Copy link
Copy Markdown
Member

@doup2001 doup2001 commented Apr 8, 2026

📌 작업한 내용

  • 인스턴스 템플릿을 수정해도 기존 실행 중인 인스턴스가 영향을 받지 않도록 로직 개선.
  • Terraform 또는 GCE Managed Instance Group의 템플릿 업데이트 동작을 제어.

🔍 참고 사항

  • GCP GCE Managed Instance Group에서 템플릿 변경 시 update-policy의 type을 OPPORTUNISTIC으로 설정하면 새로운 인스턴스에만 적용됩니다.
  • 기존 인스턴스는 rolling replacement 대신 유지되며, 최소 가용성 보장과 함께 점진적 업데이트가 가능합니다.
  • 배포 후 기존 인스턴스 상태와 새 인스턴스 생성을 모니터링하여 안정성 검증이 필요합니다.

🖼️ 스크린샷

(해당 사항 없음)

🔗 관련 이슈

#12

✅ 체크리스트

  • 로컬에서 빌드 및 테스트 완료
  • 코드 리뷰 반영 완료
  • 문서화 필요 여부 확인

Summary by CodeRabbit

릴리스 노트

  • Chores
    • Kubernetes 마스터 노드의 업데이트 정책 설정을 추가했습니다.
    • 워커 노드의 자동 스케일링 로직을 개선하여 인스턴스 그룹 크기에 따라 자동 스케일링을 조건부로 제어하도록 변경했습니다.
    • Kubernetes 워커 노드의 업데이트 정책 설정을 추가했습니다.

@doup2001 doup2001 added this to the [M3]K8s-구현 milestone Apr 8, 2026
@doup2001 doup2001 self-assigned this Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aed09bea-00aa-4e7c-ae28-a6299fdd5c27

📥 Commits

Reviewing files that changed from the base of the PR and between 47ac7bb and 8b18571.

📒 Files selected for processing (1)
  • terraform/environments/prod/compute.tf

Walkthrough

Kubernetes 클러스터 노드 모듈 구성을 업데이트하여 마스터 및 워커 노드 모두에 기회주의적 업데이트 정책을 추가하고, 워커 노드의 오토스케일링 로직을 인스턴스 그룹 크기에 따라 조건부로 변경합니다.

Changes

Cohort / File(s) Summary
Kubernetes 노드 모듈 구성
terraform/environments/prod/compute.tf
k8s_master_nodes 및 k8s_worker_nodes 모듈에 update_policy_type = "OPPORTUNISTIC" 추가. k8s_worker_nodes의 enable_autoscaling을 인스턴스 그룹 크기 기반 조건부 로직(var.k8s_worker_instance_group_size > 0 ? var.enable_autoscaling : false)으로 변경

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

chore

Poem

🐰 테라폼의 노드들이 춤을 추고,
기회주의적 업데이트로 현명하게 행동하며,
워커는 크기에 맞춰 숨을 쉬고,
안정성의 정책으로 팀을 지켜내네! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 PR의 주요 변경 사항과 명확히 관련되어 있으며, 인스턴스 템플릿 변경 시 기존 인스턴스 보호라는 핵심 의도를 잘 요약하고 있습니다.
Description check ✅ Passed PR 설명이 저장소의 템플릿 구조를 따르며, 작업 내용, 참고 사항, 관련 이슈, 체크리스트가 모두 포함되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)

✅ Unit Test PR creation complete.

  • Create PR with unit tests
  • Commit unit tests in branch chore/#12

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Terraform Plan - prod 환경

State 버킷 변수 확인 📦 ✅

초기화 결과 ⚙️ ✅

tfvars 복원 결과 🔐 ✅

포맷 검사 결과 🖌 ✅

유효성 검사 결과 🤖 ✅

Plan 결과 📖 ✅

Plan 상세 보기
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.k8s_master_nodes.google_compute_instance_group_manager.instance_group[0] will be updated in-place
  ~ resource "google_compute_instance_group_manager" "instance_group" {
        id                             = "projects/prod-pinhouse/zones/asia-northeast3-a/instanceGroupManagers/pinhouse-prod-k8s-master-ig"
        name                           = "pinhouse-prod-k8s-master-ig"
        # (13 unchanged attributes hidden)

      ~ update_policy {
          ~ type                    = "PROACTIVE" -> "OPPORTUNISTIC"
            # (6 unchanged attributes hidden)
        }

        # (2 unchanged blocks hidden)
    }

  # module.k8s_worker_nodes.google_compute_instance_group_manager.instance_group[0] will be updated in-place
  ~ resource "google_compute_instance_group_manager" "instance_group" {
        id                             = "projects/prod-pinhouse/zones/asia-northeast3-a/instanceGroupManagers/pinhouse-prod-k8s-workers-ig"
        name                           = "pinhouse-prod-k8s-workers-ig"
        # (13 unchanged attributes hidden)

      ~ update_policy {
          ~ type                    = "PROACTIVE" -> "OPPORTUNISTIC"
            # (6 unchanged attributes hidden)
        }

        # (4 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

실행 사용자: @doup2001, 이벤트: pull_request

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Note

Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@doup2001 doup2001 merged commit d10367b into main Apr 8, 2026
9 checks passed
@doup2001 doup2001 deleted the chore/#12 branch April 8, 2026 07:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

✅ Created PR with unit tests: #25

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.

1 participant