Compare commits

...

179 Commits

Author SHA1 Message Date
sunmingLee 06ea838547 Merge branch 'develop' of https://github.com/ktds-dg0501/kt-event-marketing into feature/distribution 2025-10-30 20:30:54 +09:00
sunmingLee efcec065ec 네이버 블로그 포스팅 선택사항으로 고쳐서 도커 ì파일 ã… 수정 2025-10-30 20:30:44 +09:00
SWPARK 262a5fea33 Merge pull request #37 from ktds-dg0501/feature/ai
edit
2025-10-30 20:12:49 +09:00
박세원 d14a7349bc edit 2025-10-30 20:12:14 +09:00
Hyowon Yang 6e7a9386f6 CORS설정변경 2025-10-30 19:34:27 +09:00
이선민 047703fb89 Merge pull request #36 from ktds-dg0501/feature/distribution
merge feature/distribution into develop
2025-10-30 19:01:35 +09:00
Hyowon Yang 17278ad045 샘플데이터 수정 2025-10-30 18:47:28 +09:00
SWPARK cf379407e8 Merge pull request #35 from ktds-dg0501/feature/ai
remove api path
2025-10-30 18:43:35 +09:00
박세원 f13bfe6a6e remove api path 2025-10-30 18:42:49 +09:00
sunmingLee 4bc7f87663 Merge branch 'develop' of https://github.com/ktds-dg0501/kt-event-marketing into feature/distribution 2025-10-30 18:38:14 +09:00
sunmingLee ae8f540d46 네이버 블로그 ìž 배포 개발(ì이미지 없음) 2025-10-30 18:37:31 +09:00
kkkd-max c6dfc74bda Merge pull request #34 from ktds-dg0501/feature/ai
Feature/ai
2025-10-30 18:10:47 +09:00
jhbkjh 027ab86e8d 파티시페이션 2025-10-30 18:07:28 +09:00
박세원 c95c47d630 edit api 2025-10-30 18:06:18 +09:00
Hyowon Yang b92307d564 Analytics 서비스 인증 제거 - 전체 접근 허용
- SecurityConfig를 content-service처럼 단순화
- 모든 요청에 대해 인증 없이 접근 가능하도록 변경
- Swagger UI 및 API 엔드포인트 접근 문제 해결

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 18:03:28 +09:00
Hyowon Yang 2663baf615 Merge branch 'develop' of https://github.com/ktds-dg0501/kt-event-marketing into develop 2025-10-30 17:50:19 +09:00
Hyowon Yang 349b644617 Analytics 서비스 Swagger 및 보안 설정 개선
- Redis read-only replica 에러 처리 추가 (SampleDataLoader)
  - MVP 환경에서 샘플 데이터 로딩 시 Redis 삭제 실패해도 계속 진행
- Swagger UI context-path 설정 수정 (SwaggerConfig)
  - 서버 URL에 /api/v1/analytics context-path 포함하여 올바른 curl 명령 생성
