Compare commits

..

6 Commits

Author SHA1 Message Date
Hyowon Yang
85a5f0f6d8 Merge branch 'develop' of https://github.com/ktds-dg0501/kt-event-marketing into develop 2025-10-31 13:35:41 +09:00
Hyowon Yang
a14b003cb4 readme 가이드경로수정 2025-10-31 13:35:19 +09:00
hyeda2020
61bb391568
Merge pull request #45 from ktds-dg0501/feature/gappa
add build,deploy prototype
2025-10-31 13:28:30 +09:00
hiondal
f246477629 add build,deploy prototype 2025-10-31 13:26:13 +09:00
Hyowon Yang
7e00a73da8 readme port정보변경 2025-10-31 13:15:05 +09:00
Hyowon Yang
07d8cc7eac readme 파일내용 수정 2025-10-31 13:10:28 +09:00
11 changed files with 889 additions and 67 deletions

114
README.md
View File

@ -1,4 +1,4 @@
# KT AI 기반 소상공인 이벤트 자동 생성 서비스 (Backend)
# KT 이벤트 파트너
> **AI 기반 이벤트 자동 생성 및 관리 서비스의 백엔드 시스템**
>
@ -54,8 +54,6 @@ http://localhost:8080/swagger-ui.html
- [10. 트러블슈팅](#10-트러블슈팅)
- [11. 개발 참고 자료](#11-개발-참고-자료)
- [12. 팀](#12-팀)
- [13. 라이선스](#13-라이선스)
- [14. 문의](#14-문의)
---
@ -66,12 +64,12 @@ KT AI 기반 소상공인 이벤트 자동 생성 서비스는 고객 유치와
### 1.1 관련 저장소
| 구분 | 설명 | 저장소 URL |
|------|------|-----------|
| 구분 | 설명 | 저장소 URL |
|------|------|----------------------------------------------------------------------------------------------------------------------------------------------|
| **사내 통합** | 설계 문서 및 통합 관리 | [https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing) |
| **백엔드** | Spring Boot 마이크로서비스 (현재 저장소) | [https://github.com/ktds-dg0501/kt-event-marketing](https://github.com/ktds-dg0501/kt-event-marketing) |
| **프론트엔드** | React 기반 웹 애플리케이션 | [https://github.com/ktds-dg0501/kt-event-marketing-fe](https://github.com/ktds-dg0501/kt-event-marketing-fe) |
| **K8s Manifest** | Kubernetes 배포 매니페스트 | {Manifest Repo} |
| **백엔드** | Spring Boot 마이크로서비스 (현재 저장소) | [https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing](https://github.com/ktds-dg0501/kt-event-marketing) |
| **프론트엔드** | React 기반 웹 애플리케이션 | [https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing-fe](https://github.com/ktds-dg0501/kt-event-marketing-fe) |
| **K8s Manifest** | Kubernetes 배포 매니페스트 | {Manifest Repo} |
### 1.2 핵심 기능
- **AI 이벤트 기획**: 업종과 목적에 맞는 이벤트 자동 기획
@ -88,15 +86,15 @@ KT AI 기반 소상공인 이벤트 자동 생성 서비스는 고객 유치와
- [아키텍처 패턴](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/pattern/architecture-pattern.md)
- [High-Level 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/high-level-architecture.md)
- [API 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/api/)
- [논리 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/logical/)
- [시퀀스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/sequence/)
- [클래스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/class/)
- [데이터베이스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/database/)
- [프론트엔드 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/frontend/)
- [논리 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/logical/)
- [시퀀스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/sequence/)
- [클래스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/class/)
- [데이터베이스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/database/)
- [프론트엔드 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/frontend/)
- **Git Repository**:
- **사내 통합 저장소**: https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing
- **백엔드 (GitHub)**: https://github.com/ktds-dg0501/kt-event-marketing.git
- **프론트엔드 (GitHub)**: https://github.com/ktds-dg0501/kt-event-marketing-fe.git
- **백엔드 (GitHub)**: https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing.git
- **프론트엔드 (GitHub)**: https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing-fe.git
- **K8s Manifest**: {Manifest Repo}
- **시연 동영상**: {시연 동영상 링크}
@ -167,15 +165,15 @@ kt-event-marketing/
### 3.2 마이크로서비스 구성
| 서비스 | 포트 | 설명 | API Path |
| 서비스 | 포트 | 설명 | API Path |
|--------|------|------|----------|
| **user-service** | 8081 | 사용자 인증 및 회원 관리 | /api/v1/users |
| **event-service** | 8080 | 이벤트 생성 및 관리, 스케줄링 | /api/v1/events, /api/v1/jobs |
| **content-service** | 8085 | AI 기반 콘텐츠 생성 (이미지, 텍스트) | /api/v1/content |
| **content-service** | 8084 | AI 기반 콘텐츠 생성 (이미지, 텍스트) | /api/v1/content |
| **ai-service** | 8083 | AI 이벤트 추천 및 분석 | /api/v1/ai-service |
| **participation-service** | 8084 | 이벤트 참여자 관리 및 당첨자 추첨 | /api/v1/participations, /api/v1/winners |
| **analytics-service** | 8086 | 이벤트 및 사용자 통계 분석 | /api/v1/events/.../analytics, /api/v1/users/.../analytics |
| **distribution-service** | 8087 | 다채널 이벤트 배포 | /api/v1/distribution |
| **distribution-service** | 8085 | 다채널 이벤트 배포 | /api/v1/distribution |
### 4.3 기술 스택
- **백엔드**:
@ -364,7 +362,7 @@ curl http://localhost:8081/actuator/health
curl http://localhost:8080/actuator/health
# Content Service Health Check
curl http://localhost:8085/health
curl http://localhost:8084/health
# AI Service Health Check
curl http://localhost:8083/actuator/health
@ -376,7 +374,7 @@ curl http://localhost:8084/actuator/health
curl http://localhost:8086/actuator/health
# Distribution Service Health Check
curl http://localhost:8087/actuator/health
curl http://localhost:8085/actuator/health
```
#### 4.3.4 API 문서 확인
@ -384,9 +382,10 @@ curl http://localhost:8087/actuator/health
- User Service: http://localhost:8081/swagger-ui.html
- Event Service: http://localhost:8080/swagger-ui.html
- AI Service: http://localhost:8083/swagger-ui.html
- Content Service: http://localhost:8084/swagger-ui.html
- Participation Service: http://localhost:8084/swagger-ui.html
- Analytics Service: http://localhost:8086/swagger-ui.html
- Distribution Service: http://localhost:8087/swagger-ui.html
- Distribution Service: http://localhost:8085/swagger-ui.html
## 5. Docker 컨테이너 빌드 및 실행
@ -482,7 +481,7 @@ docker run -d \
acrdigitalgarage01.azurecr.io/kt-event/event-service:latest
```
자세한 컨테이너 실행 가이드는 [run-container-guide-back.md](deployment/container/run-container-guide-back.md)를 참조하세요.
자세한 컨테이너 실행 가이드는 [run-container-guide-back.md](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/deployment/container/run-container-guide-back.md)를 참조하세요.
## 6. Kubernetes 배포
@ -647,7 +646,7 @@ kubectl get ingress -n kt-event-marketing
kubectl logs -f <pod-name> -n kt-event-marketing
```
자세한 Kubernetes 배포 가이드는 [deploy-k8s-guide.md](deployment/k8s/deploy-k8s-guide.md)를 참조하세요.
자세한 Kubernetes 배포 가이드는 [deploy-k8s-guide.md](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/deployment/k8s/deploy-k8s-guide.md)를 참조하세요.
## 7. CI/CD
@ -667,7 +666,7 @@ GitHub Actions를 사용한 자동 빌드 및 배포 파이프라인이 구성
### 7.2 Jenkins CI/CD
Jenkins를 사용한 CI/CD 파이프라인 구성이 가능합니다.
자세한 CI/CD 가이드는 [CICD-GUIDE.md](deployment/cicd/CICD-GUIDE.md)를 참조하세요.
자세한 CI/CD 가이드는 [CICD-GUIDE.md](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/deployment/cicd/CICD-GUIDE.md)를 참조하세요.
## 8. 테스트
@ -693,8 +692,8 @@ http://<INGRESS_EXTERNAL_IP>/api/v1/users/swagger-ui.html
```
### 8.3 테스트 계정
- **ID**: test@example.com
- **PW**: Test123!@#
- **ID**: dodari@naver.com
- **PW**: p123456789
## 9. 모니터링 및 로깅
@ -757,48 +756,29 @@ kubectl get secret -n kt-event-marketing
## 11. 개발 참고 자료
### 11.1 프로젝트 문서
- [유저스토리](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/userstory.md)
- [UI/UX 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/uiux/uiux.md)
- [아키텍처 패턴](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/pattern/architecture-pattern.md)
- [High-Level 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/high-level-architecture.md)
- [API 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/api/)
- [논리 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/logical/)
- [시퀀스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/sequence/)
- [클래스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/class/)
- [데이터베이스 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/backend/database/)
- [프론트엔드 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/design/frontend/)
- [개발 변경 이력](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/main/DEVELOP_CHANGELOG.md)
- [유저스토리](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/userstory.md)
- [UI/UX 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/uiux/uiux.md)
- [아키텍처 패턴](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/pattern/architecture-pattern.md)
- [High-Level 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/high-level-architecture.md)
- [API 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/api/)
- [논리 아키텍처](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/logical/)
- [시퀀스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/sequence/)
- [클래스 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/class/)
- [데이터베이스 설계서](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/backend/database/)
- [프론트엔드 설계](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/design/frontend/)
- [개발 변경 이력](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/DEVELOP_CHANGELOG.md)
### 11.2 가이드 문서
- [백킹 서비스 설치 방법](backing-service/)
- [컨테이너 이미지 빌드](deployment/container/build-image.md)
- [Kubernetes 배포 가이드](deployment/k8s/deploy-k8s-guide.md)
- [CI/CD 가이드](deployment/cicd/CICD-GUIDE.md)
- [백킹 서비스 설치 방법](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/backing-service)
- [컨테이너 이미지 빌드](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/deployment/container/build-image.md)
- [Kubernetes 배포 가이드](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/deployment/k8s/deploy-k8s-guide.md)
- [CI/CD 가이드](https://gitea.cbiz.kubepia.net/shared-dg05-dodari/kt-event-marketing/src/branch/develop/deployment/cicd/CICD-GUIDE.md)
## 12. 팀
### 12.1 Product Owner
- **갑빠** - Value Oriented, Interactive, Iterative를 중시하는 애자일 전문가
### 12.2 Scrum Master
- **한준석 "퍼실리테이터"** - 소통과 팀워크를 중시하는 스크럼 마스터
### 12.3 개발팀
- **이미준 "도그냥"** - 서비스 기획자 (Lead)
- **Flynn "플린"** - 플랫폼 기획자
- **이소영 "그로스해커"** - 마케팅 전략가
- **박민지 "픽셀"** - UI/UX 디자이너
- **김태현 "리액트킹"** - 프론트엔드 개발자
- **최수연 "아키텍처"** - 백엔드 개발자
- **정현우 "데이터마법사"** - 데이터 사이언티스트
- **박영자 "전문 아키텍트"** - 시스템 아키텍트
- **송근정 "데브옵스 마스터"** - DevOps 엔지니어
### 12.4 사용자 대표
- **정우진 "사장님"** - 소상공인 대표 (테스트 및 피드백)
## 13. 라이선스
이 프로젝트는 교육 목적으로 작성되었습니다.
## 14. 문의
프로젝트 관련 문의사항은 GitHub Issues를 통해 등록해 주세요.
- **Product Owner**, **Content Service Developer**: 김채리 (체리)
- **Scrum Master**, **Participation Service Developer**: 김도연 (도다리)
- **DevOps Engineer**, **User Service Developer**: 장원호 (티모)
- **Analytics Service Developer**: 양효원 (와와)
- **AI Service Developer**: 박세원 (뚜이)
- **Event Service Developer**: 송하영 (홍차)
- **Distribution Service Developer**: 이선민 (복치)

View File

@ -0,0 +1,108 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kt-event-marketing-ceo
namespace: kt-event-marketing
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: ceo-api.kubepia.com
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
- path: /api/v1/analytics
pathType: Prefix
backend:
service:
name: analytics-service
port:
number: 80
# Distribution Service
- path: /api/v1/distribution
pathType: Prefix
backend:
service:
name: distribution-service
port:
number: 80

View File

@ -0,0 +1,56 @@
# Git
.git
.gitignore
# IDE
.idea
.vscode
*.iml
# Build artifacts
target/
build/
*.class
*.jar
*.war
# Logs
logs/
*.log
# Temporary files
*.tmp
*.temp
*.swp
*~
# OS files
.DS_Store
Thumbs.db
# Documentation (except prototype files)
docs/
*.md
!README.md
# Test files
test/
tests/
*.test.js
# CI/CD
.github/
.gitlab-ci.yml
Jenkinsfile
# Dependencies (will be installed in container)
node_modules/
vendor/
# Deployment files (except what we need)
deployment/*
!deployment/uiux/nginx.conf
# Keep only prototype HTML files
design/*
!design/uiux/prototype/*.html

View File

@ -0,0 +1,21 @@
# Nginx 기반 프로토타입 배포 이미지
FROM nginx:1.25-alpine
# 메타데이터
LABEL maintainer="KT Event Marketing Team"
LABEL description="UI/UX Prototype for KT Event Marketing Service"
# 프로토타입 HTML 파일들을 nginx의 웹 루트로 복사
COPY design/uiux/prototype/* /usr/share/nginx/html/
# nginx 설정 파일 복사 (커스텀 설정이 필요한 경우)
COPY deployment/uiux/nginx.conf /etc/nginx/conf.d/default.conf
# 헬스체크 엔드포인트 추가
RUN echo '<!DOCTYPE html><html><body>OK</body></html>' > /usr/share/nginx/html/health
# 포트 노출
EXPOSE 80
# nginx 실행
CMD ["nginx", "-g", "daemon off;"]

339
deployment/uiux/README.md Normal file
View File

@ -0,0 +1,339 @@
# KT 이벤트 마케팅 프로토타입 배포 가이드
UI/UX 프로토타입을 Docker 컨테이너로 빌드하고 Kubernetes 클러스터에 배포하는 가이드입니다.
## 📋 목차
1. [사전 요구사항](#사전-요구사항)
2. [이미지 빌드](#이미지-빌드)
3. [로컬 테스트](#로컬-테스트)
4. [Kubernetes 배포](#kubernetes-배포)
5. [접속 및 확인](#접속-및-확인)
6. [문제 해결](#문제-해결)
---
## 🔧 사전 요구사항
### 필수 도구
- Docker (버전 20.10 이상)
- kubectl (버전 1.24 이상)
- Kubernetes 클러스터 (접근 권한 필요)
### 환경 변수 설정 (선택사항)
```bash
# Docker 레지스트리 설정
export DOCKER_REGISTRY=acrdigitalgarage01.azurecr.io # Azure Container Registry
export IMAGE_TAG=v1.0.0 # 기본값: latest
# Kubernetes 네임스페이스 설정
export KUBE_NAMESPACE=kt-event-marketing # 기본값: kt-event-marketing
```
---
## 🔨 이미지 빌드
### 1. 빌드 스크립트 실행
프로젝트 루트에서 다음 명령어를 실행합니다:
```bash
./deployment/uiux/build.sh
```
### 2. 빌드 프로세스
스크립트는 다음 단계를 수행합니다:
1. Docker 이미지 빌드
2. 레지스트리 푸시 여부 확인
3. (선택시) 이미지를 레지스트리에 푸시
### 3. 수동 빌드 (선택사항)
스크립트를 사용하지 않고 수동으로 빌드할 수도 있습니다:
```bash
# 이미지 빌드
docker build -f deployment/uiux/Dockerfile \
-t acrdigitalgarage01.azurecr.io/kt-event-prototype:latest .
# 레지스트리에 푸시
docker push acrdigitalgarage01.azurecr.io/kt-event-prototype:latest
```
---
## 🧪 로컬 테스트
Kubernetes에 배포하기 전에 로컬에서 테스트할 수 있습니다:
```bash
# 컨테이너 실행
docker run -d -p 8080:80 --name prototype \
acrdigitalgarage01.azurecr.io/kt-event-prototype:latest
# 브라우저에서 접속
# http://localhost:8080
# 컨테이너 중지 및 제거
docker stop prototype
docker rm prototype
```
### 헬스체크 확인
```bash
curl http://localhost:8080/health
# 출력: OK
```
---
## ☸️ Kubernetes 배포
### 1. 배포 스크립트 실행
```bash
./deployment/uiux/deploy.sh
```
### 2. 배포 옵션 선택
스크립트 실행 시 다음 옵션을 선택할 수 있습니다:
- **1) 전체 배포**: Deployment + Service + Ingress 모두 배포
- **2) 업데이트**: Deployment 업데이트 (이미지 변경 시)
- **3) 삭제**: 모든 리소스 삭제
### 3. 수동 배포 (선택사항)
```bash
# 모든 리소스 배포
kubectl apply -f deployment/uiux/k8s/deployment.yaml
kubectl apply -f deployment/uiux/k8s/service.yaml
kubectl apply -f deployment/uiux/k8s/ingress.yaml
# 배포 상태 확인
kubectl rollout status deployment/kt-event-prototype
```
### 4. 이미지 업데이트
새 이미지로 업데이트하려면:
```bash
# 새 이미지로 태그 변경
kubectl set image deployment/kt-event-prototype \
nginx=acrdigitalgarage01.azurecr.io/kt-event-prototype:v1.0.1 \
-n kt-event-marketing
# 롤아웃 상태 확인
kubectl rollout status deployment/kt-event-prototype -n kt-event-marketing
# 롤백 (필요시)
kubectl rollout undo deployment/kt-event-prototype -n kt-event-marketing
```
---
## 🌐 접속 및 확인
### 1. Pod 상태 확인
```bash
kubectl get pods -l app=kt-event-prototype -n kt-event-marketing
```
정상 상태:
```
NAME READY STATUS RESTARTS AGE
kt-event-prototype-xxxxxxxxxx-xxxxx 1/1 Running 0 1m
```
### 2. Service 확인
```bash
kubectl get svc kt-event-prototype -n kt-event-marketing
```
### 3. Ingress 확인
```bash
kubectl get ingress kt-event-prototype -n kt-event-marketing
```
Ingress 호스트 주소: `prototype.kt-event.kubepia.com`
### 4. 브라우저에서 접속
```
http://prototype.kt-event.kubepia.com
```
> **참고**: 도메인이 외부 DNS에 등록되어 있지 않은 경우, `/etc/hosts` (또는 Windows: `C:\Windows\System32\drivers\etc\hosts`) 파일에 다음을 추가하여 로컬 테스트 가능:
> ```
> <INGRESS_CONTROLLER_IP> prototype.kt-event.kubepia.com
> ```
>
> Ingress Controller IP 확인:
> ```bash
> kubectl get svc -n ingress-nginx
> ```
### 6. 프로토타입 화면 목록
접속 후 다음 화면들을 확인할 수 있습니다:
- 01-로그인.html
- 02-회원가입.html
- 03-프로필.html
- 04-로그아웃확인.html
- 05-대시보드.html
- 06-이벤트목록.html
- 07-이벤트목적선택.html
- 08-AI이벤트추천.html
- 09-콘텐츠미리보기.html
- 10-콘텐츠편집.html
- 11-이벤트게시.html
- 12-내이벤트.html
- 13-이벤트상세.html
- 14-이벤트수정.html
- 15-이벤트삭제확인.html
- 16-통계대시보드.html
- 17-예산관리.html
- 18-공유하기.html
- 19-알림센터.html
- 20-도움말.html
---
## 🔍 문제 해결
### Pod가 시작하지 않을 때
```bash
# Pod 상세 정보 확인
kubectl describe pod -l app=kt-event-prototype -n kt-event-marketing
# Pod 로그 확인
kubectl logs -l app=kt-event-prototype -n kt-event-marketing
# 이벤트 확인
kubectl get events -n kt-event-marketing --sort-by='.lastTimestamp'
```
### 일반적인 문제
#### 1. ImagePullBackOff 에러
- **원인**: 이미지를 레지스트리에서 가져올 수 없음
- **해결**:
```bash
# 이미지 이름 확인
kubectl get deployment kt-event-prototype -n kt-event-marketing \
-o jsonpath='{.spec.template.spec.containers[0].image}'
# 수동으로 이미지 pull 테스트
docker pull acrdigitalgarage01.azurecr.io/kt-event-prototype:latest
```
#### 2. CrashLoopBackOff 에러
- **원인**: 컨테이너가 시작 후 계속 종료됨
- **해결**:
```bash
# 로그 확인
kubectl logs -l app=kt-event-prototype -n kt-event-marketing --previous
# 컨테이너 내부 확인
kubectl exec -it <pod-name> -n kt-event-marketing -- sh
```
#### 3. Ingress 접속 안됨
- **원인**: Ingress Controller 미설치 또는 DNS 미설정
- **해결**:
```bash
# Ingress Controller 확인
kubectl get pods -n ingress-nginx
# Ingress 상세 확인
kubectl describe ingress kt-event-prototype -n kt-event-marketing
```
### 로그 확인 명령어
```bash
# 실시간 로그 확인
kubectl logs -f -l app=kt-event-prototype -n kt-event-marketing
# 최근 100줄 로그
kubectl logs --tail=100 -l app=kt-event-prototype -n kt-event-marketing
# 모든 Pod의 로그
kubectl logs -l app=kt-event-prototype -n kt-event-marketing --all-containers=true
# 이전 컨테이너 로그 (CrashLoopBackOff 시)
kubectl logs -l app=kt-event-prototype -n kt-event-marketing --previous
```
### 리소스 정리
```bash
# 모든 리소스 삭제
kubectl delete -f deployment/uiux/k8s/ -n kt-event-marketing
# 또는 개별 삭제
kubectl delete ingress kt-event-prototype -n kt-event-marketing
kubectl delete service kt-event-prototype -n kt-event-marketing
kubectl delete deployment kt-event-prototype -n kt-event-marketing
```
---
## 📊 리소스 사양
### Deployment
- **Replicas**: 2개 (고가용성)
- **Container Port**: 80
- **Resources**:
- CPU: 100m (request), 200m (limit)
- Memory: 128Mi (request), 256Mi (limit)
### Service
- **Type**: ClusterIP
- **Port**: 80
### Ingress
- **Host**: `prototype.kt-event.local` (변경 필요)
- **Path**: `/` (모든 경로)
- **Backend**: kt-event-prototype:80
---
## 🔐 보안 설정
- **runAsNonRoot**: true (root 사용자로 실행 안함)
- **readOnlyRootFilesystem**: false (nginx 로그 작성 허용)
- **allowPrivilegeEscalation**: false
- **Capabilities**: NET_BIND_SERVICE만 허용
---
## 📝 참고 사항
1. **도메인**: 현재 `prototype.kt-event.kubepia.com`으로 설정되어 있습니다. 변경이 필요한 경우 `k8s/ingress.yaml`에서 수정하세요.
2. **네임스페이스**: `kt-event-marketing` 네임스페이스를 사용합니다. 환경변수 `KUBE_NAMESPACE`로 변경 가능합니다.
3. **레지스트리**: Azure Container Registry(`acrdigitalgarage01.azurecr.io`)를 사용합니다.
4. **리소스 제한**: 프로덕션 환경에서는 리소스 요청/제한을 조정하세요.
5. **TLS**: HTTPS 사용 시 `ingress.yaml`에서 TLS 섹션을 활성화하세요.
6. **모니터링**: Prometheus/Grafana를 통한 모니터링 권장합니다.
7. **nginx 설정**: nginx 설정은 Docker 이미지에 포함되어 있습니다. 변경이 필요한 경우 `nginx.conf`를 수정하고 이미지를 재빌드하세요.
---
## 🤝 지원
문제가 발생하면 다음을 확인하세요:
1. Pod 로그
2. Ingress Controller 로그
3. Kubernetes 이벤트
추가 지원이 필요하면 개발팀에 문의하세요.

48
deployment/uiux/build.sh Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# 빌드 스크립트
# 프로토타입 이미지를 빌드하고 레지스트리에 푸시합니다.
set -e
# 변수 설정
IMAGE_NAME="kt-event-prototype"
REGISTRY="${DOCKER_REGISTRY:-acrdigitalgarage01.azurecr.io}"
TAG="${IMAGE_TAG:-latest}"
FULL_IMAGE="${REGISTRY}/${IMAGE_NAME}:${TAG}"
echo "================================="
echo "프로토타입 이미지 빌드"
echo "================================="
echo "이미지: ${FULL_IMAGE}"
echo ""
# 프로젝트 루트로 이동
cd "$(dirname "$0")/../.."
# Docker 이미지 빌드
echo "🔨 이미지 빌드 중..."
docker build -f deployment/uiux/Dockerfile -t ${FULL_IMAGE} .
echo ""
echo "✅ 이미지 빌드 완료: ${FULL_IMAGE}"
echo ""
# 레지스트리 푸시 여부 확인
read -p "레지스트리에 푸시하시겠습니까? (y/N): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "📤 이미지 푸시 중..."
docker push ${FULL_IMAGE}
echo "✅ 이미지 푸시 완료"
else
echo "⏭️ 푸시 생략"
fi
echo ""
echo "================================="
echo "빌드 완료"
echo "================================="
echo ""

116
deployment/uiux/deploy.sh Normal file
View File

@ -0,0 +1,116 @@
#!/bin/bash
# Kubernetes 배포 스크립트
# 프로토타입을 Kubernetes 클러스터에 배포합니다.
set -e
# 변수 설정
NAMESPACE="${KUBE_NAMESPACE:-kt-event-marketing}"
MANIFEST_DIR="$(dirname "$0")/k8s"
echo "================================="
echo "프로토타입 Kubernetes 배포"
echo "================================="
echo "네임스페이스: ${NAMESPACE}"
echo "매니페스트 위치: ${MANIFEST_DIR}"
echo ""
# kubectl 확인
if ! command -v kubectl &> /dev/null; then
echo "❌ kubectl이 설치되어 있지 않습니다."
exit 1
fi
# 클러스터 연결 확인
if ! kubectl cluster-info &> /dev/null; then
echo "❌ Kubernetes 클러스터에 연결할 수 없습니다."
echo " kubectl 설정을 확인해주세요."
exit 1
fi
echo "✅ Kubernetes 클러스터 연결 확인"
echo ""
# 배포 옵션 선택
echo "배포 옵션을 선택하세요:"
echo "1) 전체 배포 (deployment + service + ingress)"
echo "2) 업데이트 (deployment만)"
echo "3) 삭제"
read -p "선택 (1-3): " -n 1 -r
echo ""
echo ""
case $REPLY in
1)
echo "🚀 전체 리소스 배포 중..."
kubectl apply -f ${MANIFEST_DIR}/deployment.yaml -n ${NAMESPACE}
kubectl apply -f ${MANIFEST_DIR}/service.yaml -n ${NAMESPACE}
kubectl apply -f ${MANIFEST_DIR}/ingress.yaml -n ${NAMESPACE}
echo "✅ 배포 완료"
;;
2)
echo "🔄 Deployment 업데이트 중..."
kubectl apply -f ${MANIFEST_DIR}/deployment.yaml -n ${NAMESPACE}
kubectl rollout status deployment/kt-event-prototype -n ${NAMESPACE}
echo "✅ 업데이트 완료"
;;
3)
echo "🗑️ 리소스 삭제 중..."
kubectl delete -f ${MANIFEST_DIR}/ingress.yaml -n ${NAMESPACE} --ignore-not-found
kubectl delete -f ${MANIFEST_DIR}/service.yaml -n ${NAMESPACE} --ignore-not-found
kubectl delete -f ${MANIFEST_DIR}/deployment.yaml -n ${NAMESPACE} --ignore-not-found
echo "✅ 삭제 완료"
exit 0
;;
*)
echo "❌ 잘못된 선택입니다."
exit 1
;;
esac
echo ""
echo "================================="
echo "배포 상태 확인"
echo "================================="
# Pod 상태 확인
echo ""
echo "📦 Pod 상태:"
kubectl get pods -n ${NAMESPACE} -l app=kt-event-prototype
# Service 상태 확인
echo ""
echo "🌐 Service 상태:"
kubectl get svc -n ${NAMESPACE} -l app=kt-event-prototype
# Ingress 상태 확인
echo ""
echo "🚪 Ingress 상태:"
kubectl get ingress -n ${NAMESPACE} -l app=kt-event-prototype
echo ""
echo "================================="
echo "배포 완료"
echo "================================="
echo ""
echo "유용한 명령어:"
echo " # Pod 로그 확인"
echo " kubectl logs -n ${NAMESPACE} -l app=kt-event-prototype -f"
echo ""
echo " # Pod 상세 정보"
echo " kubectl describe pods -n ${NAMESPACE} -l app=kt-event-prototype"
echo ""
echo " # 서비스 상태 확인"
echo " kubectl get all -n ${NAMESPACE} -l app=kt-event-prototype"
echo ""
# Ingress 호스트 정보 표시
INGRESS_HOST=$(kubectl get ingress kt-event-prototype -n ${NAMESPACE} -o jsonpath='{.spec.rules[0].host}' 2>/dev/null)
if [ -n "$INGRESS_HOST" ]; then
echo "🌍 접속 URL: http://${INGRESS_HOST}"
echo ""
echo "⚠️ /etc/hosts 파일에 다음 내용 추가 필요 (로컬 테스트):"
echo " <INGRESS_IP> ${INGRESS_HOST}"
echo ""
fi

View File

@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: kt-event-prototype
namespace: kt-event-marketing
labels:
app: kt-event-prototype
tier: frontend
component: prototype
spec:
replicas: 1
selector:
matchLabels:
app: kt-event-prototype
template:
metadata:
labels:
app: kt-event-prototype
tier: frontend
component: prototype
spec:
containers:
- name: nginx
image: acrdigitalgarage01.azurecr.io/kt-event-prototype:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
protocol: TCP
# 리소스 제한
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
# 재시작 정책
restartPolicy: Always

View File

@ -0,0 +1,42 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kt-event-prototype
namespace: kt-event-marketing
labels:
app: kt-event-prototype
tier: frontend
component: prototype
annotations:
# Nginx Ingress Controller 설정
# rewrite-target 제거: Pod 내부 nginx가 직접 처리하도록
nginx.ingress.kubernetes.io/ssl-redirect: "false"
# CORS 설정 (필요시 활성화)
# nginx.ingress.kubernetes.io/enable-cors: "true"
# nginx.ingress.kubernetes.io/cors-allow-methods: "GET, OPTIONS"
# nginx.ingress.kubernetes.io/cors-allow-origin: "*"
# 타임아웃 설정
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
nginx.ingress.kubernetes.io/proxy-send-timeout: "30"
nginx.ingress.kubernetes.io/proxy-read-timeout: "30"
# 버퍼 크기 설정
nginx.ingress.kubernetes.io/proxy-body-size: "10m"
# Rate limiting (필요시 활성화)
# nginx.ingress.kubernetes.io/limit-rps: "10"
spec:
ingressClassName: nginx
rules:
- host: prototype.kt-event.kubepia.com # 실제 도메인으로 변경 필요
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kt-event-prototype
port:
number: 80

View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: kt-event-prototype
namespace: kt-event-marketing
labels:
app: kt-event-prototype
tier: frontend
component: prototype
spec:
type: ClusterIP
selector:
app: kt-event-prototype
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
sessionAffinity: None

View File

@ -0,0 +1,52 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index 01-로그인.html;
# 한글 파일명 지원
charset utf-8;
# 로그 설정
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# 루트 경로를 명시적으로 로그인 페이지로 처리
# 디렉토리처럼 처리하여 index 지시어가 작동하도록
location = / {
try_files $uri/ /01-로그인.html;
}
# 모든 다른 요청에 대해 기본 처리
location / {
try_files $uri $uri/ /01-로그인.html;
}
# index.html 요청도 로그인 페이지로
location = /index.html {
return 301 /01-로그인.html;
}
# 정적 파일 캐싱
location ~* \.(html|css|js|png|jpg|jpeg|gif|ico|svg)$ {
expires 1d;
add_header Cache-Control "public, immutable";
}
# 헬스체크 엔드포인트
location /health {
access_log off;
return 200 "OK\n";
add_header Content-Type text/plain;
}
# 404 처리
error_page 404 /01-로그인.html;
# gzip 압축
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss;
}