Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion k8s-argocd/applications/dev/app/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
finalizers:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd-image-updater.argoproj.io/image-list: frontend=asia-northeast3-docker.pkg.dev/dev-pinhouse/pinhouse-dev-admin/pinhouse-admin
argocd-image-updater.argoproj.io/image-list: frontend=asia-northeast3-docker.pkg.dev/dev-pinhouse-2/pinhouse-dev-admin/pinhouse-admin
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 | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify Artifact Registry repositories and recent images

PROJECT_ID="dev-pinhouse-2"
REGION="asia-northeast3"

echo "=== Checking admin repository ==="
gcloud artifacts repositories describe pinhouse-dev-admin \
  --location="$REGION" \
  --project="$PROJECT_ID" \
  --format="value(name)" 2>/dev/null || echo "Repository not found"

echo -e "\n=== Listing recent admin images (if exists) ==="
gcloud artifacts docker images list \
  "$REGION-docker.pkg.dev/$PROJECT_ID/pinhouse-dev-admin/pinhouse-admin" \
  --limit=5 \
  --format="table(package,version,createTime)" 2>/dev/null || echo "No images found"

echo -e "\n=== Checking backend repository ==="
gcloud artifacts repositories describe pinhouse-dev-be \
  --location="$REGION" \
  --project="$PROJECT_ID" \
  --format="value(name)" 2>/dev/null || echo "Repository not found"

echo -e "\n=== Listing recent backend images (if exists) ==="
gcloud artifacts docker images list \
  "$REGION-docker.pkg.dev/$PROJECT_ID/pinhouse-dev-be/pinhouse-server" \
  --limit=5 \
  --format="table(package,version,createTime)" 2>/dev/null || echo "No images found"

echo -e "\n=== Checking frontend repository ==="
gcloud artifacts repositories describe pinhouse-dev-fe \
  --location="$REGION" \
  --project="$PROJECT_ID" \
  --format="value(name)" 2>/dev/null || echo "Repository not found"

echo -e "\n=== Listing recent frontend images (if exists) ==="
gcloud artifacts docker images list \
  "$REGION-docker.pkg.dev/$PROJECT_ID/pinhouse-dev-fe/pinhouse-web" \
  --limit=5 \
  --format="table(package,version,createTime)" 2>/dev/null || echo "No images found"

Repository: PinHouse/PinHouse_CLOUD

Length of output: 439


필수 해결: Artifact Registry 저장소를 찾을 수 없습니다

dev-pinhouse-2 프로젝트 asia-northeast3 영역에서 다음 저장소들이 존재하지 않습니다:

  • pinhouse-dev-admin (admin 이미지)
  • pinhouse-dev-be (backend 이미지)
  • pinhouse-dev-fe (frontend 이미지)

배포 시 이미지 풀이 실패하므로, Artifact Registry 저장소를 생성하고 이미지를 먼저 푸시한 후 배포를 진행해야 합니다.

🤖 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 `@k8s-argocd/applications/dev/app/admin.yaml` at line 18, 현재 argocd 이미지
어노테이션(문자열 키 argocd-image-updater.argoproj.io/image-list)에 참조된 Artifact Registry
저장소들이 존재하지 않아 이미지 풀 실패가 발생합니다; dev-pinhouse-2 프로젝트의 asia-northeast3 리전에
pinhouse-dev-admin, pinhouse-dev-be, pinhouse-dev-fe 저장소를 생성하고 각 서비스(예:
frontend, admin, backend) 이미지를 해당 저장소로 빌드·태깅·푸시한 뒤, 필요하면 admin.yaml의
argocd-image-updater.argoproj.io/image-list 값(예:
frontend=.../pinhouse-admin/pinhouse-admin)과 다른 어노테이션 엔트리들을 실제 저장소 경로로 업데이트하세요.

argocd-image-updater.argoproj.io/frontend.update-strategy: newest-build
argocd-image-updater.argoproj.io/frontend.allow-tags: regexp:^[0-9]{8}_[0-9]{6}-[a-f0-9]{7}$
argocd-image-updater.argoproj.io/frontend.kustomize.image-name: REPLACE_ME
Expand Down
2 changes: 1 addition & 1 deletion k8s-argocd/applications/dev/app/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
finalizers:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd-image-updater.argoproj.io/image-list: backend=asia-northeast3-docker.pkg.dev/dev-pinhouse/pinhouse-dev-be/pinhouse-server
argocd-image-updater.argoproj.io/image-list: backend=asia-northeast3-docker.pkg.dev/dev-pinhouse-2/pinhouse-dev-be/pinhouse-server
argocd-image-updater.argoproj.io/backend.update-strategy: newest-build
argocd-image-updater.argoproj.io/backend.allow-tags: regexp:^[0-9]{8}_[0-9]{6}-[a-f0-9]{7}$
argocd-image-updater.argoproj.io/backend.kustomize.image-name: REPLACE_ME
Expand Down
2 changes: 1 addition & 1 deletion k8s-argocd/applications/dev/app/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
finalizers:
- resources-finalizer.argocd.argoproj.io
annotations:
argocd-image-updater.argoproj.io/image-list: frontend=asia-northeast3-docker.pkg.dev/dev-pinhouse/pinhouse-dev-fe/pinhouse-web
argocd-image-updater.argoproj.io/image-list: frontend=asia-northeast3-docker.pkg.dev/dev-pinhouse-2/pinhouse-dev-fe/pinhouse-web
argocd-image-updater.argoproj.io/frontend.update-strategy: newest-build
argocd-image-updater.argoproj.io/frontend.allow-tags: regexp:^[0-9]{8}_[0-9]{6}-[a-f0-9]{7}$
argocd-image-updater.argoproj.io/frontend.kustomize.image-name: REPLACE_ME
Expand Down
4 changes: 2 additions & 2 deletions k8s-helm/platform-chart/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ certManager:

# DNS-01 Challenge (CloudDNS)
cloudDNS:
projectId: "dev-pinhouse"
projectId: "dev-pinhouse-2"
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 | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify GCP project readiness for Cert Manager and External Secrets

PROJECT_ID="dev-pinhouse-2"

echo "=== Checking if project exists ==="
gcloud projects describe "$PROJECT_ID" --format="value(projectId)" 2>/dev/null || echo "Project not found"

echo -e "\n=== Checking required APIs ==="
gcloud services list --enabled --project="$PROJECT_ID" --filter="name:(dns.googleapis.com OR secretmanager.googleapis.com)" --format="table(name)" 2>/dev/null

echo -e "\n=== Checking Secret Manager secrets with Dev_BE_ prefix ==="
gcloud secrets list --project="$PROJECT_ID" --filter="name~^Dev_BE_" --format="table(name)" 2>/dev/null

echo -e "\n=== Checking Secret Manager secrets for monitoring ==="
gcloud secrets list --project="$PROJECT_ID" --filter="name~^Dev_MONITORING_" --format="table(name)" 2>/dev/null

echo -e "\n=== Checking Swagger auth secret ==="
gcloud secrets list --project="$PROJECT_ID" --filter="name=Dev_SWAGGER_BASIC_AUTH" --format="table(name)" 2>/dev/null

Repository: PinHouse/PinHouse_CLOUD

Length of output: 309


🏁 Script executed:

# Check the values-dev.yaml file and surrounding context
cd k8s-helm/platform-chart || exit 1
wc -l values-dev.yaml
echo "---"
head -30 values-dev.yaml

Repository: PinHouse/PinHouse_CLOUD

Length of output: 565


🏁 Script executed:

# Search for External Secrets configuration and Secret Manager references
grep -n -i "secret\|externalsecret" k8s-helm/platform-chart/values-dev.yaml | head -40

Repository: PinHouse/PinHouse_CLOUD

Length of output: 1066


🏁 Script executed:

# Read the External Secrets configuration section
sed -n '178,262p' k8s-helm/platform-chart/values-dev.yaml

Repository: PinHouse/PinHouse_CLOUD

Length of output: 2402


dev-pinhouse-2 GCP 프로젝트에서 다음 필수 인프라 구성을 완료해야 배포가 정상 작동합니다.

Cert Manager의 DNS-01 Challenge와 External Secrets에서 GCP Secret Manager의 시크릿을 사용하기 위해 다음이 필수적으로 필요합니다:

  • CloudDNS API 활성화 및 Cert Manager 서비스 계정에 roles/dns.admin IAM 권한 부여
  • Secret Manager API 활성화 및 External Secrets 서비스 계정에 roles/secretmanager.secretAccessor IAM 권한 부여
  • GCP Secret Manager에 다음 시크릿 존재 확인:
    • Dev_BE_* (정규식 패턴, 라인 205-210)
    • Dev_SWAGGER_BASIC_AUTH (라인 233)
    • Dev_MONITORING_* (정규식 패턴, 라인 250-255)

이 사항들이 구성되지 않으면 Helm 배포 후 시크릿 동기화가 실패하고 애플리케이션이 정상 작동하지 않습니다.

🤖 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 `@k8s-helm/platform-chart/values-dev.yaml` at line 19, The values-dev.yaml sets
projectId: "dev-pinhouse-2" but the GCP project lacks required infra for DNS-01
and External Secrets; enable the Cloud DNS API and Secret Manager API for that
project, grant the Cert Manager service account roles/dns.admin and the External
Secrets service account roles/secretmanager.secretAccessor, and ensure the
required secrets exist in Secret Manager named to match Dev_BE_* (regex),
Dev_SWAGGER_BASIC_AUTH, and Dev_MONITORING_* so Helm chart secret sync (Cert
Manager DNS-01 challenge and External Secrets) can succeed.