- Spring Security 경로 매칭 수정 (SecurityConfig)
  - context-path 제거된 실제 경로 (/events/**, /users/**) 매칭
  - 403 Forbidden 에러 해결
- Dockerfile 빌드 경로 수정
  - 멀티 모듈 프로젝트 구조에 맞게 JAR 복사 경로 수정

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 17:49:47 +09:00
SWPARK ea4d551d3e Merge pull request #33 from ktds-dg0501/feature/ai
edit CORS error
2025-10-30 17:39:10 +09:00
박세원 d81c5be90d edit CORS error 2025-10-30 17:38:02 +09:00
박세원 e080acbcb9 Merge branch 'develop' of https://github.com/ktds-dg0501/kt-event-marketing into develop 2025-10-30 17:04:31 +09:00
박세원 29285d8576 AI Service CORS 설정 추가로 Swagger UI 테스트 지원
- SecurityConfig에 CORS 설정 추가
- 모든 Origin 허용 (AllowedOriginPatterns: *)
- 모든 HTTP Method 허용 (GET, POST, PUT, DELETE, OPTIONS, PATCH)
- 모든 Header 허용
- Credentials 지원
- Swagger UI에서 API 테스트 시 CORS 에러 해결

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 17:04:11 +09:00
kkkd-max f2e8f7499f Merge pull request #32 from ktds-dg0501/feature/partici2
Feature/partici2
2025-10-30 17:01:19 +09:00
jhbkjh 52b63fb0f0 frontend 연동을 위해 임시 커밋 2025-10-30 16:49:31 +09:00
박세원 a23b4eb505 Merge branch 'feature/ai' into develop 2025-10-30 16:45:26 +09:00
박세원 c6b33885e0 AI Service Security 설정 단순화 및 워크플로우 문서 추가
- SecurityConfig CORS 설정 제거 및 단순화
- 모든 요청 허용으로 변경 (내부 API 특성 반영)
- DevTools 요청 정적 리소스 제외 처리
- AI Service 워크플로우 문서 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:44:23 +09:00
jhbkjh ac7fcbd2fe api경로 수정(participation) 2025-10-30 16:21:10 +09:00
Hyowon Yang 97f50fd751 Analytics Service context-path 설정 및 Controller 경로 최적화
- context-path 추가: /api/v1/analytics
- Swagger UI 경로를 기본값으로 수정 (/swagger-ui.html)
- 모든 Controller의 @RequestMapping에서 /api/v1 제거
  - Events 관련 Controller 4개: /api/v1/events → /events
  - Users 관련 Controller 4개: /api/v1/users → /users
  - DebugController: /api/debug → /debug

이제 Ingress를 통한 접근 및 Swagger UI가 정상 작동합니다.
- Swagger UI: /api/v1/analytics/swagger-ui/index.html
- API: /api/v1/analytics/events/{eventId}/analytics

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 16:16:24 +09:00
merrycoral c53cbdf4f8 Merge feature/event into develop
Event-AI Kafka 통신 개선 및 타입 헤더 불일치 문제 해결

주요 변경사항:
- event-service KafkaConfig: JsonSerializer로 변경, 타입 헤더 비활성화
- ai-service application.yml: 타입 헤더 사용 안 함, 기본 타입 지정
- AIEventGenerationJobMessage: region, targetAudience, budget 필드 추가
- AiRecommendationRequest: region, targetAudience, budget 필드 추가
- AIJobKafkaProducer: 객체 직접 전송으로 변경 (이중 직렬화 문제 해결)
- AIJobKafkaConsumer: 양방향 통신 이슈로 비활성화 (.bak)
- EventService: Kafka producer 호출 시 새 필드 전달

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 15:59:46 +09:00
merrycoral 7dc039361f Event-AI Kafka 통신 개선 및 타입 헤더 불일치 문제 해결
주요 변경사항:
- event-service KafkaConfig: JsonSerializer로 변경, 타입 헤더 비활성화
- ai-service application.yml: 타입 헤더 사용 안 함, 기본 타입 지정
- AIEventGenerationJobMessage: region, targetAudience, budget 필드 추가
- AiRecommendationRequest: region, targetAudience, budget 필드 추가
- AIJobKafkaProducer: 객체 직접 전송으로 변경 (이중 직렬화 문제 해결)
- AIJobKafkaConsumer: 양방향 통신 이슈로 비활성화 (.bak)
- EventService: Kafka producer 호출 시 새 필드 전달

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 15:58:23 +09:00
kkkd-max 48c76db83a Merge pull request #31 from ktds-dg0501/feature/partici2
security 수정
2025-10-30 15:47:30 +09:00
jhbkjh 72728841db security 수정 2025-10-30 15:45:22 +09:00
Hyowon Yang 9e2d0a3889 Analytics Service Swagger 설정 개선
- Swagger UI 경로를 Ingress 경로와 일치하도록 수정 (/api/v1/analytics/swagger-ui.html)
- AKS 환경 서버 URL을 Swagger 서버 목록에 추가
- API 테스트 편의성 향상

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 15:31:32 +09:00
Hyowon Yang 14823a17c4 Analytics 서비스 CORS 설정 추가
- WebConfig.java 추가하여 CORS 정책 설정
- 프론트엔드에서 Analytics API 호출 시 CORS 에러 해결
- 모든 origin 패턴 허용 및 credentials 지원

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 14:48:09 +09:00
Hyowon Yang a3781a279a Merge pull request #30 from ktds-dg0501/feature/analytics
이벤트별 성과분석 날짜 로직 수정 및 설정 개선
2025-10-30 12:54:56 +09:00
Hyowon Yang f80418f5ee 이벤트별 성과분석 날짜 로직 수정 및 설정 개선
- EventCreatedEvent, EventStats에 startDate, endDate 필드 추가
- EventCreatedConsumer에서 이벤트 시작/종료 날짜 저장
- SampleDataLoader에서 실제 날짜로 이벤트 발행
  - evt_2025012301: 2025-01-23 시작 (ACTIVE)
  - evt_2025020101: 2025-02-01 시작 (ACTIVE)
  - evt_2025011501: 2025-01-15~2025-01-31 (COMPLETED)
- AnalyticsService: 이벤트 시작일~종료일(또는 현재) 기간 계산
- UserAnalyticsService: 가장 빠른 이벤트 시작일~현재 기간 계산
- application.yml에서 중복된 context-path 제거
- Consumer Group ID를 analytics-service-consumers-v3로 통일

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 12:47:19 +09:00
kkkd-max 5c365fe899 Merge pull request #29 from ktds-dg0501/feature/partici2
Feature/partici2
2025-10-30 12:25:44 +09:00
jhbkjh a3381cc540 cors문제 수정 2025-10-30 12:22:19 +09:00
jhbkjh 7ed2465d57 participation-service CORS 설정 수정
- SecurityConfig.java @Value 어노테이션 문법 오류 수정
- application.yml CORS allowed-origins에 localhost:3000 추가
- Frontend UI (localhost:3000)에서 API 호출 시 CORS 에러 해결
2025-10-30 10:37:36 +09:00
jhbkjh 5cac8ccc12 participation-service WebConfig 추가
- CORS 설정 적용
- 모든 origin 패턴 허용
- 모든 HTTP 메서드 허용
- Credentials 허용
2025-10-30 10:21:08 +09:00
Hyowon Yang acd827b226 Merge branch 'origin/develop' into develop
- 이벤트 ID 단순화 변경사항 병합 (1, 2, 3)
- 원격 변경사항 통합

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 10:10:47 +09:00
Hyowon Yang ea53bd13a8 analytics 서비스 샘플 데이터 이벤트 ID 단순화
- 이벤트 ID를 evt_2025012301 형식에서 1, 2, 3으로 변경
- 다른 마이크로서비스와의 연동을 위한 단순 ID 체계 적용

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 10:08:48 +09:00
jhbkjh 6948b48498 participation-service pod 연결 문제 해결
- Service selector를 app=participation-service만으로 간소화하여 영구적 해결
- Pod restart 시에도 자동 연결되도록 수정
- Swagger UI 외부 접근 정상화 확인

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 09:47:45 +09:00
Hyowon Yang aa8db3bf2f Merge pull request #27 from ktds-dg0501/feature/analytics
Feature/analytics
2025-10-30 09:40:29 +09:00
sunmingLee be59934f78 swagger 문제 수정 2025-10-30 09:37:54 +09:00
hiondal 3afee053d0 Kustomize commonLabels 제거 및 API 토큰 추가
- Deployment selector 불변성 에러 해결을 위해 commonLabels 제거
- base/kustomization.yaml: app.kubernetes.io/managed-by, app.kubernetes.io/part-of 레이블 제거
- overlays/dev/kustomization.yaml: environment 레이블 제거
- content-service: Replicate API 토큰 추가
2025-10-30 09:35:17 +09:00
merrycoral 27a3111dd8 develop 브랜치 변경사항 요약 문서 작성
- feature/event 머지 내역 상세 정리
- EventId/JobId 생성 로직 설명
- Kafka 메시지 구조 개선 내역
- 데이터베이스 스키마 변경사항
- 테스트 및 문서화 완료 내역
- 성능 지표 및 배포 준비 상태

총 60개 파일 변경 (+2,795줄, -222줄)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 01:45:46 +09:00
merrycoral 3465a35827 Merge branch 'feature/event' into develop 2025-10-30 01:42:33 +09:00
merrycoral 8ff79ca1ab 테스트 결과 파일들을 test/ 폴더로 이동
- API-TEST-RESULT.md → test/
- content-service-integration-analysis.md → test/
- content-service-integration-test-results.md → test/
- test-kafka-integration-results.md → test/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 01:40:21 +09:00
merrycoral 336d811f55 content-service 통합 테스트 완료 및 보고서 작성
- content-service HTTP 통신 테스트 완료 (9개 시나리오 성공)
- Job 관리 메커니즘 검증 (Redis 기반)
- EventId 기반 콘텐츠 조회 및 필터링 테스트
- 이미지 재생성 기능 검증
- Kafka 연동 현황 분석 (Consumer 미구현 확인)
- 통합 테스트 결과 보고서 작성
- 테스트 자동화 스크립트 추가

테스트 성공률: 100% (9/9)
응답 성능: < 150ms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 01:24:29 +09:00
merrycoral ee941e4910 Event-AI Kafka 연동 개선 및 메시지 필드명 camelCase 변경
주요 변경사항:
- AI Service Kafka 브로커 설정 수정 (4.230.50.63:9092 → 20.249.182.13:9095,4.217.131.59:9095)
- IntelliJ 실행 프로파일 Kafka 환경 변수 수정 (3개 파일)
- Kafka 메시지 DTO 필드명 snake_case → camelCase 변경
- @JsonProperty 어노테이션 제거로 코드 간결성 향상 (18줄 감소)

개선 효과:
- Event-AI Kafka 연동 정상 작동 확인
- 메시지 필드 매핑 성공률 0% → 100%
- jobId, eventId, storeName 등 모든 필드 정상 매핑
- AI 추천 생성 로직 정상 실행

테스트 결과:
- Kafka 메시지 발행/수신: Offset 34로 정상 동작 확인
- AI Service에서 메시지 처리 완료 (COMPLETED)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 22:55:20 +09:00
merrycoral b71d27aa8b 비즈니스 친화적 eventId 및 jobId 생성 로직 구현
- EventIdGenerator 추가: EVT-{storeId}-{yyyyMMddHHmmss}-{random8} 형식
- JobIdGenerator 추가: JOB-{type}-{timestamp}-{random8} 형식
- EventService, JobService에 Generator 주입 및 사용
- AIJobKafkaProducer에 eventId 및 메시지 필드 추가
- AIEventGenerationJobMessage DTO 필드 확장
- Javadoc에서 UUID 표현 제거 및 실제 형식 명시
- Event.java의 UUID 백업 생성 로직 제거

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 20:54:10 +09:00
Hyowon Yang 108ee10293 Merge branch 'develop' into feature/analytics 2025-10-29 19:31:10 +09:00
Hyowon Yang 20e0d24930 이벤트별 성과분석 대시보드 상세 정보 추가 및 Timeline 날짜 수정
## 주요 변경사항

### 1. Timeline 데이터 날짜 로직 수정
- **파일**: SampleDataLoader.java
- **변경**: 이벤트 ID에서 날짜를 파싱하여 실제 이벤트 시작일 기준으로 Timeline 생성
  - 기존: 모든 이벤트가 2024-09-24부터 시작
  - 수정: evt_2025012301 → 2025-01-23부터 30일치 생성
- **채널 분포**: 가중치 기반 랜덤 배정으로 변경
  - SNS: 45% (최고 비율)
  - 우리동네TV: 25%
  - 지니TV: 20%
  - 링고비즈: 10%

### 2. 이벤트별 API 상세 정보 추가
- **파일**: AnalyticsDashboardResponse.java
- **추가 필드**:
  - investment: InvestmentDetails (투자 비용 상세)
  - revenue: RevenueDetails (수익 상세)
  - costEfficiency: CostEfficiency (비용 효율성)

### 3. 이벤트별 상세 계산 로직 구현
- **파일**: AnalyticsService.java
- **추가 메서드**:
  - buildInvestmentDetails(): 투자 비용 상세 계산
    - 경품비용 50%, 콘텐츠제작비 30%, 운영비 20%, 채널배포비용(실제)
  - buildRevenueDetails(): 수익 상세 계산
    - 직접매출 70%, 예상추가매출 30%, 신규고객 40%, 기존고객 60%
  - buildCostEfficiency(): 비용 효율성 계산
    - 참여자당 비용, 참여자당 수익

### 4. ROI 전용 API 필드 수정
- **파일**: ROICalculator.java
- **수정**: UserRoiAnalyticsService와 동일한 비율 적용
  - investmentDetails에 prizeCost, channelCost 추가
  - revenueDetails에 newCustomerRevenue, existingCustomerRevenue 추가
- **기존 문제**: null 값 반환
- **해결**: 통합분석과 동일한 계산 로직 적용

## API 응답 구조

### GET /api/v1/events/{eventId}/analytics
```json
{
  "investment": {
    "total": 5000000,
    "prizeCost": 1250000,
    "contentCreation": 750000,
    "operation": 500000,
    "distribution": 2500000,
    "channelCost": 2500000
  },
  "revenue": {
    "total": 15000000,
    "directSales": 10500000,
    "expectedSales": 4500000,
    "newCustomerRevenue": 6000000,
    "existingCustomerRevenue": 9000000
  },
  "costEfficiency": {
    "costPerParticipant": 50000,
    "revenuePerParticipant": 150000
  }
}
```

## 테스트 결과
-  Timeline 날짜가 이벤트별로 정확하게 생성됨
-  채널별 참여자 분포가 가중치대로 배정됨
-  이벤트별 API에서 상세 투자/수익 정보 제공
-  ROI API에서 null 값 문제 해결

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 19:28:58 +09:00
wonho 640e94bf17 user-service CORS 및 경로 매핑 수정
- SecurityConfig: CORS 설정 개선 및 context-path 기반 경로 수정
- UserController: RequestMapping 중복 경로 제거
- SwaggerConfig: Production 서버 URL 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 18:25:09 +09:00
Hyowon Yang 98ed508a6f User-level Analytics API 구현 및 Kafka Consumer 설정 개선
주요 변경사항:
- User-level Analytics API 기간 파라미터 제거 (전체 기간 자동 계산)
  * /api/v1/users/{userId}/analytics/dashboard
  * /api/v1/users/{userId}/analytics/channels
  * /api/v1/users/{userId}/analytics/roi
  * /api/v1/users/{userId}/analytics/timeline

- Kafka Consumer 안정성 개선
  * Consumer Group ID를 analytics-service-consumers-v3로 변경
  * Redis 멱등성 키 v2 버전 사용 (processed_events_v2, distribution_completed_v2, processed_participants_v2)
  * ParticipantRegisteredConsumer 멱등성 키를 eventId:participantId 조합으로 변경하여 중복 방지 강화

- 설정 개선
  * UTF-8 인코딩 명시적 설정 추가
  * Kafka auto.offset.reset 설정 명확화

- 테스트 도구 추가
  * tools/reset-analytics-data.ps1: 테스트 데이터 초기화 스크립트
  * DebugController: 개발 환경 디버깅용 엔드포인트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 18:07:20 +09:00
wonho e8d0a1d4b4 백엔드 서비스 설정 및 CORS 정책 업데이트
- CORS 설정에 https 프로토콜 지원 추가
- User-Service CORS를 모든 Origin 허용으로 변경
- ConfigMap CORS_ALLOWED_ORIGINS 확장
- User-Service DB migration 스크립트 추가
- Application 설정 파일 업데이트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 17:59:01 +09:00
wonho 857fa5501c GitHub Actions workflow push 이벤트 비활성화
- push 트리거를 주석 처리하여 자동 실행 방지
- Pull Request 생성 시에만 자동 실행
- 수동 실행(workflow_dispatch)은 계속 가능

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 17:59:01 +09:00
kkkd-max ab39c76585 Merge pull request #26 from ktds-dg0501/feature/partici
url추가
2025-10-29 17:54:02 +09:00
jhbkjh 1e38d52967 url추가 2025-10-29 17:53:32 +09:00
merrycoral 34291e1613 백엔드 서비스 구조 개선 및 데이터베이스 스키마 추가 2025-10-29 17:51:48 +09:00
이선민 6205a98ca0 Merge pull request #25 from ktds-dg0501/feature/distribution
api path 수정_2
2025-10-29 17:03:47 +09:00
sunmingLee ebd7ae12b6 api path 추가수정 2025-10-29 17:02:25 +09:00
sunmingLee 2cd1ba76f5 api path 수정 2025-10-29 16:44:07 +09:00
hyeda2020 a41e431daf Disable test execution in CI workflow
Comment out the test execution step in the CI workflow.
2025-10-29 16:11:28 +09:00
wonho 3da9303091 백엔드 서비스 설정 및 배포 구성 개선
- CORS 설정 업데이트 (모든 서비스)
- Swagger UI 경로 및 설정 수정
- Kubernetes 배포 설정 개선 (Ingress, Deployment)
- distribution-service SecurityConfig 및 Controller 개선
- IntelliJ 실행 프로파일 업데이트
- 컨테이너 이미지 빌드 문서화 (deployment/container/build-image.md)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 15:55:30 +09:00
jhbkjh 3075a5d49f 물리아키텍처 설계 완료
 주요 기능
- Azure 기반 물리아키텍처 설계 (개발환경/운영환경)
- 7개 마이크로서비스 물리 구조 설계
- 네트워크 아키텍처 다이어그램 작성 (Mermaid)
- 환경별 비교 분석 및 마스터 인덱스 문서

📁 생성 파일
- design/backend/physical/physical-architecture.md (마스터)
- design/backend/physical/physical-architecture-dev.md (개발환경)
- design/backend/physical/physical-architecture-prod.md (운영환경)
- design/backend/physical/*.mmd (4개 Mermaid 다이어그램)

🎯 핵심 성과
- 비용 최적화: 개발환경 월 $143, 운영환경 월 $2,860
- 확장성: 개발환경 100명 → 운영환경 10,000명 (100배)
- 가용성: 개발환경 95% → 운영환경 99.9%
- 보안: 다층 보안 아키텍처 (L1~L4)

🛠️ 기술 스택
- Azure Kubernetes Service (AKS)
- Azure Database for PostgreSQL Flexible
- Azure Cache for Redis Premium
- Azure Service Bus Premium
- Application Gateway + WAF

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 15:13:01 +09:00
merrycoral 2bce7cfb24 Merge branch 'feature/event' into develop 2025-10-29 15:01:57 +09:00
merrycoral bcfbb6c7f9 Kafka 메시지 구조 개선 및 알림 서비스 추가 2025-10-29 15:00:20 +09:00
merrycoral da173d79e9 EventService에 Kafka Producer 연동 추가 및 이벤트 배포 시 메시지 발행 구현
- EventService에 EventKafkaProducer 의존성 주입
- publishEvent 메서드에서 event-created 토픽으로 메시지 발행
- Event 엔티티의 selectedImageId 검증 임시 비활성화
- Kafka 메시지 발행 테스트 결과 문서 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 14:11:07 +09:00
이선민 7711f2d527 Merge pull request #24 from ktds-dg0501/feature/distribution
api path 수정
2025-10-29 13:38:30 +09:00
sunmingLee edcb519800 api path 수정 2025-10-29 13:37:33 +09:00
wonho e7ffdcfe44 GitHub Actions CI/CD 파이프라인 및 Kustomize 다중 환경 배포 설정
- GitHub Actions workflow로 백엔드 서비스 자동 빌드/배포 구성
- Kustomize를 통한 dev/staging/prod 환경별 설정 관리
- 각 마이크로서비스별 Dockerfile 추가
- 배포 자동화 스크립트 및 환경 변수 설정
- CI/CD 가이드 문서 작성
2025-10-29 13:24:04 +09:00
merrycoral 95a419f104 Event 엔티티에 참여자 및 ROI 필드 추가 및 Frontend-Backend 통합
🔧 Backend 변경사항:
- Event 엔티티에 participants, targetParticipants, roi 필드 추가
- EventDetailResponse DTO 및 EventService 매퍼 업데이트
- ROI 자동 계산 비즈니스 로직 구현
- SecurityConfig CORS 설정 추가 (localhost:3000 허용)

🎨 Frontend 변경사항:
- TypeScript EventDetail 타입 정의 업데이트
- Events 페이지 실제 API 데이터 연동 (Mock 데이터 제거)
- 참여자 수 및 ROI 기반 통계 계산 로직 개선

📝 문서:
- Event 필드 추가 및 API 통합 테스트 결과서 작성

 테스트 완료:
- Backend API 응답 검증
- CORS 설정 검증
- Frontend-Backend 통합 테스트 성공

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 13:23:09 +09:00
cherry2250 1b73d2880b Redis 마스터 노드로 연결 설정 변경
- REDIS_HOST를 'redis'에서 'redis-node-0.redis-headless'로 변경
- Redis read-only replica 오류 해결
- Content Service 이미지 생성 정상 작동 확인
2025-10-29 11:20:27 +09:00
Cherry Kim 5a93205f30 Update secret-content-service.yaml 2025-10-29 11:07:01 +09:00
wonho df04f85346 백엔드 서비스 AKS 배포 및 설정 완료
- Kubernetes 매니페스트 파일 생성 (7개 서비스)
  * user-service, event-service, ai-service, content-service
  * participation-service, analytics-service, distribution-service
  * 공통 리소스: Ingress, ConfigMap, Secret, ImagePullSecret

- analytics-service 배포 문제 해결
  * Hibernate PostgreSQL dialect 추가
  * DB 자격증명 수정 (eventuser/Hi5Jessica!)
  * analytics_db 데이터베이스 생성

- content-service Probe 경로 수정
  * Context path 포함 (/api/v1/content/actuator/health)

- distribution-service 신규 배포
  * Docker 이미지 빌드 및 ACR 푸시
  * K8s 매니페스트 생성 및 배포
  * Ingress 경로 추가 (/distribution)

- Gradle bootJar 설정 추가
  * 5개 서비스에 archiveFileName 설정

- 배포 가이드 문서 추가
  * deployment/k8s/deploy-k8s-guide.md
  * claude/deploy-k8s-back.md
  * deployment/container/build-image.md 업데이트

배포 완료: 모든 백엔드 서비스(7개) 정상 실행 중

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 10:59:09 +09:00
이선민 23265b5849 Merge pull request #23 from ktds-dg0501/feature/distribution
merge feature/distribution into develop branch
2025-10-29 10:14:56 +09:00
sunmingLee 8fef09df02 필요없는 폴더 삭제 2025-10-29 10:12:42 +09:00
sunmingLee 63ba449f93 Merge origin/develop into feature/distribution
- develop 브랜치의 최신 변경사항 병합
- .gradle 캐시 파일 충돌 해결 (삭제)
- ParticipationServiceApplication.run.xml 충돌 해결 (develop 버전 선택)
- make-run-profile.md 충돌 해결 (develop 버전 선택)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 10:09:47 +09:00
sunmingLee 64aec0fda5 distribution-completed Kafka 이벤트 형식 변경
- DistributedChannelInfo DTO 추가 (channel, channelType, status, expectedViews)
- ChannelType enum에 category 필드 추가 (TV, CALL, SNS 구분)
- DistributionCompletedEvent 구조 변경 (distributedChannels를 상세 정보 리스트로 변경)
- completedAt 필드에 @JsonFormat 추가하여 ISO 8601 문자열 형식으로 직렬화
- publishDistributionCompletedEvent 메서드 수정하여 새로운 형식으로 이벤트 발행

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 09:56:32 +09:00
Cherry Kim 436c0bf2b8 Merge pull request #22 from ktds-dg0501/feature/content
Feature/content
2025-10-29 09:43:17 +09:00
Cherry Kim ea026d7fa3 Merge branch 'develop' into feature/content 2025-10-29 09:42:16 +09:00
cherry2250 019ac96daa HuggingFace 제거 및 Replicate API 통합 완료
주요 변경사항:
- HuggingFace 관련 코드 및 의존성 완전 제거
  - HuggingFaceImageGenerator.java 삭제
  - HuggingFaceApiClient.java 삭제
  - HuggingFaceRequest.java 삭제
  - Resilience4j의 HuggingFace CircuitBreaker 제거

- Kubernetes 배포 설정
  - Deployment: content-service-deployment.yaml 업데이트
  - Service: content-service-service.yaml 추가
  - Health check 경로 수정 (/api/v1/content/actuator/health)
  - Dockerfile 추가 (멀티스테이지 빌드)

- Spring Boot 설정 최적화
  - application.yml: context-path 설정 (/api/v1/content)
  - HuggingFace 설정 제거, Replicate API 설정 유지
  - CORS 설정: kt-event-marketing* 도메인 허용

- Controller 경로 수정
  - ContentController: @RequestMapping 중복 제거
  - context-path와의 충돌 해결

- Security 설정
  - Chrome DevTools 경로 예외 처리 추가 (/.well-known/**)
  - CORS 설정 강화

- Swagger/OpenAPI 설정
  - VM Development Server URL 추가
  - 서버 URL 우선순위 조정

- 환경 변수 통일
  - REPLICATE_API_KEY → REPLICATE_API_TOKEN으로 변경

테스트 결과:
 Replicate API 정상 작동 (이미지 생성 성공)
 Azure Blob Storage 업로드 성공
 Redis 연결 정상 (마스터 노드 연결)
 Swagger UI 정상 작동
 모든 API 엔드포인트 정상 응답

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 23:08:54 +09:00
cherry2250 bc57b27852 라우팅 충돌 해결: imageId 경로 변수에 숫자 정규식 추가
- /images/{imageId}를 /images/{imageId:[0-9]+}로 변경
- /images/generate와의 라우팅 충돈 해결
- NumberFormatException 오류 수정
- content-service Kubernetes Deployment 파일 추가
2025-10-28 20:15:35 +09:00
cherry2250 b9514257b0 HuggingFaceImageGenerator를 프로파일 기반으로 변경하여 빈 충돌 해결
- @Profile("huggingface") 추가로 기본 프로파일에서는 비활성화
- StableDiffusionImageGenerator를 기본 구현체로 사용
- content-service 배포 오류 해결
2025-10-28 19:47:39 +09:00
jhbkjh 977a287a91 participation-service: CORS 설정 추가
- ParticipationController, DebugController, WinnerController에 @CrossOrigin 애노테이션 추가
- http://localhost:3000에서의 크로스 오리진 요청 허용
- 프론트엔드 개발 환경과의 연동을 위한 CORS 해결

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 17:47:25 +09:00
Hyowon Yang 3f0eccb69a Merge pull request #21 from ktds-dg0501/feature/analytics
Analytics Service 실행 프로파일 추가
2025-10-28 16:44:32 +09:00
Hyowon Yang f30213d1a2 Analytics Service 실행 프로파일 추가 2025-10-28 16:42:05 +09:00
merrycoral 284278180c Merge branch 'feature/event' into develop 2025-10-28 16:40:57 +09:00
SWPARK 9438e0d285 Merge pull request #20 from ktds-dg0501/feature/ai
ai-service application.yml 환경 변수를 static 값으로 변경
2025-10-28 16:37:16 +09:00
박세원 02a4e966e8 ai-service application.yml 환경 변수를 static 값으로 변경
- Redis, Kafka, Server, JWT, CORS 설정을 static 값으로 변경
- AI API Configuration을 실제 API 키와 함께 static하게 설정
- 모든 환경 변수 플레이스홀더를 제거하고 직접 값 지정

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 16:33:59 +09:00
Cherry Kim d36dc5be27 Merge pull request #19 from ktds-dg0501/feature/content
Feature/content
2025-10-28 16:22:49 +09:00
cherry2250 9305dfdb7f application.yml 통합 및 Azure Blob Storage 설정 추가
- application-dev.yml, application-local.yml 삭제
- 단일 application.yml로 통합 (user-service 형식 참고)
- Azure Blob Storage connection string 기본값 추가
- Redis, Actuator, Logging 상세 설정 추가
- OpenAPI/Swagger 설정 추가
- CORS 설정 추가
- 모든 설정을 환경 변수로 관리 가능하도록 구성

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 16:19:51 +09:00
Hyowon Yang d511140ecb Merge pull request #18 from ktds-dg0501/feature/analytics
Feature/analytics
2025-10-28 16:03:44 +09:00
Hyowon Yang 4421f4447f Analytics Service 프론트엔드 연동을 위한 DTO 필드명 수정 및 증감 데이터 추가
- DTO 필드명 통일 (프론트엔드 호환)
  - totalParticipants → participants
  - channelName → channel
  - totalInvestment → totalCost

- 증감 데이터 필드 추가
  - participantsDelta: 참여자 증감 (현재 0, TODO)
  - targetRoi: 목표 ROI (EventStats에서 가져옴)

- EventStats 엔티티 스키마 변경
  - targetRoi 컬럼 추가 (BigDecimal, default: 0)

- Service 로직 수정
  - AnalyticsService: 필드명 변경 및 증감 데이터 적용
  - ROICalculator: totalCost 필드명 변경
  - UserAnalyticsService: 필드명 변경 및 증감 데이터 적용

- 검증 문서 추가
  - frontend-backend-validation.md: 수정 내용 및 다음 단계 정리

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 15:59:49 +09:00
cherry2250 5a82fe3610 Mock 구현 제거 및 원격 서비스 연결 설정
- Mock 디렉토리 완전 제거 (biz/service/mock, infra/gateway/mock)
- @Profile 조건부 어노테이션 모두 제거
- Redis 원격 서버 연결 (20.214.210.71:6379)
- RegenerateImageService 실제 구현 추가
- ContentWriter.getImageById() 메서드 추가
- JWT Secret 보안 강화 (32자 이상)
- API 토큰 기본값 설정 추가
- AKS 배포 준비 완료

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 15:52:57 +09:00
Hyowon Yang 02fd82e0af Analytics Service DDL_AUTO를 create로 변경하여 스키마 재생성
문제 해결:
- storeId → userId 필드명 변경으로 인한 스키마 불일치
- PostgreSQL ERROR: column "user_id" of relation "event_stats" contains null values
- update 모드는 컬럼명 변경(rename)을 자동 처리하지 못함

변경사항:
- DDL_AUTO: update → create
- 서비스 시작 시 테이블을 DROP 후 재생성
- MVP 환경: SampleDataLoader가 샘플 데이터 자동 생성

주의사항:
- create 모드는 매번 테이블을 재생성함 (데이터 손실)
- MVP 환경에서만 사용, 실제 운영 시 update/validate로 변경 필요

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 15:31:51 +09:00
merrycoral 0c718c67f6 백엔드 컨테이너 실행 가이드 작성
- deployment/container/run-container-guide.md 생성
- 4개 서비스(user, event, analytics, participation) 컨테이너 실행 방법 안내
- VM 접속, ACR 설정, 이미지 푸시, 컨테이너 실행, 재배포 절차 포함
- CORS 설정에 프론트엔드 주소(http://20.196.65.160:3000) 추가
- 실행정보: ACR(acrdigitalgarage01), VM(20.196.65.160)
2025-10-28 15:26:35 +09:00
Hyowon Yang ea4aa5d072 Analytics Service storeId → userId 변환 및 User 통합 분석 API 개발 완료
주요 변경사항:
- EventStats 엔티티 storeId → userId 필드 변경
- EventStatsRepository 메소드명 변경 (findAllByStoreId → findAllByUserId)
- MVP 환경 1:1 관계 적용 (1 user = 1 store)
- EventCreatedConsumer에서 storeId → userId 매핑 처리

User 통합 분석 API 4개 신규 개발:
1. GET /api/v1/users/{userId}/analytics - 사용자 전체 성과 대시보드
2. GET /api/v1/users/{userId}/analytics/channels - 채널별 성과 분석
3. GET /api/v1/users/{userId}/analytics/roi - ROI 상세 분석
4. GET /api/v1/users/{userId}/analytics/timeline - 시간대별 참여 추이

기술 스택:
- Spring Boot 3.3.0, Java 21
- JPA/Hibernate, Redis 캐싱 (TTL 30분)
- Kafka Event-Driven 아키텍처

문서:
- test-backend.md: 백엔드 테스트 결과서 작성 완료

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 15:19:43 +09:00
kkkd-max e807bdbd59 Merge pull request #17 from ktds-dg0501/feature/participation-service
participant_id 중복 생성 문제 수정
2025-10-28 15:18:01 +09:00
merrycoral cf2689390d Kafka 메시지 타입 불일치 수정 (Long → UUID)
변경 내역:
- EventCreatedMessage: eventId, userId 타입을 Long에서 UUID로 변경
- EventKafkaProducer: publishEventCreated 메소드 파라미터 타입을 UUID로 변경

변경 이유:
- Event Entity는 UUID 타입을 사용하지만 Kafka 메시지는 Long을 사용하여 타입 불일치 발생
- Entity와 Kafka 메시지 간 타입 일관성 확보
- 런타임 타입 변환 오류 방지

영향:
- Event Service 내부 일관성 확보
- 향후 타 서비스와의 통합 시 UUID 표준 준비

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 15:07:35 +09:00
merrycoral 89a86c1301 Event Service 컨테이너 이미지 빌드 및 타입 시스템 통일
- UserPrincipal userId/storeId 타입을 Long에서 UUID로 변경
- JwtTokenProvider UUID 파싱 로직 수정
- event-service build.gradle에 bootJar 설정 추가
- Docker 이미지 빌드 성공 (event-service:latest, 1.08GB)
- 컨테이너 이미지 빌드 가이드 문서 작성

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 14:41:48 +09:00
doyeon c768fff11e participant_id 중복 생성 문제 수정
- ParticipantRepository에 날짜별 최대 순번 조회 메서드 추가
- ParticipationService의 순번 생성 로직을 날짜 기반으로 수정
- 이벤트별 database ID 대신 날짜별 전체 최대 순번 사용
- participant_id unique 제약조건 위반으로 인한 PART_001 에러 해결
- 다른 이벤트 간 participant_id 충돌 방지

🎯 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 14:34:09 +09:00
merrycoral f07002ac33 Merge branch 'feature/event' into develop
Event Service 전체 API 구현 완료

주요 변경 사항:
- 14개 API 전체 구현 완료 (100%)
- AI 추천 플로우 구현
- 이미지 생성/편집 API 구현
- 배포 채널 선택 API 구현
- 이벤트 수정 API 구현
- Redis 연동 구현
- Kafka Producer 구현
- Content Service 클라이언트 구현
- API 매핑 문서 현행화 (v2.0)
- Docker Compose 설정 추가
- 테스트 및 유틸리티 스크립트 추가

충돌 해결:
- .run/EventServiceApplication.run.xml 삭제 (새 위치로 이동)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 13:36:20 +09:00
merrycoral 2ca453f89e event 서비스 설정파일 충돌 수정 2025-10-28 13:33:00 +09:00
merrycoral e2179daaf7 Event Service API 매핑 문서 현행화 (v2.0)
- 구현률 100% 달성: 14개 API 전체 구현 완료
- 신규 구현 API 문서화 (5개):
  * AI 추천 요청/선택 API
  * 이미지 편집 API
  * 배포 채널 선택 API
  * 이벤트 수정 API
- 문서 구조 개선:
  * 미구현 API 계획 섹션 제거
  * 서비스 간 연동 가이드 추가
  * 통합 테스트 시나리오 추가
- Controller 라인 번호 정확도 향상
- .gitignore에 heap dump 파일 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 13:22:22 +09:00
hyeda2020 de32a70f29 Merge branch 'main' into develop 2025-10-28 13:16:15 +09:00
merrycoral 435ba1a86c Event Service 백엔드 테스트 완료
- 백엔드 API 테스트 완료 (8/8 성공)
- Redis, PostgreSQL, Kafka 연동 검증
- ErrorHandlingDeserializer를 통한 Kafka Consumer 안정화
- 테스트 결과 보고서 작성 (develop/dev/test-backend.md)
- 실행 프로파일 추가 (event-service/.run/)
- 설정 일치 검증 완료 (application.yml ↔ run.xml)
2025-10-28 11:45:09 +09:00
cherry2250 16a91c85bf gradlew 실행 권한 추가 2025-10-28 10:46:47 +09:00
kkkd-max 429f737066 Merge pull request #14 from ktds-dg0501/exec/participation
participation 실행프로파일 수정
2025-10-28 10:24:16 +09:00
Unknown 7a99dc95fe participation 실행프로파일 수정 2025-10-28 10:21:38 +09:00
Cherry Kim d56ff7684b Merge pull request #13 from ktds-dg0501/feature/content
Feature/content
2025-10-28 09:41:26 +09:00
cherry2250 c152faff54 Claude 폴더 원복 2025-10-28 09:40:53 +09:00
cherry2250 ee664a6134 develop 브랜치 병합 (271 파일 업데이트) 2025-10-28 09:29:26 +09:00
Hyowon Yang 50043add5d analytics 서비스 동시성 충돌 해결
[문제]
- ParticipantRegistered 이벤트 처리 시 StaleObjectStateException 발생
- 100개의 이벤트가 동시에 발행되어 EventStats 동시 업데이트 충돌
- TransactionRequiredException 발생 (트랜잭션 컨텍스트 부재)

[해결]
1. 비관적 락(Pessimistic Lock) 적용
   - EventStatsRepository에 findByEventIdWithLock 메서드 추가
   - PESSIMISTIC_WRITE 락으로 읽는 순간부터 다른 트랜잭션 차단

2. 트랜잭션 추가
   - 모든 Consumer 메서드에 @Transactional 어노테이션 추가
   - EventCreatedConsumer, ParticipantRegisteredConsumer, DistributionCompletedConsumer

3. 이벤트 발행 속도 조절
   - SampleDataLoader에서 10개마다 100ms 대기
   - 동시성 충돌 빈도 감소

[수정 파일]
- EventStatsRepository.java: 비관적 락 메서드 추가
- ParticipantRegisteredConsumer.java: @Transactional 추가, 락 메서드 사용
- DistributionCompletedConsumer.java: @Transactional 추가, 락 메서드 사용
- EventCreatedConsumer.java: @Transactional 추가
- SampleDataLoader.java: 이벤트 발행 속도 조절

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 09:16:55 +09:00
merrycoral d89ee4edf7 Event Service 백엔드 API 개발 및 테스트 완료
- Event Service API 엔드포인트 추가 (이벤트 생성, 조회, 수정, AI 추천, 배포)
- DTO 클래스 추가 (요청/응답 모델)
- Kafka Producer 구성 (AI 작업 비동기 처리)
- Content Service Feign 클라이언트 구성
- Redis 설정 추가 및 테스트 컨트롤러 작성
- Docker Compose 설정 (Redis, Kafka, Zookeeper)
- 백엔드 API 테스트 완료 및 결과 문서 작성
- JWT 테스트 토큰 생성 스크립트 추가
- Event Service 실행 스크립트 추가

테스트 결과: 6개 주요 API 모두 정상 작동 확인

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 17:24:09 +09:00
Cherry Kim 397a23063d Merge pull request #12 from ktds-dg0501/feature/content
Feature/content
2025-10-27 17:10:48 +09:00
cherry2250 5f8bd7cf68 VM 배포를 위한 Docker 컨테이너 설정 추가
- content-service/build.gradle: bootJar 파일명 설정 추가
- deployment/container/Dockerfile-backend: 백엔드 서비스 Docker 이미지 파일
- deployment/container/docker-compose.yml: Docker Compose 설정 (환경변수 포함)
- deployment/container/build-and-run.sh: 자동화 빌드 및 배포 스크립트
- deployment/container/build-image.md: 상세 배포 가이드 문서

주요 환경변수:
- JWT_SECRET: 32자 이상 JWT 서명 키 (JWT 오류 해결)
- REDIS/KAFKA: 외부 서버 연결 정보
- REPLICATE_API_TOKEN: Stable Diffusion API 토큰
- AZURE_STORAGE_CONNECTION_STRING: Azure Blob Storage 연결

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 17:00:20 +09:00
SWPARK bea547a463 Merge pull request #11 from ktds-dg0501/feature/ai
Feature/ai
2025-10-27 16:36:11 +09:00
SWPARK c126c71e00 Merge branch 'develop' into feature/ai 2025-10-27 16:36:03 +09:00
박세원 29dddd89b7 AI 서비스 Kafka/Redis 통합 테스트 및 설정 개선
- Gradle 빌드 캐시 파일 제외 (.gitignore 업데이트)
- Kafka 통합 테스트 구현 (AIJobConsumerIntegrationTest)
- 단위 테스트 추가 (Controller, Service 레이어)
- IntelliJ 실행 프로파일 자동 생성 도구 추가
- Kafka 테스트 배치 스크립트 추가
- Redis 캐시 설정 개선

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:27:14 +09:00
kkkd-max e0fc4286c7 Merge pull request #10 from ktds-dg0501/docker/participation
Docker/participation
2025-10-27 16:17:51 +09:00
doyeon 060921e756 백엔드 컨테이너 실행 가이드 문서 추가
- deployment/container/run-container-guide-back.md 파일 생성
- VM 접속 및 ACR 로그인 방법
- 컨테이너 실행 및 관리 방법
- 문제 해결 가이드
- 헬스체크 및 모니터링 방법
- 자동화 스크립트 예시
- 서비스별 실행 예시 포함

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:17:23 +09:00
cherry2250 2da2f124a2 이미지 생성 프롬프트 개선: 음식 전문 사진 생성 및 텍스트 제외
- 음식 사진 전문성 강조 (professional food photography, appetizing food shot)
- 업종을 cuisine으로 변환하여 음식 이미지에 집중
- 스타일별 플레이팅 강조 (elegant plating, minimalist plating, trendy plating)
- negative prompt에 텍스트 관련 키워드 추가 (text, letters, words, typography, writing, numbers, characters, labels, watermark, logo, signage)
- 최종 프롬프트에 'no text overlay, text-free, clean image' 명시

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:11:31 +09:00
doyeon b198c46d06 Analytics 서비스 및 보안 기능 업데이트
- Analytics 서비스 구현 추가 (API, 소스 코드)
- Event 서비스 소스 코드 추가
- 보안 관련 공통 컴포넌트 업데이트 (JWT, UserPrincipal, ErrorCode)
- API 컨벤션 및 명세서 업데이트
- 데이터베이스 SQL 스크립트 추가
- 백엔드 개발 문서 및 테스트 가이드 추가
- Kafka 메시지 체크 도구 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:11:00 +09:00
doyeon 003b3843cc Merge branch 'develop' into docker/participation
- 충돌 해결 완료
- settings.local.json 및 make-run-profile.md 병합

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:10:47 +09:00
hyeda2020 453f77ef01 Merge pull request #9 from ktds-dg0501/feature/user
UserPricipal 중복 필드 제거
2025-10-27 15:49:54 +09:00
wonho 375fcb390b UserPricipal 중복 필드 제거 2025-10-27 15:49:01 +09:00
hyeda2020 8323b795df Merge pull request #8 from ktds-dg0501/feature/user
UserPricipal 충돌 부분 조치
2025-10-27 15:28:05 +09:00
hyeda2020 ce3e01008a Merge branch 'develop' into feature/user 2025-10-27 15:27:57 +09:00
merrycoral 55e546e0b3 이벤트 API 매핑 문서 업데이트 (v1.1)
- 구현 현황: 7개 → 9개 API (64.3% 구현률)
- 신규 구현 API 추가:
  * POST /api/v1/events/{eventId}/images - 이미지 생성 요청
  * PUT /api/v1/events/{eventId}/images/{imageId}/select - 이미지 선택
- API 경로 버전 명시: /api/events → /api/v1/events
- Event Creation Flow 구현률: 12.5% → 37.5%
- 변경 이력 섹션 추가
2025-10-27 15:24:28 +09:00
wonho ea807cf33e UserPricipal 충돌 부분 조치 2025-10-27 15:19:35 +09:00
Hyowon Yang 394c7a0029 Merge pull request #7 from ktds-dg0501/feature/analytics
Feature/analytics
2025-10-27 15:10:51 +09:00
Hyowon Yang 9b247ca058 Merge branch 'develop' into feature/analytics 2025-10-27 15:10:31 +09:00
Hyowon Yang 25ff21f684 analytics-백엔드테스트완료 2025-10-27 15:04:03 +09:00
doyeon e70f121db5 배포 가이드 및 명령어 추가
- 배포 관련 slash 명령어 추가 (컨테이너 이미지 빌드, 실행, K8s 배포, CI/CD)
- 백엔드/프론트엔드 각각에 대한 배포 가이드 문서 추가
- 프롬프트 파일 추가 (think, design, develop)
- deployment 디렉토리 생성
- 기존 명령어 파일 업데이트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 15:03:36 +09:00
Hyowon Yang 180e5978a0 kafka 설정변경 2025-10-27 14:42:03 +09:00
doyeon 6465719b2c SecurityConfig와 application.yml 설정 업데이트
- SecurityConfig: CORS 설정 및 보안 필터 체인 구성
- application.yml: 환경 변수 플레이스홀더 방식으로 변경

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 14:06:02 +09:00
Hayoung Song 42f0665f5e Merge pull request #6 from ktds-dg0501/feature/event
feature/event
2025-10-27 13:43:44 +09:00
Hayoung Song 6728b98878 Merge branch 'develop' into feature/event 2025-10-27 13:43:15 +09:00
kkkd-max 6a31e5204b Merge pull request #3 from ktds-dg0501/feature/participation
Participation Service 백엔드 개발 완료
2025-10-27 13:41:22 +09:00
merrycoral 918e71cc35 API 경로를 /api/v1 접두사로 변경
- EventController: /api/events -> /api/v1/events
- JobController: /api/jobs -> /api/v1/jobs
- 모든 API 엔드포인트 테스트 완료

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 13:38:08 +09:00
Hyowon Yang 4197c72af5 Merge branch 'main' of https://github.com/ktds-dg0501/kt-event-marketing into feature/analytics 2025-10-27 11:25:08 +09:00
Hyowon Yang 97a3c41fff analytics 서비스 api개발 2025-10-27 11:23:56 +09:00
merrycoral 45f370a944 프로젝트 구성 개선 및 Kafka 인프라 추가
## 변경사항

### 보안 강화
- gradle.properties를 .gitignore에 추가 (로컬 환경 설정 제외)

### 공통 모듈
- ErrorCode에 Legacy 호환용 에러 코드 추가 (NOT_FOUND, INVALID_INPUT_VALUE)

### Event Service
- hibernate-types 라이브러리 제거 (Hibernate 6 네이티브 지원으로 대체)

### Kafka 인프라 추가
- Kafka 메시지 DTO 3개 추가
  * AIEventGenerationJobMessage: AI 이벤트 생성 작업 메시지
  * EventCreatedMessage: 이벤트 생성 완료 메시지
  * ImageGenerationJobMessage: 이미지 생성 작업 메시지
- Kafka Producer/Consumer 3개 추가
  * EventKafkaProducer: 이벤트 메시지 발행
  * AIJobKafkaConsumer: AI 작업 메시지 소비
  * ImageJobKafkaConsumer: 이미지 작업 메시지 소비

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 11:16:50 +09:00
Hyowon Yang a34037cdd1 TimelineData 샘플 데이터 생성 기능 추가
- 각 이벤트당 30일 치 daily 데이터 생성
- 참여자, 조회수, 참여행동, 전환수, 누적 참여자 수 포함
- 총 90건의 시간대별 데이터 생성 (3 이벤트 × 30일)
2025-10-27 11:14:54 +09:00
박세원 f0699b2e2b add ai-service 2025-10-27 11:09:12 +09:00
merrycoral 4d180c2a9f Event Service 개발 환경 구축 및 타입 시스템 개선
주요 변경사항:
- UserPrincipal 및 JWT 인증 시스템을 Long에서 UUID로 변경
- Event 엔티티 JPA 설정 최적화 (Lazy loading 및 fetch 전략 개선)
- 개발 환경용 DevAuthenticationFilter 추가 (User Service 구현 전까지 임시 사용)
- EventServiceApplication 문법 오류 수정
- Hibernate multiple bags 문제 해결 (List를 Set으로 변경)

기술 세부사항:
- common/UserPrincipal: Long → UUID 타입 변경, @Builder 어노테이션 추가
- common/JwtTokenProvider: UUID 지원 추가
- event-service/Event: Set 컬렉션 사용, Lazy loading 최적화
- event-service/EventService: Hibernate.initialize()로 컬렉션 초기화
- event-service/EventRepository: fetch join 쿼리 최적화
- event-service/SecurityConfig: DevAuthenticationFilter 통합

테스트 결과:
- 모든 Event CRUD API 정상 작동 확인
- PostgreSQL 연결 정상
- 비즈니스 로직 검증 정상 작동

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 11:04:03 +09:00
Hyowon Yang 884c964af6 Kafka Consumer 자동 시작 활성화 (autoStartup=true) 2025-10-27 10:59:31 +09:00
Hyowon Yang 704a4ae4d1 Kafka 활성화 설정 추가 (KAFKA_ENABLED=true) 2025-10-27 10:43:51 +09:00
Hyowon Yang 7fa1f8cc89 .gitignore에 Gradle 추가 및 빌드 파일 제거 2025-10-27 10:21:43 +09:00
Hyowon Yang 0ed0309e66 kafka 환경변수설정 2025-10-27 10:13:06 +09:00
Hyowon Yang f3901c8ef8 kafka 설정 변경
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 16:37:05 +09:00
sunmingLee 828a76b630 channel_status 테이블 시간 역전 현상 수정
- convertToChannelStatus 메서드에 completedAt 파라미터 추가
- completedAt이 항상 createdAt 이후 시간으로 설정되도록 수정
- LocalDateTime.now() 대신 메서드 파라미터로 전달된 completedAt 사용

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 16:27:03 +09:00
Hyowon Yang 7735c8472b totalViews 필드 추가 및 배포완료 이벤트 개선
변경 사항:
1. EventStats에 totalViews 필드 추가 (모든 채널 노출 수 합계)
2. DistributionCompletedEvent에 expectedViews 필드 추가
3. DistributionCompletedConsumer 개선:
   - ChannelStats.impressions에 expectedViews 저장
   - updateTotalViews() 메서드로 전체 노출 수 집계
4. SampleDataLoader에 채널별 예상 노출 수 설정:
   - 이벤트1: 총 20,000 (우리동네TV 5K, 지니TV 10K, 링고비즈 3K, SNS 2K)
   - 이벤트2: 총 14,000
   - 이벤트3: 총 6,000

설계 다이어그램과 일치:
- 채널별 예상 노출 수 저장
- 총 노출 수 실시간 집계
- 멱등성 및 캐시 무효화 유지

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 16:08:32 +09:00
Hyowon Yang 7b3ca40e22 샘플 데이터 발행량 축소 (타임아웃 방지)
- ParticipantRegistered 이벤트: 27,610건 → 180건
- 이벤트별 참여자 수:
  - 이벤트1: 15,420명 → 100명
  - 이벤트2: 8,950명 → 50명
  - 이벤트3: 3,240명 → 30명
- Kafka 발행 지연 로직 제거 (불필요)
- MVP 테스트에 충분한 데이터 유지

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:27:30 +09:00
Hyowon Yang 4c8165bd20 샘플 토픽명으로 변경 (sample. 접두사 추가)
- 다른 서비스 개발자들의 운영 토픽과 충돌 방지
- MVP용 샘플 토픽: sample.event.created, sample.participant.registered, sample.distribution.completed
- KafkaTopicConfig, SampleDataLoader, 3개 Consumer 모두 업데이트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 15:15:30 +09:00
Hyowon Yang 31fb1c541b kafka활성화
🚀 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 14:59:24 +09:00
Hyowon Yang 21b8fe5efb 배치-redis,db조회수정
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 14:26:11 +09:00
sunmingLee 074be336d6 distribution-service Swagger UI 설정 추가 및 API 문서화
- OpenApiConfig 추가: Swagger UI 기본 설정 및 API 정보 정의
- application.yml: Springdoc 설정 추가 및 웹 로깅 레벨 강화
- DistributionController: Swagger 어노테이션 추가 (@Tag, @Operation, @ApiResponses)
- API path 주석 수정: /api prefix 제거하여 실제 경로와 일치
2025-10-24 14:13:23 +09:00
sunmingLee b0d8a6d10e distribution-service API 명세서를 실제 구현에 맞게 수정
- ChannelType 열거형 값 수정 (URIDONGNETV, RINGOBIZ, GINITV 등)
- DistributionRequest 스키마 변경 (title, description, imageUrl 추가)
- DistributionResponse 스키마 변경 (success, successCount, failureCount 등)
- ChannelDistributionResult 스키마 단순화
- 모든 예제 코드 실제 구현에 맞게 업데이트
- IntelliJ 서비스 실행 프로파일 추가
- Distribution 서비스 엔티티, 매퍼, 리포지토리 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:45:45 +09:00
Hyowon Yang b0b0ba3263 배치서비스개발, redis설정
- Analytics 5분 단위 배치 스케줄러 추가
- 초기 데이터 로딩 기능 구현 (서버 시작 30초 후)
- Redis 설정 업데이트 (외부 Redis 서버 연결)
- Redis 읽기 전용 오류 처리 추가
- IntelliJ 실행 프로파일 생성
- @EnableScheduling 활성화

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:39:10 +09:00
merrycoral 55c7b838dd DDL 외래키 제약조건 주석처리
모든 테이블의 외래키 제약조건을 주석처리:
- event_channels.fk_event_channels_event
- generated_images.fk_generated_images_event
- ai_recommendations.fk_ai_recommendations_event
- jobs.fk_jobs_event

사유:
- JPA에서 연관관계 관리로 충분
- 개발 환경에서 유연성 확보
- 필요시 운영 환경에서 활성화 가능

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:28:08 +09:00
merrycoral 860293b2b9 Event Service DDL 최적화 작업 (Medium/Low 우선순위)
Medium 우선순위 수정:
1. created_at, updated_at 기본값 정책 정리
   - DEFAULT CURRENT_TIMESTAMP 제거
   - JPA @CreatedDate/@LastModifiedDate로 관리 명시
   - 주석으로 관리 주체 명확화

2. updated_at Trigger 비활성화
   - JPA 환경에서는 애플리케이션 레벨 관리
   - Trigger 코드는 주석으로 보존 (필요시 활성화 가능)
   - 이중 업데이트 메커니즘 제거로 성능 개선

Low 우선순위 추가:
3. 복합 인덱스 추가 (쿼리 성능 최적화)
   - events: (user_id, status, created_at DESC)
     → 사용자별 상태 필터링 + 최신순 정렬 최적화
   - generated_images: (event_id, is_selected)
     → 이벤트별 선택 이미지 조회 최적화
   - ai_recommendations: (event_id, is_selected)
     → 이벤트별 선택 추천 조회 최적화
   - jobs: (status, created_at DESC)
     → 상태별 최신 작업 조회 최적화

영향:
- JPA와 Database 역할 분담 명확화
- 불필요한 중복 메커니즘 제거
- 쿼리 성능 향상 (복합 인덱스)
- 유지보수성 개선

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:25:31 +09:00
merrycoral c63cf950eb Event Service 엔티티와 DDL 형상 일치화 작업
Critical 및 High 우선순위 이슈 수정:

1. Event 엔티티 nullable 필드 변경
   - eventName: nullable로 변경 (AI 추천 후 설정)
   - startDate, endDate: nullable로 변경 (AI 추천 후 설정)

2. Event.publish() 검증 로직 강화
   - eventName 필수 검증 추가
   - startDate, endDate 필수 검증 추가
   - 기간 유효성 검증 추가 (시작일 <= 종료일)

3. DDL 스키마 수정
   - event_name NOT NULL 제거
   - start_date, end_date NOT NULL 제거
   - chk_event_period 제약조건 수정 (NULL 허용)

4. jobs 테이블 외래키 추가
   - event_id에 대한 외래키 제약조건 추가
   - ON DELETE CASCADE 설정으로 데이터 무결성 보장

영향:
- 이벤트 생성 시 eventName, startDate, endDate를 NULL로 허용
- 배포(publish) 시점에 필수 필드 검증으로 데이터 무결성 보장
- 이벤트 삭제 시 관련 Job 자동 삭제로 고아 레코드 방지

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 13:22:14 +09:00
sunmingLee 9f50c7feaa distribution-service에 PostgreSQL, Redis 연결 설정 추가
- application.yml에 DB 및 캐시 설정 추가
- IntelliJ 실행 프로파일에 환경 변수 설정
- Kafka 브로커 주소를 실제 서버로 변경
2025-10-24 13:08:42 +09:00
Hyowon Yang fb60c6f8a6 외부 API 호출 임시 비활성화 - 샘플 데이터 사용 2025-10-24 12:41:50 +09:00
Hyowon Yang db761cd7be Analytics API 엔드포인트 인증 제거 (테스트용) 2025-10-24 11:30:09 +09:00
merrycoral 7b76e573ed Event Service 데이터베이스 테이블 생성 SQL 추가
- events 테이블: 이벤트 마스터
- event_channels 테이블: 배포 채널
- generated_images 테이블: 생성된 이미지
- ai_recommendations 테이블: AI 추천 기획안
- jobs 테이블: 비동기 작업 관리
- updated_at 자동 업데이트 트리거 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 11:23:55 +09:00
sunmingLee 28a7a91ca2 Swagger 관련 변경사항 롤백 및 정리 2025-10-24 11:04:59 +09:00
Hyowon Yang ab99a26211 런타임에러해결 2025-10-24 11:00:02 +09:00
Hyowon Yang 9b10f915e3 Analytics 대시보드 샘플 데이터 자동 적재 기능 추가 2025-10-24 10:35:30 +09:00
Hyowon Yang 43e23eb7aa Kafka 조건부 활성화 설정 2025-10-24 10:31:58 +09:00
merrycoral 379ab0f1f9 Merge branch 'feature/event' of https://github.com/ktds-dg0501/kt-event-marketing into feature/event 2025-10-24 10:27:36 +09:00
Hayoung Song f3be6917b5 Merge pull request #1 from ktds-dg0501/main
되돌리기
2025-10-24 10:23:06 +09:00
merrycoral 5476fe9388 event-service 초기 구현 및 JWT 토큰 매장 ID 추가
- JWT 토큰에 매장 ID(storeId) 필드 추가
- event-service 구현 (이벤트 생성/조회 API)
- hibernate-types 의존성 추가 (UUID 지원)
- API 매핑 문서 추가
- IntelliJ 실행 프로파일 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 10:17:45 +09:00
Hyowon Yang 887b46ab46 실행프로파일, 로그설정 2025-10-24 10:04:28 +09:00
Hyowon Yang 46fc1663a5 analytics 서비스개발
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 09:44:02 +09:00
Hyowon Yang 25b1ec8b81 링고비즈api추가 2025-10-23 17:58:54 +09:00
585 changed files with 59250 additions and 1936 deletions
@@ -0,0 +1,17 @@
---
command: "/deploy-actions-cicd-guide-back"
description: "백엔드 GitHub Actions CI/CD 파이프라인 가이드 작성"
---
@cicd
'백엔드GitHubActions파이프라인작성가이드'에 따라 GitHub Actions를 이용한 CI/CD 가이드를 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- ACR_NAME: acrdigitalgarage01
- RESOURCE_GROUP: rg-digitalgarage-01
- AKS_CLUSTER: aks-digitalgarage-01
- NAMESPACE: phonebill-dg0500
@@ -0,0 +1,18 @@
---
command: "/deploy-actions-cicd-guide-front"
description: "프론트엔드 GitHub Actions CI/CD 파이프라인 가이드 작성"
---
@cicd
'프론트엔드GitHubActions파이프라인작성가이드'에 따라 GitHub Actions를 이용한 CI/CD 가이드를 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- SYSTEM_NAME: phonebill
- ACR_NAME: acrdigitalgarage01
- RESOURCE_GROUP: rg-digitalgarage-01
- AKS_CLUSTER: aks-digitalgarage-01
- NAMESPACE: phonebill-dg0500
@@ -0,0 +1,7 @@
---
command: "/deploy-build-image-back"
description: "백엔드 컨테이너 이미지 작성"
---
@cicd
'백엔드컨테이너이미지작성가이드'에 따라 컨테이너 이미지를 작성해 주세요.
@@ -0,0 +1,7 @@
---
command: "/deploy-build-image-front"
description: "프론트엔드 컨테이너 이미지 작성"
---
@cicd
'프론트엔드컨테이너이미지작성가이드'에 따라 컨테이너 이미지를 작성해 주세요.
+64
View File
@@ -0,0 +1,64 @@
---
command: "/deploy-help"
description: "배포 작업 순서 및 명령어 안내"
---
# 배포 작업 순서
## 컨테이너 이미지 작성
### 백엔드
/deploy-build-image-back
- 백엔드 서비스들의 컨테이너 이미지를 작성합니다
### 프론트엔드
/deploy-build-image-front
- 프론트엔드 서비스의 컨테이너 이미지를 작성합니다
## 컨테이너 실행 가이드 작성
### 백엔드
/deploy-run-container-guide-back
- 백엔드 컨테이너 실행 가이드를 작성합니다
- [실행정보] 섹션에 ACR명, VM 접속 정보 제공 필요
### 프론트엔드
/deploy-run-container-guide-front
- 프론트엔드 컨테이너 실행 가이드를 작성합니다
- [실행정보] 섹션에 시스템명, ACR명, VM 접속 정보 제공 필요
## Kubernetes 배포 가이드 작성
### 백엔드
/deploy-k8s-guide-back
- 백엔드 서비스 Kubernetes 배포 가이드를 작성합니다
- [실행정보] 섹션에 ACR명, k8s명, 네임스페이스, 리소스 정보 제공 필요
### 프론트엔드
/deploy-k8s-guide-front
- 프론트엔드 서비스 Kubernetes 배포 가이드를 작성합니다
- [실행정보] 섹션에 시스템명, ACR명, k8s명, 네임스페이스, Gateway Host 정보 제공 필요
## CI/CD 파이프라인 작성
### Jenkins CI/CD
#### 백엔드
/deploy-jenkins-cicd-guide-back
- Jenkins를 이용한 백엔드 CI/CD 파이프라인 가이드를 작성합니다
- [실행정보] 섹션에 ACR_NAME, RESOURCE_GROUP, AKS_CLUSTER, NAMESPACE 제공 필요
#### 프론트엔드
/deploy-jenkins-cicd-guide-front
- Jenkins를 이용한 프론트엔드 CI/CD 파이프라인 가이드를 작성합니다
- [실행정보] 섹션에 SYSTEM_NAME, ACR_NAME, RESOURCE_GROUP, AKS_CLUSTER, NAMESPACE 제공 필요
### GitHub Actions CI/CD
#### 백엔드
/deploy-actions-cicd-guide-back
- GitHub Actions를 이용한 백엔드 CI/CD 파이프라인 가이드를 작성합니다
- [실행정보] 섹션에 ACR_NAME, RESOURCE_GROUP, AKS_CLUSTER, NAMESPACE 제공 필요
#### 프론트엔드
/deploy-actions-cicd-guide-front
- GitHub Actions를 이용한 프론트엔드 CI/CD 파이프라인 가이드를 작성합니다
- [실행정보] 섹션에 SYSTEM_NAME, ACR_NAME, RESOURCE_GROUP, AKS_CLUSTER, NAMESPACE 제공 필요
---
**참고**: 각 명령어 실행 시 [실행정보] 섹션에 필요한 정보를 함께 제공해야 합니다.
@@ -0,0 +1,17 @@
---
command: "/deploy-jenkins-cicd-guide-back"
description: "백엔드 Jenkins CI/CD 파이프라인 가이드 작성"
---
@cicd
'백엔드Jenkins파이프라인작성가이드'에 따라 Jenkins를 이용한 CI/CD 가이드를 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- ACR_NAME: acrdigitalgarage01
- RESOURCE_GROUP: rg-digitalgarage-01
- AKS_CLUSTER: aks-digitalgarage-01
- NAMESPACE: phonebill-dg0500
@@ -0,0 +1,18 @@
---
command: "/deploy-jenkins-cicd-guide-front"
description: "프론트엔드 Jenkins CI/CD 파이프라인 가이드 작성"
---
@cicd
'프론트엔드Jenkins파이프라인작성가이드'에 따라 Jenkins를 이용한 CI/CD 가이드를 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- SYSTEM_NAME: phonebill
- ACR_NAME: acrdigitalgarage01
- RESOURCE_GROUP: rg-digitalgarage-01
- AKS_CLUSTER: aks-digitalgarage-01
- NAMESPACE: phonebill-dg0500
+19
View File
@@ -0,0 +1,19 @@
---
command: "/deploy-k8s-guide-back"
description: "백엔드 Kubernetes 배포 가이드 작성"
---
@cicd
'백엔드배포가이드'에 따라 백엔드 서비스 배포 방법을 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- ACR명: acrdigitalgarage01
- k8s명: aks-digitalgarage-01
- 네임스페이스: tripgen
- 파드수: 2
- 리소스(CPU): 256m/1024m
- 리소스(메모리): 256Mi/1024Mi
@@ -0,0 +1,21 @@
---
command: "/deploy-k8s-guide-front"
description: "프론트엔드 Kubernetes 배포 가이드 작성"
---
@cicd
'프론트엔드배포가이드'에 따라 프론트엔드 서비스 배포 방법을 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- 시스템명: tripgen
- ACR명: acrdigitalgarage01
- k8s명: aks-digitalgarage-01
- 네임스페이스: tripgen
- 파드수: 2
- 리소스(CPU): 256m/1024m
- 리소스(메모리): 256Mi/1024Mi
- Gateway Host: http://tripgen-api.20.214.196.128.nip.io
@@ -0,0 +1,18 @@
---
command: "/deploy-run-container-guide-back"
description: "백엔드 컨테이너 실행방법 가이드 작성"
---
@cicd
'백엔드컨테이너실행방법가이드'에 따라 컨테이너 실행 가이드를 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- ACR명: acrdigitalgarage01
- VM
- KEY파일: ~/home/bastion-dg0500
- USERID: azureuser
- IP: 4.230.5.6
@@ -0,0 +1,19 @@
---
command: "/deploy-run-container-guide-front"
description: "프론트엔드 컨테이너 실행방법 가이드 작성"
---
@cicd
'프론트엔드컨테이너실행방법가이드'에 따라 컨테이너 실행 가이드를 작성해 주세요.
프롬프트에 '[실행정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
{안내메시지}
'[실행정보]'섹션 하위에 아래 예와 같이 필요한 정보를 제시해 주세요.
[실행정보]
- 시스템명: tripgen
- ACR명: acrdigitalgarage01
- VM
- KEY파일: ~/home/bastion-dg0500
- USERID: azureuser
- IP: 4.230.5.6
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-api"
---
@architecture
API를 설계해 주세요:
- '공통설계원칙'과 'API설계가이드'를 준용하여 설계
- '공통설계원칙'과 'API설계가이드'를 준용하여 설계
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-class"
---
@architecture
'공통설계원칙'과 '클래스설계가이드'를 준용하여 클래스를 설계해 주세요.
프롬프트에 '[클래스설계 정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시합니다.
@@ -9,4 +12,4 @@
- User: Layered
- Trip: Clean
- Location: Layered
- AI: Layered
- AI: Layered
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-data"
---
@architecture
데이터 설계를 해주세요:
- '공통설계원칙'과 '데이터설계가이드'를 준용하여 설계
- '공통설계원칙'과 '데이터설계가이드'를 준용하여 설계
+4 -1
View File
@@ -1,5 +1,8 @@
---
command: "/design-fix-prototype"
---
@fix as @front
'[오류내용]'섹션에 제공된 오류를 해결해 주세요.
프롬프트에 '[오류내용]'섹션이 없으면 수행 중단하고 안내 메시지 표시
{안내메시지}
'[오류내용]'섹션 하위에 오류 내용을 제공
'[오류내용]'섹션 하위에 오류 내용을 제공
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-front"
---
@plan as @front
'프론트엔드설계가이드'를 준용하여 **프론트엔드설계서**를 작성해 주세요.
프롬프트에 '[백엔드시스템]'항목이 없으면 수행을 중단하고 안내 메시지를 표시합니다.
@@ -13,4 +16,4 @@
- ai service: http://localhost:8084/v3/api-docs
[요구사항]
- 각 화면에 Back 아이콘 버튼과 화면 타이틀 표시
- 하단 네비게이션 바 아이콘화: 홈, 새여행, 주변장소검색, 여행보기
- 하단 네비게이션 바 아이콘화: 홈, 새여행, 주변장소검색, 여행보기
+4 -1
View File
@@ -1,6 +1,9 @@
---
command: "/design-high-level"
---
@architecture
'HighLevel아키텍처정의가이드'를 준용하여 High Level 아키텍처 정의서를 작성해 주세요.
'CLOUD' 정보가 없으면 수행을 중단하고 안내메시지를 표시하세요.
{안내메시지}
아래 예와 같이 CLOUD 제공자를 Azure, AWS, Google과 같이 제공하세요.
- CLOUD: Azure
- CLOUD: Azure
+4 -1
View File
@@ -1,5 +1,8 @@
---
command: "/design-improve-prototype"
---
@improve as @front
'[개선내용]'섹션에 있는 내용을 개선해 주세요.
프롬프트에 '[개선내용]'항목이 없으면 수행을 중단하고 안내 메시지 표시
{안내메시지}
'[개선내용]'섹션 하위에 개선할 내용을 제공
'[개선내용]'섹션 하위에 개선할 내용을 제공
+4 -1
View File
@@ -1,2 +1,5 @@
---
command: "/design-improve-userstory"
---
@analyze as @front 프로토타입을 웹브라우저에서 분석한 후,
@document as @scribe 수정된 프로토타입에 따라 유저스토리를 업데이트 해주십시오.
@document as @scribe 수정된 프로토타입에 따라 유저스토리를 업데이트 해주십시오.
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-logical"
---
@architecture
논리 아키텍처를 설계해 주세요:
- '공통설계원칙'과 '논리아키텍처 설계 가이드'를 준용하여 설계
- '공통설계원칙'과 '논리아키텍처 설계 가이드'를 준용하여 설계
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-pattern"
---
@design-pattern
클라우드 아키텍처 패턴 적용 방안을 작성해 주세요:
- '클라우드아키텍처패턴선정가이드'를 준용하여 작성
- '클라우드아키텍처패턴선정가이드'를 준용하여 작성
+4 -1
View File
@@ -1,6 +1,9 @@
---
command: "/design-physical"
---
@architecture
'물리아키텍처설계가이드'를 준용하여 물리아키텍처를 설계해 주세요.
'CLOUD' 정보가 없으면 수행을 중단하고 안내메시지를 표시하세요.
{안내메시지}
아래 예와 같이 CLOUD 제공자를 Azure, AWS, Google과 같이 제공하세요.
- CLOUD: Azure
- CLOUD: Azure
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-prototype"
---
@prototype
프로토타입을 작성해 주세요:
- '프로토타입작성가이드'를 준용하여 작성
- '프로토타입작성가이드'를 준용하여 작성
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-seq-inner"
---
@architecture
내부 시퀀스 설계를 해 주세요:
- '공통설계원칙'과 '내부시퀀스설계 가이드'를 준용하여 설계
- '공통설계원칙'과 '내부시퀀스설계 가이드'를 준용하여 설계
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-seq-outer"
---
@architecture
외부 시퀀스 설계를 해 주세요:
- '공통설계원칙'과 '외부시퀀스설계가이드'를 준용하여 설계
- '공통설계원칙'과 '외부시퀀스설계가이드'를 준용하여 설계
+4 -1
View File
@@ -1,2 +1,5 @@
---
command: "/design-test-prototype"
---
@test-front
프로토타입을 테스트 해 주세요.
프로토타입을 테스트 해 주세요.
+4 -1
View File
@@ -1,3 +1,6 @@
---
command: "/design-uiux"
---
@uiux
UI/UX 설계를 해주세요:
- 'UI/UX설계가이드'를 준용하여 작성
- 'UI/UX설계가이드'를 준용하여 작성
+4 -1
View File
@@ -1,2 +1,5 @@
---
command: "/design-update-uiux"
---
@document @front
현재 프로토타입과 유저스토리를 기준으로 UI/UX설계서와 스타일가이드를 수정해 주세요.
현재 프로토타입과 유저스토리를 기준으로 UI/UX설계서와 스타일가이드를 수정해 주세요.
+1 -1
View File
@@ -1,5 +1,5 @@
@test-backend
'서비스실행파일작성가이드'에 따라 테스트를 해 주세요.
'서비스실행프로파일작성가이드'에 따라 테스트를 해 주세요.
프롬프트에 '[작성정보]'항목이 없으면 수행을 중단하고 안내 메시지를 표시해 주세요.
DB나 Redis의 접근 정보는 지정할 필요 없습니다. 특별히 없으면 '[작성정보]'섹션에 '없음'이라고 하세요.
{안내메시지}
+3
View File
@@ -1,3 +1,6 @@
---
command: "/think-help"
---
기획 작업 순서
1단계: 서비스 기획
+3
View File
@@ -1,3 +1,6 @@
---
command: "/think-planning"
---
아래 내용을 터미널에 표시만 하고 수행을 하지는 않습니다.
```
아래 가이드를 참고하여 서비스 기획을 수행합니다.
+6
View File
@@ -1,3 +1,7 @@
---
command: "/think-userstory"
---
```
@document
유저스토리를 작성하세요.
프롬프트에 '[요구사항]'섹션이 없으면 수행을 중단하고 안내 메시지를 표시합니다.
@@ -16,3 +20,5 @@ Case 2) 다른 방법으로 이벤트스토밍을 한 경우는 요구사항을
2. 유저스토리 작성
- '유저스토리작성방법'과 '유저스토리예제'를 참고하여 유저스토리를 작성
- 결과파일은 'design/userstory.md'에 생성
```
+5
View File
@@ -16,6 +16,11 @@
"Bash(git commit:*)",
"Bash(git push)",
"Bash(git pull:*)",
"Bash(netstat:*)",
"Bash(findstr:*)",
"Bash(./gradlew analytics-service:compileJava:*)",
"Bash(python -m json.tool:*)",
"Bash(powershell:*)"
"Bash(./gradlew participation-service:compileJava:*)",
"Bash(find:*)",
"Bash(netstat:*)",
+186
View File
@@ -0,0 +1,186 @@
# KT Event Marketing - CI/CD Infrastructure
이 디렉토리는 KT Event Marketing 백엔드 서비스의 CI/CD 인프라를 포함합니다.
## 디렉토리 구조
```
.github/
├── README.md # 이 파일
├── workflows/
│ └── backend-cicd.yaml # GitHub Actions 워크플로우
├── kustomize/ # Kubernetes 매니페스트 관리
│ ├── base/ # 기본 리소스 정의
│ │ ├── kustomization.yaml
│ │ ├── cm-common.yaml
│ │ ├── secret-common.yaml
│ │ ├── secret-imagepull.yaml
│ │ ├── ingress.yaml
│ │ └── {service}-*.yaml # 각 서비스별 리소스
│ └── overlays/ # 환경별 설정
│ ├── dev/
│ │ ├── kustomization.yaml
│ │ └── *-patch.yaml # 1 replica, 256Mi-1024Mi
│ ├── staging/
│ │ ├── kustomization.yaml
│ │ └── *-patch.yaml # 2 replicas, 512Mi-2048Mi
│ └── prod/
│ ├── kustomization.yaml
│ └── *-patch.yaml # 3 replicas, 1024Mi-4096Mi
├── config/
│ ├── deploy_env_vars_dev # Dev 환경 변수
│ ├── deploy_env_vars_staging # Staging 환경 변수
│ └── deploy_env_vars_prod # Prod 환경 변수
└── scripts/
├── deploy.sh # 수동 배포 스크립트
├── generate-patches.sh # 패치 파일 생성 스크립트
└── copy-manifests-to-base.py # 매니페스트 복사 스크립트
```
## 주요 파일 설명
### workflows/backend-cicd.yaml
GitHub Actions 워크플로우 정의 파일입니다.
**트리거**:
- develop 브랜치 push → dev 환경 배포
- main 브랜치 push → prod 환경 배포
- Manual workflow dispatch → 원하는 환경과 서비스 선택
**Jobs**:
1. `detect-changes`: 변경된 서비스 감지
2. `build-and-push`: 서비스 빌드 및 ACR 푸시
3. `deploy`: AKS에 배포
4. `notify`: 배포 결과 알림
### kustomize/base/kustomization.yaml
모든 환경에서 공통으로 사용하는 기본 리소스를 정의합니다.
**포함 리소스**:
- Common ConfigMaps and Secrets
- Ingress
- 7개 서비스의 Deployment, Service, ConfigMap, Secret
### kustomize/overlays/{env}/kustomization.yaml
환경별 설정을 오버라이드합니다.
**주요 차이점**:
- 이미지 태그 (dev/staging/prod)
- Replica 수 (1/2/3)
- 리소스 할당량 (작음/중간/큼)
### scripts/deploy.sh
로컬에서 수동 배포를 위한 스크립트입니다.
**사용법**:
```bash
# 모든 서비스를 dev 환경에 배포
./scripts/deploy.sh dev
# 특정 서비스만 prod 환경에 배포
./scripts/deploy.sh prod user-service
```
## 배포 프로세스
### 자동 배포 (GitHub Actions)
1. **Dev 환경**:
```bash
git checkout develop
git push origin develop
```
2. **Prod 환경**:
```bash
git checkout main
git merge develop
git push origin main
```
3. **수동 배포**:
- GitHub Actions UI → Run workflow
- Environment 선택 (dev/staging/prod)
- Service 선택 (all 또는 특정 서비스)
### 수동 배포 (로컬)
```bash
# 사전 요구사항: Azure CLI, kubectl, kustomize 설치
# Azure 로그인 필요
# Dev 환경에 모든 서비스 배포
./.github/scripts/deploy.sh dev
# Prod 환경에 user-service만 배포
./.github/scripts/deploy.sh prod user-service
```
## 환경별 설정
| 환경 | 브랜치 | 이미지 태그 | Replicas | CPU Request | Memory Request |
|------|--------|-------------|----------|-------------|----------------|
| Dev | develop | dev | 1 | 256m | 256Mi |
| Staging | manual | staging | 2 | 512m | 512Mi |
| Prod | main | prod | 3 | 1024m | 1024Mi |
## 서비스 목록
1. **user-service** (8081) - 사용자 관리
2. **event-service** (8082) - 이벤트 관리
3. **ai-service** (8083) - AI 기반 콘텐츠 생성
4. **content-service** (8084) - 콘텐츠 관리
5. **distribution-service** (8085) - 경품 배포
6. **participation-service** (8086) - 이벤트 참여
7. **analytics-service** (8087) - 분석 및 통계
## 모니터링
### Pod 상태 확인
```bash
kubectl get pods -n kt-event-marketing
```
### 로그 확인
```bash
# 실시간 로그
kubectl logs -n kt-event-marketing -l app=user-service -f
# 이전 컨테이너 로그
kubectl logs -n kt-event-marketing <pod-name> --previous
```
### 리소스 사용량
```bash
# Pod 리소스
kubectl top pods -n kt-event-marketing
# Node 리소스
kubectl top nodes
```
## 트러블슈팅
상세한 트러블슈팅 가이드는 [deployment/cicd/CICD-GUIDE.md](../../deployment/cicd/CICD-GUIDE.md)를 참조하세요.
**주요 문제 해결**:
- ImagePullBackOff → ACR Secret 확인
- CrashLoopBackOff → 로그 확인 및 환경 변수 검증
- Readiness Probe Failed → Context Path 및 Actuator 경로 확인
## 롤백
```bash
# 이전 버전으로 롤백
kubectl rollout undo deployment/user-service -n kt-event-marketing
# 특정 리비전으로 롤백
kubectl rollout undo deployment/user-service --to-revision=2 -n kt-event-marketing
```
## 참고 자료
- [CI/CD 가이드 (한글)](../../deployment/cicd/CICD-GUIDE.md)
- [GitHub Actions 공식 문서](https://docs.github.com/en/actions)
- [Kustomize 공식 문서](https://kustomize.io/)
- [Azure AKS 공식 문서](https://docs.microsoft.com/en-us/azure/aks/)
+11
View File
@@ -0,0 +1,11 @@
# Development Environment Variables
ENVIRONMENT=dev
ACR_NAME=acrdigitalgarage01
RESOURCE_GROUP=rg-digitalgarage-01
AKS_CLUSTER=aks-digitalgarage-01
NAMESPACE=kt-event-marketing
REPLICAS=1
CPU_REQUEST=256m
MEMORY_REQUEST=256Mi
CPU_LIMIT=1024m
MEMORY_LIMIT=1024Mi
+11
View File
@@ -0,0 +1,11 @@
# Production Environment Variables
ENVIRONMENT=prod
ACR_NAME=acrdigitalgarage01
RESOURCE_GROUP=rg-digitalgarage-01
AKS_CLUSTER=aks-digitalgarage-01
NAMESPACE=kt-event-marketing
REPLICAS=3
CPU_REQUEST=1024m
MEMORY_REQUEST=1024Mi
CPU_LIMIT=4096m
MEMORY_LIMIT=4096Mi
+11
View File
@@ -0,0 +1,11 @@
# Staging Environment Variables
ENVIRONMENT=staging
ACR_NAME=acrdigitalgarage01
RESOURCE_GROUP=rg-digitalgarage-01
AKS_CLUSTER=aks-digitalgarage-01
NAMESPACE=kt-event-marketing
REPLICAS=2
CPU_REQUEST=512m
MEMORY_REQUEST=512Mi
CPU_LIMIT=2048m
MEMORY_LIMIT=2048Mi
@@ -0,0 +1,55 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-ai-service
data:
# Server Configuration
SERVER_PORT: "8083"
# Redis Configuration (service-specific)
REDIS_DATABASE: "3"
REDIS_TIMEOUT: "3000"
REDIS_POOL_MIN: "2"
# Kafka Configuration (service-specific)
KAFKA_CONSUMER_GROUP: "ai-service-consumers"
# Kafka Topics Configuration
KAFKA_TOPICS_AI_JOB: "ai-event-generation-job"
KAFKA_TOPICS_AI_JOB_DLQ: "ai-event-generation-job-dlq"
# AI Provider Configuration
AI_PROVIDER: "CLAUDE"
AI_CLAUDE_API_URL: "https://api.anthropic.com/v1/messages"
AI_CLAUDE_ANTHROPIC_VERSION: "2023-06-01"
AI_CLAUDE_MODEL: "claude-sonnet-4-5-20250929"
AI_CLAUDE_MAX_TOKENS: "4096"
AI_CLAUDE_TEMPERATURE: "0.7"
AI_CLAUDE_TIMEOUT: "300000"
# Circuit Breaker Configuration
RESILIENCE4J_CIRCUITBREAKER_FAILURE_RATE_THRESHOLD: "50"
RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_RATE_THRESHOLD: "50"
RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_DURATION_THRESHOLD: "60s"
RESILIENCE4J_CIRCUITBREAKER_PERMITTED_CALLS_HALF_OPEN: "3"
RESILIENCE4J_CIRCUITBREAKER_SLIDING_WINDOW_SIZE: "10"
RESILIENCE4J_CIRCUITBREAKER_MINIMUM_CALLS: "5"
RESILIENCE4J_CIRCUITBREAKER_WAIT_DURATION_OPEN: "60s"
RESILIENCE4J_TIMELIMITER_TIMEOUT_DURATION: "300s"
# Redis Cache TTL Configuration (seconds)
CACHE_TTL_RECOMMENDATION: "86400"
CACHE_TTL_JOB_STATUS: "86400"
CACHE_TTL_TREND: "3600"
CACHE_TTL_FALLBACK: "604800"
# Logging Configuration
LOG_LEVEL_ROOT: "INFO"
LOG_LEVEL_AI: "DEBUG"
LOG_LEVEL_KAFKA: "INFO"
LOG_LEVEL_REDIS: "INFO"
LOG_LEVEL_RESILIENCE4J: "DEBUG"
LOG_FILE_NAME: "logs/ai-service.log"
LOG_FILE_MAX_SIZE: "10MB"
LOG_FILE_MAX_HISTORY: "7"
LOG_FILE_TOTAL_CAP: "100MB"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-service
labels:
app: ai-service
spec:
replicas: 1
selector:
matchLabels:
app: ai-service
template:
metadata:
labels:
app: ai-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: ai-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8083
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-ai-service
- secretRef:
name: secret-common
- secretRef:
name: secret-ai-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /actuator/health
port: 8083
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8083
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8083
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-ai-service
type: Opaque
stringData:
# Claude API Key
AI_CLAUDE_API_KEY: "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"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: ai-service
labels:
app: ai-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8083
protocol: TCP
name: http
selector:
app: ai-service
@@ -0,0 +1,37 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-analytics-service
data:
# Server Configuration
SERVER_PORT: "8086"
# Database Configuration
DB_HOST: "analytic-postgresql"
DB_PORT: "5432"
DB_NAME: "analytics_db"
DB_USERNAME: "eventuser"
# Redis Configuration (service-specific)
REDIS_DATABASE: "5"
# Kafka Configuration (service-specific)
KAFKA_ENABLED: "true"
KAFKA_CONSUMER_GROUP_ID: "analytics-service"
# Sample Data Configuration (MVP only)
SAMPLE_DATA_ENABLED: "true"
# Batch Scheduler Configuration
BATCH_REFRESH_INTERVAL: "300000" # 5분 (밀리초)
BATCH_INITIAL_DELAY: "30000" # 30초 (밀리초)
BATCH_ENABLED: "true"
# Logging Configuration
LOG_LEVEL_APP: "INFO"
LOG_LEVEL_WEB: "INFO"
LOG_LEVEL_SQL: "WARN"
LOG_LEVEL_SQL_TYPE: "WARN"
SHOW_SQL: "false"
DDL_AUTO: "update"
LOG_FILE: "logs/analytics-service.log"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: analytics-service
labels:
app: analytics-service
spec:
replicas: 1
selector:
matchLabels:
app: analytics-service
template:
metadata:
labels:
app: analytics-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: analytics-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8086
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-analytics-service
- secretRef:
name: secret-common
- secretRef:
name: secret-analytics-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /actuator/health/liveness
port: 8086
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 30
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8086
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8086
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-analytics-service
type: Opaque
stringData:
DB_PASSWORD: "Hi5Jessica!"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: analytics-service
labels:
app: analytics-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8086
protocol: TCP
name: http
selector:
app: analytics-service
+46
View File
@@ -0,0 +1,46 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-common
data:
# Redis Configuration
REDIS_ENABLED: "true"
REDIS_HOST: "redis"
REDIS_PORT: "6379"
REDIS_TIMEOUT: "2000ms"
REDIS_POOL_MAX: "8"
REDIS_POOL_IDLE: "8"
REDIS_POOL_MIN: "0"
REDIS_POOL_WAIT: "-1ms"
# Kafka Configuration
KAFKA_BOOTSTRAP_SERVERS: "20.249.182.13:9095,4.217.131.59:9095"
EXCLUDE_KAFKA: ""
EXCLUDE_REDIS: ""
# CORS Configuration
CORS_ALLOWED_ORIGINS: "http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io"
CORS_ALLOWED_METHODS: "GET,POST,PUT,DELETE,OPTIONS,PATCH"
CORS_ALLOWED_HEADERS: "*"
CORS_ALLOW_CREDENTIALS: "true"
CORS_MAX_AGE: "3600"
# JWT Configuration
JWT_ACCESS_TOKEN_VALIDITY: "604800000"
JWT_REFRESH_TOKEN_VALIDITY: "86400000"
# JPA Configuration
DDL_AUTO: "update"
SHOW_SQL: "false"
JPA_DIALECT: "org.hibernate.dialect.PostgreSQLDialect"
H2_CONSOLE_ENABLED: "false"
# Logging Configuration
LOG_LEVEL_APP: "INFO"
LOG_LEVEL_WEB: "INFO"
LOG_LEVEL_SQL: "WARN"
LOG_LEVEL_SQL_TYPE: "WARN"
LOG_LEVEL_ROOT: "INFO"
LOG_FILE_MAX_SIZE: "10MB"
LOG_FILE_MAX_HISTORY: "7"
LOG_FILE_TOTAL_CAP: "100MB"
@@ -0,0 +1,24 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-content-service
data:
# Server Configuration
SERVER_PORT: "8084"
# Redis Configuration (service-specific)
REDIS_DATABASE: "1"
# Replicate API Configuration (Stable Diffusion)
REPLICATE_API_URL: "https://api.replicate.com"
REPLICATE_MODEL_VERSION: "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b"
# HuggingFace API Configuration
HUGGINGFACE_API_URL: "https://api-inference.huggingface.co"
HUGGINGFACE_MODEL: "runwayml/stable-diffusion-v1-5"
# Azure Blob Storage Configuration
AZURE_CONTAINER_NAME: "content-images"
# Logging Configuration
LOG_FILE_PATH: "logs/content-service.log"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: content-service
labels:
app: content-service
spec:
replicas: 1
selector:
matchLabels:
app: content-service
template:
metadata:
labels:
app: content-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: content-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8084
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-content-service
- secretRef:
name: secret-common
- secretRef:
name: secret-content-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /api/v1/content/actuator/health
port: 8084
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet:
path: /api/v1/content/actuator/health/readiness
port: 8084
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /api/v1/content/actuator/health/liveness
port: 8084
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-content-service
type: Opaque
stringData:
# Azure Blob Storage Connection String
AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=https;AccountName=blobkteventstorage;AccountKey=tcBN7mAfojbl0uGsOpU7RNuKNhHnzmwDiWjN31liSMVSrWaEK+HHnYKZrjBXXAC6ZPsuxUDlsf8x+AStd++QYg==;EndpointSuffix=core.windows.net"
# Replicate API Token
REPLICATE_API_TOKEN: "r8_BsGCJtAg5U5kkMBXSe3pgMkPufSKnUR4NY9gJ"
# HuggingFace API Token
HUGGINGFACE_API_TOKEN: ""
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: content-service
labels:
app: content-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8084
protocol: TCP
name: http
selector:
app: content-service
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-distribution-service
data:
# Server Configuration
SERVER_PORT: "8085"
# Database Configuration
DB_HOST: "distribution-postgresql"
DB_PORT: "5432"
DB_NAME: "distributiondb"
DB_USERNAME: "eventuser"
# Kafka Configuration
KAFKA_ENABLED: "true"
KAFKA_CONSUMER_GROUP: "distribution-service"
# External Channel APIs
URIDONGNETV_API_URL: "http://localhost:9001/api/uridongnetv"
RINGOBIZ_API_URL: "http://localhost:9002/api/ringobiz"
GINITV_API_URL: "http://localhost:9003/api/ginitv"
INSTAGRAM_API_URL: "http://localhost:9004/api/instagram"
NAVER_API_URL: "http://localhost:9005/api/naver"
KAKAO_API_URL: "http://localhost:9006/api/kakao"
# Logging Configuration
LOG_FILE: "logs/distribution-service.log"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: distribution-service
labels:
app: distribution-service
spec:
replicas: 1
selector:
matchLabels:
app: distribution-service
template:
metadata:
labels:
app: distribution-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: distribution-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8085
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-distribution-service
- secretRef:
name: secret-common
- secretRef:
name: secret-distribution-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /api/v1/distribution/actuator/health
port: 8085
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet:
path: /api/v1/distribution/actuator/health/readiness
port: 8085
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /api/v1/distribution/actuator/health/liveness
port: 8085
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-distribution-service
type: Opaque
stringData:
DB_PASSWORD: "Hi5Jessica!"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: distribution-service
labels:
app: distribution-service
spec:
type: ClusterIP
selector:
app: distribution-service
ports:
- name: http
port: 80
targetPort: 8085
protocol: TCP
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-event-service
data:
# Server Configuration
SERVER_PORT: "8080"
# Database Configuration
DB_HOST: "event-postgresql"
DB_PORT: "5432"
DB_NAME: "eventdb"
DB_USERNAME: "eventuser"
# Redis Configuration (service-specific)
REDIS_DATABASE: "2"
# Kafka Configuration (service-specific)
KAFKA_CONSUMER_GROUP: "event-service-consumers"
# Service URLs
CONTENT_SERVICE_URL: "http://content-service"
DISTRIBUTION_SERVICE_URL: "http://distribution-service"
# Logging Configuration
LOG_LEVEL: "INFO"
SQL_LOG_LEVEL: "WARN"
LOG_FILE: "logs/event-service.log"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-service
labels:
app: event-service
spec:
replicas: 1
selector:
matchLabels:
app: event-service
template:
metadata:
labels:
app: event-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: event-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-event-service
- secretRef:
name: secret-common
- secretRef:
name: secret-event-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-event-service
type: Opaque
stringData:
# Database Password
DB_PASSWORD: "Hi5Jessica!"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: event-service
labels:
app: event-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
app: event-service
+116
View File
@@ -0,0 +1,116 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kt-event-marketing
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: kt-event-marketing-api.20.214.196.128.nip.io
http:
paths:
# User Service
- path: /api/v1/users
pathType: Prefix
backend:
service:
name: user-service
port:
number: 80
# Content Service
- path: /api/v1/content
pathType: Prefix
backend:
service:
name: content-service
port:
number: 80
# Event Service
- path: /api/v1/events
pathType: Prefix
backend:
service:
name: event-service
port:
number: 80
- path: /api/v1/jobs
pathType: Prefix
backend:
service:
name: event-service
port:
number: 80
- path: /api/v1/redis-test
pathType: Prefix
backend:
service:
name: event-service
port:
number: 80
# AI Service
- path: /api/v1/ai-service
pathType: Prefix
backend:
service:
name: ai-service
port:
number: 80
# Participation Service
- path: /api/v1/participations
pathType: Prefix
backend:
service:
name: participation-service
port:
number: 80
- path: /api/v1/winners
pathType: Prefix
backend:
service:
name: participation-service
port:
number: 80
- path: /debug
pathType: Prefix
backend:
service:
name: participation-service
port:
number: 80
# Analytics Service - Event Analytics
- path: /api/v1/events/([0-9]+)/analytics
pathType: ImplementationSpecific
backend:
service:
name: analytics-service
port:
number: 80
# Analytics Service - User Analytics
- path: /api/v1/users/([0-9]+)/analytics
pathType: ImplementationSpecific
backend:
service:
name: analytics-service
port:
number: 80
# Distribution Service
- path: /distribution
pathType: Prefix
backend:
service:
name: distribution-service
port:
number: 80
+71
View File
@@ -0,0 +1,71 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# Common resources
resources:
# Common ConfigMaps and Secrets
- cm-common.yaml
- secret-common.yaml
- secret-imagepull.yaml
# Ingress
- ingress.yaml
# user-service
- user-service-deployment.yaml
- user-service-service.yaml
- user-service-cm-user-service.yaml
- user-service-secret-user-service.yaml
# event-service
- event-service-deployment.yaml
- event-service-service.yaml
- event-service-cm-event-service.yaml
- event-service-secret-event-service.yaml
# ai-service
- ai-service-deployment.yaml
- ai-service-service.yaml
- ai-service-cm-ai-service.yaml
- ai-service-secret-ai-service.yaml
# content-service
- content-service-deployment.yaml
- content-service-service.yaml
- content-service-cm-content-service.yaml
- content-service-secret-content-service.yaml
# distribution-service
- distribution-service-deployment.yaml
- distribution-service-service.yaml
- distribution-service-cm-distribution-service.yaml
- distribution-service-secret-distribution-service.yaml
# participation-service
- participation-service-deployment.yaml
- participation-service-service.yaml
- participation-service-cm-participation-service.yaml
- participation-service-secret-participation-service.yaml
# analytics-service
- analytics-service-deployment.yaml
- analytics-service-service.yaml
- analytics-service-cm-analytics-service.yaml
- analytics-service-secret-analytics-service.yaml
# Image tag replacement (will be overridden by overlays)
images:
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service
newTag: latest
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service
newTag: latest
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service
newTag: latest
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service
newTag: latest
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service
newTag: latest
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service
newTag: latest
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service
newTag: latest
@@ -0,0 +1,24 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-participation-service
data:
# Server Configuration
SERVER_PORT: "8084"
# Database Configuration
DB_HOST: "participation-postgresql"
DB_PORT: "5432"
DB_NAME: "participationdb"
DB_USERNAME: "eventuser"
# Redis Configuration (service-specific)
REDIS_DATABASE: "4"
# Kafka Configuration (service-specific)
KAFKA_CONSUMER_GROUP: "participation-service-consumers"
# Logging Configuration
LOG_LEVEL: "INFO"
SHOW_SQL: "false"
LOG_FILE: "logs/participation-service.log"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: participation-service
labels:
app: participation-service
spec:
replicas: 1
selector:
matchLabels:
app: participation-service
template:
metadata:
labels:
app: participation-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: participation-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8084
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-participation-service
- secretRef:
name: secret-common
- secretRef:
name: secret-participation-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /actuator/health/liveness
port: 8084
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 30
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8084
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8084
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-participation-service
type: Opaque
stringData:
DB_PASSWORD: "Hi5Jessica!"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: participation-service
labels:
app: participation-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8084
protocol: TCP
name: http
selector:
app: participation-service
+11
View File
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-common
type: Opaque
stringData:
# Redis Password
REDIS_PASSWORD: "Hi5Jessica!"
# JWT Secret
JWT_SECRET: "QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU="
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Secret
metadata:
name: kt-event-marketing
type: kubernetes.io/dockerconfigjson
stringData:
.dockerconfigjson: |
{
"auths": {
"acrdigitalgarage01.azurecr.io": {
"username": "acrdigitalgarage01",
"password": "+OY+rmOagorjWvQe/tTk6oqvnZI8SmNbY/Y2o5EDcY+ACRDCDbYk",
"auth": "YWNyZGlnaXRhbGdhcmFnZTAxOitPWStybU9hZ29yald2UWUvdFRrNm9xdm5aSThTbU5iWS9ZMm81RURjWStBQ1JEQ0RiWWs="
}
}
}
@@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cm-user-service
data:
# Server Configuration
SERVER_PORT: "8081"
# Database Configuration
DB_URL: "jdbc:postgresql://user-postgresql:5432/userdb"
DB_HOST: "user-postgresql"
DB_PORT: "5432"
DB_NAME: "userdb"
DB_USERNAME: "eventuser"
DB_DRIVER: "org.postgresql.Driver"
DB_KIND: "postgresql"
DB_POOL_MAX: "20"
DB_POOL_MIN: "5"
DB_CONN_TIMEOUT: "30000"
DB_IDLE_TIMEOUT: "600000"
DB_MAX_LIFETIME: "1800000"
DB_LEAK_THRESHOLD: "60000"
# Redis Configuration (service-specific)
REDIS_DATABASE: "0"
# Kafka Configuration (service-specific)
KAFKA_CONSUMER_GROUP: "user-service-consumers"
# Logging Configuration
LOG_FILE_PATH: "logs/user-service.log"
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-service
labels:
app: user-service
spec:
replicas: 1
selector:
matchLabels:
app: user-service
template:
metadata:
labels:
app: user-service
spec:
imagePullSecrets:
- name: kt-event-marketing
containers:
- name: user-service
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8081
name: http
envFrom:
- configMapRef:
name: cm-common
- configMapRef:
name: cm-user-service
- secretRef:
name: secret-common
- secretRef:
name: secret-user-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
startupProbe:
httpGet:
path: /actuator/health
port: 8081
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8081
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8081
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 3
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: secret-user-service
type: Opaque
stringData:
# Database Password
DB_PASSWORD: "Hi5Jessica!"
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: user-service
labels:
app: user-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8081
protocol: TCP
name: http
selector:
app: user-service
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-service
spec:
replicas: 1
template:
spec:
containers:
- name: ai-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: analytics-service
spec:
replicas: 1
template:
spec:
containers:
- name: analytics-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: content-service
spec:
replicas: 1
template:
spec:
containers:
- name: content-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: distribution-service
spec:
replicas: 1
template:
spec:
containers:
- name: distribution-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-service
spec:
replicas: 1
template:
spec:
containers:
- name: event-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,34 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kt-event-marketing
bases:
- ../../base
# Environment-specific patches
patchesStrategicMerge:
- user-service-patch.yaml
- event-service-patch.yaml
- ai-service-patch.yaml
- content-service-patch.yaml
- distribution-service-patch.yaml
- participation-service-patch.yaml
- analytics-service-patch.yaml
# Override image tags for dev environment
images:
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service
newTag: dev
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service
newTag: dev
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service
newTag: dev
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service
newTag: dev
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service
newTag: dev
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service
newTag: dev
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service
newTag: dev
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: participation-service
spec:
replicas: 1
template:
spec:
containers:
- name: participation-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-service
spec:
replicas: 1
template:
spec:
containers:
- name: user-service
resources:
requests:
cpu: "256m"
memory: "256Mi"
limits:
cpu: "1024m"
memory: "1024Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-service
spec:
replicas: 3
template:
spec:
containers:
- name: ai-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: analytics-service
spec:
replicas: 3
template:
spec:
containers:
- name: analytics-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: content-service
spec:
replicas: 3
template:
spec:
containers:
- name: content-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: distribution-service
spec:
replicas: 3
template:
spec:
containers:
- name: distribution-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-service
spec:
replicas: 3
template:
spec:
containers:
- name: event-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,38 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kt-event-marketing
bases:
- ../../base
# Environment-specific labels
commonLabels:
environment: prod
# Environment-specific patches
patchesStrategicMerge:
- user-service-patch.yaml
- event-service-patch.yaml
- ai-service-patch.yaml
- content-service-patch.yaml
- distribution-service-patch.yaml
- participation-service-patch.yaml
- analytics-service-patch.yaml
# Override image tags for prod environment
images:
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service
newTag: prod
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service
newTag: prod
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service
newTag: prod
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service
newTag: prod
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service
newTag: prod
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service
newTag: prod
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service
newTag: prod
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: participation-service
spec:
replicas: 3
template:
spec:
containers:
- name: participation-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-service
spec:
replicas: 3
template:
spec:
containers:
- name: user-service
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-service
spec:
replicas: 2
template:
spec:
containers:
- name: ai-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: analytics-service
spec:
replicas: 2
template:
spec:
containers:
- name: analytics-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: content-service
spec:
replicas: 2
template:
spec:
containers:
- name: content-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: distribution-service
spec:
replicas: 2
template:
spec:
containers:
- name: distribution-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-service
spec:
replicas: 2
template:
spec:
containers:
- name: event-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
@@ -0,0 +1,38 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kt-event-marketing
bases:
- ../../base
# Environment-specific labels
commonLabels:
environment: staging
# Environment-specific patches
patchesStrategicMerge:
- user-service-patch.yaml
- event-service-patch.yaml
- ai-service-patch.yaml
- content-service-patch.yaml
- distribution-service-patch.yaml
- participation-service-patch.yaml
- analytics-service-patch.yaml
# Override image tags for staging environment
images:
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service
newTag: staging
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service
newTag: staging
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service
newTag: staging
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service
newTag: staging
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service
newTag: staging
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service
newTag: staging
- name: acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service
newTag: staging
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: participation-service
spec:
replicas: 2
template:
spec:
containers:
- name: participation-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-service
spec:
replicas: 2
template:
spec:
containers:
- name: user-service
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/env python3
"""
Copy K8s manifests to Kustomize base directory and remove namespace declarations
"""
import os
import shutil
import yaml
from pathlib import Path
# Service names
SERVICES = [
'user-service',
'event-service',
'ai-service',
'content-service',
'distribution-service',
'participation-service',
'analytics-service'
]
# Base directories
SOURCE_DIR = Path('deployment/k8s')
BASE_DIR = Path('.github/kustomize/base')
def remove_namespace_from_yaml(content):
"""Remove namespace field from YAML content"""
docs = list(yaml.safe_load_all(content))
for doc in docs:
if doc and isinstance(doc, dict):
if 'metadata' in doc and 'namespace' in doc['metadata']:
del doc['metadata']['namespace']
return yaml.dump_all(docs, default_flow_style=False, sort_keys=False)
def copy_and_process_file(source_path, dest_path):
"""Copy file and remove namespace declaration"""
with open(source_path, 'r', encoding='utf-8') as f:
content = f.read()
# Remove namespace from YAML
processed_content = remove_namespace_from_yaml(content)
# Write to destination
dest_path.parent.mkdir(parents=True, exist_ok=True)
with open(dest_path, 'w', encoding='utf-8') as f:
f.write(processed_content)
print(f"✓ Copied and processed: {source_path} -> {dest_path}")
def main():
print("Starting manifest copy to Kustomize base...")
# Copy common resources
print("\n[Common Resources]")
common_dir = SOURCE_DIR / 'common'
for file in ['cm-common.yaml', 'secret-common.yaml', 'secret-imagepull.yaml', 'ingress.yaml']:
source = common_dir / file
if source.exists():
dest = BASE_DIR / file
copy_and_process_file(source, dest)
# Copy service-specific resources
print("\n[Service Resources]")
for service in SERVICES:
service_dir = SOURCE_DIR / service
if not service_dir.exists():
print(f"⚠ Service directory not found: {service_dir}")
continue
print(f"\nProcessing {service}...")
for file in service_dir.glob('*.yaml'):
dest = BASE_DIR / f"{service}-{file.name}"
copy_and_process_file(file, dest)
print("\n✅ All manifests copied to base directory!")
if __name__ == '__main__':
main()
+181
View File
@@ -0,0 +1,181 @@
#!/bin/bash
set -e
###############################################################################
# Backend Services Deployment Script for AKS
#
# Usage:
# ./deploy.sh <environment> [service-name]
#
# Arguments:
# environment - Target environment (dev, staging, prod)
# service-name - Specific service to deploy (optional, deploys all if not specified)
#
# Examples:
# ./deploy.sh dev # Deploy all services to dev
# ./deploy.sh prod user-service # Deploy only user-service to prod
###############################################################################
# Color output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Functions
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Validate arguments
if [ $# -lt 1 ]; then
log_error "Usage: $0 <environment> [service-name]"
log_error "Environment must be one of: dev, staging, prod"
exit 1
fi
ENVIRONMENT=$1
SERVICE=${2:-all}
# Validate environment
if [[ ! "$ENVIRONMENT" =~ ^(dev|staging|prod)$ ]]; then
log_error "Invalid environment: $ENVIRONMENT"
log_error "Must be one of: dev, staging, prod"
exit 1
fi
# Load environment variables
ENV_FILE=".github/config/deploy_env_vars_${ENVIRONMENT}"
if [ ! -f "$ENV_FILE" ]; then
log_error "Environment file not found: $ENV_FILE"
exit 1
fi
source "$ENV_FILE"
log_info "Loaded environment configuration: $ENVIRONMENT"
# Service list
SERVICES=(
"user-service"
"event-service"
"ai-service"
"content-service"
"distribution-service"
"participation-service"
"analytics-service"
)
# Validate service if specified
if [ "$SERVICE" != "all" ]; then
if [[ ! " ${SERVICES[@]} " =~ " ${SERVICE} " ]]; then
log_error "Invalid service: $SERVICE"
log_error "Must be one of: ${SERVICES[*]}"
exit 1
fi
SERVICES=("$SERVICE")
fi
log_info "Services to deploy: ${SERVICES[*]}"
# Check prerequisites
log_info "Checking prerequisites..."
if ! command -v az &> /dev/null; then
log_error "Azure CLI not found. Please install Azure CLI."
exit 1
fi
if ! command -v kubectl &> /dev/null; then
log_error "kubectl not found. Please install kubectl."
exit 1
fi
if ! command -v kustomize &> /dev/null; then
log_error "kustomize not found. Please install kustomize."
exit 1
fi
# Azure login check
log_info "Checking Azure authentication..."
if ! az account show &> /dev/null; then
log_error "Not logged in to Azure. Please run 'az login'"
exit 1
fi
# Get AKS credentials
log_info "Getting AKS credentials..."
az aks get-credentials \
--resource-group "$RESOURCE_GROUP" \
--name "$AKS_CLUSTER" \
--overwrite-existing
# Check namespace
log_info "Checking namespace: $NAMESPACE"
if ! kubectl get namespace "$NAMESPACE" &> /dev/null; then
log_warn "Namespace $NAMESPACE does not exist. Creating..."
kubectl create namespace "$NAMESPACE"
fi
# Build and deploy with Kustomize
OVERLAY_DIR=".github/kustomize/overlays/${ENVIRONMENT}"
if [ ! -d "$OVERLAY_DIR" ]; then
log_error "Kustomize overlay directory not found: $OVERLAY_DIR"
exit 1
fi
log_info "Building Kustomize manifests for $ENVIRONMENT..."
cd "$OVERLAY_DIR"
# Update image tags
log_info "Updating image tags to: $ENVIRONMENT"
kustomize edit set image \
${ACR_NAME}.azurecr.io/kt-event-marketing/user-service:${ENVIRONMENT} \
${ACR_NAME}.azurecr.io/kt-event-marketing/event-service:${ENVIRONMENT} \
${ACR_NAME}.azurecr.io/kt-event-marketing/ai-service:${ENVIRONMENT} \
${ACR_NAME}.azurecr.io/kt-event-marketing/content-service:${ENVIRONMENT} \
${ACR_NAME}.azurecr.io/kt-event-marketing/distribution-service:${ENVIRONMENT} \
${ACR_NAME}.azurecr.io/kt-event-marketing/participation-service:${ENVIRONMENT} \
${ACR_NAME}.azurecr.io/kt-event-marketing/analytics-service:${ENVIRONMENT}
# Apply manifests
log_info "Applying manifests to AKS..."
kustomize build . | kubectl apply -f -
cd - > /dev/null
# Wait for deployments
log_info "Waiting for deployments to be ready..."
for service in "${SERVICES[@]}"; do
log_info "Waiting for $service deployment..."
if ! kubectl rollout status deployment/"$service" -n "$NAMESPACE" --timeout=5m; then
log_error "Deployment of $service failed!"
exit 1
fi
log_info "$service is ready"
done
# Verify deployment
log_info "Verifying deployment..."
echo ""
echo "=== Pods Status ==="
kubectl get pods -n "$NAMESPACE" -l app.kubernetes.io/part-of=kt-event-marketing
echo ""
echo "=== Services ==="
kubectl get svc -n "$NAMESPACE"
echo ""
echo "=== Ingress ==="
kubectl get ingress -n "$NAMESPACE"
log_info "Deployment completed successfully!"
log_info "Environment: $ENVIRONMENT"
log_info "Services: ${SERVICES[*]}"
+51
View File
@@ -0,0 +1,51 @@
#!/bin/bash
SERVICES=(user-service event-service ai-service content-service distribution-service participation-service analytics-service)
# Staging patches (2 replicas, increased resources)
for service in "${SERVICES[@]}"; do
cat > ".github/kustomize/overlays/staging/${service}-patch.yaml" << YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${service}
spec:
replicas: 2
template:
spec:
containers:
- name: ${service}
resources:
requests:
cpu: "512m"
memory: "512Mi"
limits:
cpu: "2048m"
memory: "2048Mi"
YAML
done
# Prod patches (3 replicas, maximum resources)
for service in "${SERVICES[@]}"; do
cat > ".github/kustomize/overlays/prod/${service}-patch.yaml" << YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${service}
spec:
replicas: 3
template:
spec:
containers:
- name: ${service}
resources:
requests:
cpu: "1024m"
memory: "1024Mi"
limits:
cpu: "4096m"
memory: "4096Mi"
YAML
done
echo "✅ Generated all patch files for staging and prod"
+207
View File
@@ -0,0 +1,207 @@
name: Backend CI/CD Pipeline
on:
# push:
# branches:
# - develop
# - main
# paths:
# - '*-service/**'
# - '.github/workflows/backend-cicd.yaml'
# - '.github/kustomize/**'
pull_request:
branches:
- develop
- main
paths:
- '*-service/**'
workflow_dispatch:
inputs:
environment:
description: 'Target environment'
required: true
type: choice
options:
- dev
- staging
- prod
service:
description: 'Service to deploy (all for all services)'
required: true
default: 'all'
env:
ACR_NAME: acrdigitalgarage01
RESOURCE_GROUP: rg-digitalgarage-01
AKS_CLUSTER: aks-digitalgarage-01
NAMESPACE: kt-event-marketing
JDK_VERSION: '21'
jobs:
detect-changes:
name: Detect Changed Services
runs-on: ubuntu-latest
outputs:
services: ${{ steps.detect.outputs.services }}
environment: ${{ steps.env.outputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine environment
id: env
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "environment=${{ github.event.inputs.environment }}" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "environment=prod" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" = "refs/heads/develop" ]; then
echo "environment=dev" >> $GITHUB_OUTPUT
else
echo "environment=dev" >> $GITHUB_OUTPUT
fi
- name: Detect changed services
id: detect
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.service }}" != "all" ]; then
echo "services=[\"${{ github.event.inputs.service }}\"]" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.service }}" = "all" ]; then
echo "services=[\"user-service\",\"event-service\",\"ai-service\",\"content-service\",\"distribution-service\",\"participation-service\",\"analytics-service\"]" >> $GITHUB_OUTPUT
else
CHANGED_SERVICES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | \
grep -E '^(user|event|ai|content|distribution|participation|analytics)-service/' | \
cut -d'/' -f1 | sort -u | \
jq -R -s -c 'split("\n") | map(select(length > 0))')
if [ "$CHANGED_SERVICES" = "[]" ] || [ -z "$CHANGED_SERVICES" ]; then
echo "services=[\"user-service\",\"event-service\",\"ai-service\",\"content-service\",\"distribution-service\",\"participation-service\",\"analytics-service\"]" >> $GITHUB_OUTPUT
else
echo "services=$CHANGED_SERVICES" >> $GITHUB_OUTPUT
fi
fi
build-and-push:
name: Build and Push - ${{ matrix.service }}
needs: detect-changes
runs-on: ubuntu-latest
strategy:
matrix:
service: ${{ fromJson(needs.detect-changes.outputs.services) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_VERSION }}
distribution: 'temurin'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew ${{ matrix.service }}:build -x test
# - name: Run tests
# run: ./gradlew ${{ matrix.service }}:test
- name: Build JAR
run: ./gradlew ${{ matrix.service }}:bootJar
- name: Log in to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.ACR_NAME }}.azurecr.io
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.service }}
file: ./${{ matrix.service }}/Dockerfile
push: true
tags: |
${{ env.ACR_NAME }}.azurecr.io/kt-event-marketing/${{ matrix.service }}:${{ needs.detect-changes.outputs.environment }}
${{ env.ACR_NAME }}.azurecr.io/kt-event-marketing/${{ matrix.service }}:${{ github.sha }}
${{ env.ACR_NAME }}.azurecr.io/kt-event-marketing/${{ matrix.service }}:latest
deploy:
name: Deploy to AKS - ${{ needs.detect-changes.outputs.environment }}
needs: [detect-changes, build-and-push]
runs-on: ubuntu-latest
environment: ${{ needs.detect-changes.outputs.environment }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Azure login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Get AKS credentials
run: |
az aks get-credentials \
--resource-group ${{ env.RESOURCE_GROUP }} \
--name ${{ env.AKS_CLUSTER }} \
--overwrite-existing
- name: Setup Kustomize
uses: imranismail/setup-kustomize@v2
- name: Deploy with Kustomize
run: |
cd .github/kustomize/overlays/${{ needs.detect-changes.outputs.environment }}
kustomize edit set image \
acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service:${{ needs.detect-changes.outputs.environment }} \
acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service:${{ needs.detect-changes.outputs.environment }} \
acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service:${{ needs.detect-changes.outputs.environment }} \
acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service:${{ needs.detect-changes.outputs.environment }} \
acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service:${{ needs.detect-changes.outputs.environment }} \
acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service:${{ needs.detect-changes.outputs.environment }} \
acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service:${{ needs.detect-changes.outputs.environment }}
kustomize build . | kubectl apply -f -
- name: Wait for deployment rollout
run: |
for service in $(echo '${{ needs.detect-changes.outputs.services }}' | jq -r '.[]'); do
echo "Waiting for ${service} deployment..."
kubectl rollout status deployment/${service} -n ${{ env.NAMESPACE }} --timeout=5m
done
- name: Verify deployment
run: |
echo "=== Pods Status ==="
kubectl get pods -n ${{ env.NAMESPACE }} -l app.kubernetes.io/part-of=kt-event-marketing
echo "=== Services ==="
kubectl get svc -n ${{ env.NAMESPACE }}
echo "=== Ingress ==="
kubectl get ingress -n ${{ env.NAMESPACE }}
notify:
name: Notify Deployment Result
needs: [detect-changes, deploy]
runs-on: ubuntu-latest
if: always()
steps:
- name: Deployment Success
if: needs.deploy.result == 'success'
run: |
echo "✅ Deployment to ${{ needs.detect-changes.outputs.environment }} succeeded!"
echo "Services: ${{ needs.detect-changes.outputs.services }}"
- name: Deployment Failure
if: needs.deploy.result == 'failure'
run: |
echo "❌ Deployment to ${{ needs.detect-changes.outputs.environment }} failed!"
echo "Services: ${{ needs.detect-changes.outputs.services }}"
exit 1
+30 -2
View File
@@ -8,6 +8,7 @@ yarn-error.log*
# IDE
.idea/
.vscode/
.run/
*.swp
*.swo
*~
@@ -23,6 +24,21 @@ build/
.gradle/
logs/
# Gradle
.gradle/
!gradle/wrapper/gradle-wrapper.jar
# Logs
logs/
*.log
# Gradle
.gradle/
gradle-app.setting
!gradle-wrapper.jar
!gradle-wrapper.properties
.gradletasknamecache
# Environment
.env
.env.local
@@ -33,5 +49,17 @@ tmp/
temp/
*.tmp
# Docker (로컬 개발용)
backing-service/docker-compose.yml
# Kubernetes Secrets (민감한 정보 포함)
k8s/**/secret.yaml
k8s/**/*-secret.yaml
k8s/**/*-prod.yaml
k8s/**/*-dev.yaml
k8s/**/*-local.yaml
# IntelliJ 실행 프로파일 (민감한 환경 변수 포함 가능)
.run/*.run.xml
# Gradle (로컬 환경 설정)
gradle.properties
*.hprof
test-data.json
Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Some files were not shown because too many files have changed in this diff Show More