# 게이트웨이
gateway:
Expand Down Expand Up @@ -185,7 +185,7 @@ externalSecrets:
spec:
provider:
gcpsm:
projectID: dev-pinhouse
projectID: dev-pinhouse-2

secrets:
- name: backend-secret-kv
Expand Down
8 changes: 4 additions & 4 deletions k8s-helm/releases/monitoring-loki/values-dev-gitops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ loki:
# Loki 로그 청크와 인덱스는 GCS 버킷에 저장합니다.
storage:
bucketNames:
chunks: "pinhouse-dev-loki"
ruler: "pinhouse-dev-loki"
admin: "pinhouse-dev-loki"
chunks: "pinhouse-dev-loki-terraform"
ruler: "pinhouse-dev-loki-terraform"
admin: "pinhouse-dev-loki-terraform"
gcs:
bucket_name: "pinhouse-dev-loki"
bucket_name: "pinhouse-dev-loki-terraform"

singleBinary:
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion k8s-helm/releases/monitoring-tempo/values-dev-gitops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tempo:
# 트레이스 원본 데이터는 GCS 버킷에 저장합니다.
trace:
gcs:
bucket_name: "pinhouse-dev-tempo"
bucket_name: "pinhouse-dev-tempo-terraform"
block:
retention: 336h

Expand Down
2 changes: 1 addition & 1 deletion k8s-kustomize/overlays/dev/admin/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nameSuffix: -dev
# ArgoCD Image Updater가 자동으로 newTag를 업데이트
images:
- name: REPLACE_ME
newName: asia-northeast3-docker.pkg.dev/dev-pinhouse/pinhouse-dev-admin/pinhouse-admin
newName: asia-northeast3-docker.pkg.dev/dev-pinhouse-2/pinhouse-dev-admin/pinhouse-admin
newTag: latest

# overlays 수정내용 반영
Expand Down
2 changes: 1 addition & 1 deletion k8s-kustomize/overlays/dev/backend/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nameSuffix: -dev
# ArgoCD Image Updater가 자동으로 newTag를 업데이트
images:
- name: REPLACE_ME
newName: asia-northeast3-docker.pkg.dev/dev-pinhouse/pinhouse-dev-be/pinhouse-server
newName: asia-northeast3-docker.pkg.dev/dev-pinhouse-2/pinhouse-dev-be/pinhouse-server
newTag: latest

# overlays 수정내용 반영
Expand Down
2 changes: 1 addition & 1 deletion k8s-kustomize/overlays/dev/frontend/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nameSuffix: -dev
# ArgoCD Image Updater가 자동으로 newTag를 업데이트
images:
- name: REPLACE_ME
newName: asia-northeast3-docker.pkg.dev/dev-pinhouse/pinhouse-dev-fe/pinhouse-web
newName: asia-northeast3-docker.pkg.dev/dev-pinhouse-2/pinhouse-dev-fe/pinhouse-web
newTag: latest

# overlays 수정내용 반영
Expand Down
1 change: 1 addition & 0 deletions k8s-kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ kind: Kustomization
resources:
- frontend
- backend
- admin
1 change: 1 addition & 0 deletions k8s-kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ kind: Kustomization
resources:
- frontend
- backend
- admin
2 changes: 1 addition & 1 deletion terraform/environments/dev/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ========================================
terraform {
backend "gcs" {
bucket = "pinhouse-dev-state-bucket"
bucket = "pinhouse-dev-terraform-state-bucket"
prefix = "terraform/dev/state"
}
}
6 changes: 3 additions & 3 deletions terraform/environments/dev/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module "storage" {
# 기본 버킷 추가
var.create_storage_buckets ? tomap({
static_assets = {
name = "${var.project}-${var.environment}"
name = "${var.project}-${var.environment}-terraform"
storage_class = "STANDARD"
uniform_bucket_level_access = true
versioning_enabled = true
Expand Down Expand Up @@ -53,7 +53,7 @@ module "storage" {
# 모니터링 버킷 추가
var.create_monitoring_buckets ? tomap({
loki = {
name = "${var.project}-${var.environment}-${var.monitoring_loki}"
name = "${var.project}-${var.environment}-${var.monitoring_loki}-terraform"
storage_class = "STANDARD"
uniform_bucket_level_access = true
versioning_enabled = true
Expand All @@ -62,7 +62,7 @@ module "storage" {
cors = []
}
tempo = {
name = "${var.project}-${var.environment}-${var.monitoring_tempo}"
name = "${var.project}-${var.environment}-${var.monitoring_tempo}-terraform"
storage_class = "STANDARD"
uniform_bucket_level_access = true
versioning_enabled = true
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/dev/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
variable "project_id" {
description = "배포 대상 GCP 프로젝트 ID입니다."
type = string
default = "dev-pinhouse"
default = "dev-pinhouse-2"
}

variable "project" {
Expand Down
Loading