mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2026-06-13 08:59:11 +00:00
물리아키텍처 설계 완료
✨ 주요 기능 - 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>
This commit is contained in:
@@ -0,0 +1,199 @@
|
||||
graph TB
|
||||
%% 개발환경 네트워크 다이어그램
|
||||
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 개발환경
|
||||
|
||||
%% 외부 영역
|
||||
subgraph Internet["🌐 인터넷"]
|
||||
Developer["👨💻 개발자"]
|
||||
QATester["🧪 QA팀"]
|
||||
ExternalAPIs["🔌 외부 API"]
|
||||
|
||||
subgraph ExternalServices["외부 서비스"]
|
||||
OpenAI["🤖 OpenAI API<br/>(GPT-4)"]
|
||||
KakaoAPI["💬 카카오 API"]
|
||||
NaverAPI["📧 네이버 API"]
|
||||
InstagramAPI["📸 Instagram API"]
|
||||
end
|
||||
end
|
||||
|
||||
%% Azure 클라우드 영역
|
||||
subgraph AzureCloud["☁️ Azure Cloud"]
|
||||
|
||||
%% Virtual Network
|
||||
subgraph VNet["🏢 Virtual Network (VNet)<br/>주소 공간: 10.0.0.0/16"]
|
||||
|
||||
%% AKS 서브넷
|
||||
subgraph AKSSubnet["🎯 AKS Subnet<br/>10.0.1.0/24"]
|
||||
|
||||
%% Kubernetes 클러스터
|
||||
subgraph AKSCluster["⚙️ AKS Cluster"]
|
||||
|
||||
%% Ingress Controller
|
||||
subgraph IngressController["🚪 NGINX Ingress Controller"]
|
||||
LoadBalancer["⚖️ LoadBalancer Service<br/>(External IP)"]
|
||||
IngressPod["📦 Ingress Controller Pod"]
|
||||
end
|
||||
|
||||
%% Application Tier
|
||||
subgraph AppTier["🚀 Application Tier"]
|
||||
EventService["🎉 Event Service<br/>Pod"]
|
||||
TemplateService["📋 Template Service<br/>Pod"]
|
||||
ParticipationService["👥 Participation Service<br/>Pod"]
|
||||
AnalyticsService["📊 Analytics Service<br/>Pod"]
|
||||
AIService["🤖 AI Service<br/>Pod"]
|
||||
AdminService["⚙️ Admin Service<br/>Pod"]
|
||||
end
|
||||
|
||||
%% Frontend Tier
|
||||
subgraph FrontendTier["🎨 Frontend Tier"]
|
||||
UserPortal["🌐 User Portal<br/>Pod (React)"]
|
||||
AdminPortal["🔧 Admin Portal<br/>Pod (React)"]
|
||||
end
|
||||
|
||||
%% Database Tier
|
||||
subgraph DBTier["🗄️ Database Tier"]
|
||||
PostgreSQL["🐘 PostgreSQL<br/>Pod"]
|
||||
PostgreSQLStorage["💾 hostPath Volume<br/>(/data/postgresql)"]
|
||||
end
|
||||
|
||||
%% Cache Tier
|
||||
subgraph CacheTier["⚡ Cache Tier"]
|
||||
Redis["🔴 Redis<br/>Pod"]
|
||||
end
|
||||
|
||||
%% Cluster Internal Services
|
||||
subgraph ClusterServices["🔗 ClusterIP Services"]
|
||||
EventServiceDNS["event-service:8080"]
|
||||
TemplateServiceDNS["template-service:8080"]
|
||||
ParticipationServiceDNS["participation-service:8080"]
|
||||
AnalyticsServiceDNS["analytics-service:8080"]
|
||||
AIServiceDNS["ai-service:8080"]
|
||||
AdminServiceDNS["admin-service:8080"]
|
||||
UserPortalDNS["user-portal:80"]
|
||||
AdminPortalDNS["admin-portal:80"]
|
||||
PostgreSQLDNS["postgresql:5432"]
|
||||
RedisDNS["redis:6379"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%% Service Bus 서브넷
|
||||
subgraph ServiceBusSubnet["📨 Service Bus Subnet<br/>10.0.2.0/24"]
|
||||
ServiceBus["📮 Azure Service Bus<br/>(Basic Tier)"]
|
||||
|
||||
subgraph Queues["📬 Message Queues"]
|
||||
EventQueue["🎉 event-creation"]
|
||||
ScheduleQueue["📅 schedule-generation"]
|
||||
NotificationQueue["🔔 notification"]
|
||||
AnalyticsQueue["📊 analytics-processing"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%% 네트워크 연결 관계
|
||||
|
||||
%% 외부에서 클러스터로의 접근
|
||||
Developer -->|"HTTPS:443<br/>(개발용 도메인)"| LoadBalancer
|
||||
QATester -->|"API 호출/테스트"| LoadBalancer
|
||||
|
||||
%% Ingress Controller 내부 흐름
|
||||
LoadBalancer -->|"트래픽 라우팅"| IngressPod
|
||||
|
||||
%% Ingress에서 Frontend로
|
||||
IngressPod -->|"/"| UserPortalDNS
|
||||
IngressPod -->|"/admin/**"| AdminPortalDNS
|
||||
|
||||
%% Ingress에서 Application Services로
|
||||
IngressPod -->|"/api/events/**"| EventServiceDNS
|
||||
IngressPod -->|"/api/templates/**"| TemplateServiceDNS
|
||||
IngressPod -->|"/api/participation/**"| ParticipationServiceDNS
|
||||
IngressPod -->|"/api/analytics/**"| AnalyticsServiceDNS
|
||||
IngressPod -->|"/api/ai/**"| AIServiceDNS
|
||||
IngressPod -->|"/api/admin/**"| AdminServiceDNS
|
||||
|
||||
%% ClusterIP Services에서 실제 Pod로 (Frontend)
|
||||
UserPortalDNS -->|"내부 로드밸런싱"| UserPortal
|
||||
AdminPortalDNS -->|"내부 로드밸런싱"| AdminPortal
|
||||
|
||||
%% ClusterIP Services에서 실제 Pod로 (Backend)
|
||||
EventServiceDNS -->|"내부 로드밸런싱"| EventService
|
||||
TemplateServiceDNS -->|"내부 로드밸런싱"| TemplateService
|
||||
ParticipationServiceDNS -->|"내부 로드밸런싱"| ParticipationService
|
||||
AnalyticsServiceDNS -->|"내부 로드밸런싱"| AnalyticsService
|
||||
AIServiceDNS -->|"내부 로드밸런싱"| AIService
|
||||
AdminServiceDNS -->|"내부 로드밸런싱"| AdminService
|
||||
|
||||
%% Frontend에서 Backend API로
|
||||
UserPortal -->|"API 호출"| EventServiceDNS
|
||||
UserPortal -->|"API 호출"| TemplateServiceDNS
|
||||
UserPortal -->|"API 호출"| ParticipationServiceDNS
|
||||
AdminPortal -->|"API 호출"| AdminServiceDNS
|
||||
AdminPortal -->|"API 호출"| AnalyticsServiceDNS
|
||||
|
||||
%% Application Services에서 Database로
|
||||
EventService -->|"DB 연결<br/>TCP:5432"| PostgreSQLDNS
|
||||
TemplateService -->|"DB 연결<br/>TCP:5432"| PostgreSQLDNS
|
||||
ParticipationService -->|"DB 연결<br/>TCP:5432"| PostgreSQLDNS
|
||||
AnalyticsService -->|"DB 연결<br/>TCP:5432"| PostgreSQLDNS
|
||||
AIService -->|"DB 연결<br/>TCP:5432"| PostgreSQLDNS
|
||||
AdminService -->|"DB 연결<br/>TCP:5432"| PostgreSQLDNS
|
||||
|
||||
%% Application Services에서 Cache로
|
||||
EventService -->|"캐시 연결<br/>TCP:6379"| RedisDNS
|
||||
TemplateService -->|"캐시 연결<br/>TCP:6379"| RedisDNS
|
||||
ParticipationService -->|"캐시 연결<br/>TCP:6379"| RedisDNS
|
||||
AnalyticsService -->|"캐시 연결<br/>TCP:6379"| RedisDNS
|
||||
AIService -->|"캐시 연결<br/>TCP:6379"| RedisDNS
|
||||
|
||||
%% ClusterIP Services에서 실제 Pod로 (Database/Cache)
|
||||
PostgreSQLDNS -->|"DB 요청 처리"| PostgreSQL
|
||||
RedisDNS -->|"캐시 요청 처리"| Redis
|
||||
|
||||
%% Storage 연결
|
||||
PostgreSQL -->|"데이터 영속화"| PostgreSQLStorage
|
||||
|
||||
%% Service Bus 연결
|
||||
EventService -->|"비동기 메시징<br/>HTTPS/AMQP"| ServiceBus
|
||||
AIService -->|"비동기 메시징<br/>HTTPS/AMQP"| ServiceBus
|
||||
AnalyticsService -->|"비동기 메시징<br/>HTTPS/AMQP"| ServiceBus
|
||||
AdminService -->|"비동기 메시징<br/>HTTPS/AMQP"| ServiceBus
|
||||
|
||||
ServiceBus --> EventQueue
|
||||
ServiceBus --> ScheduleQueue
|
||||
ServiceBus --> NotificationQueue
|
||||
ServiceBus --> AnalyticsQueue
|
||||
|
||||
%% 외부 API 연결
|
||||
AIService -->|"HTTPS:443<br/>(GPT-4 호출)"| OpenAI
|
||||
EventService -->|"HTTPS:443<br/>(SNS 공유)"| KakaoAPI
|
||||
EventService -->|"HTTPS:443<br/>(SNS 공유)"| NaverAPI
|
||||
EventService -->|"HTTPS:443<br/>(SNS 공유)"| InstagramAPI
|
||||
|
||||
%% 서비스 간 내부 통신
|
||||
EventService -.->|"이벤트 조회"| TemplateServiceDNS
|
||||
ParticipationService -.->|"이벤트 정보"| EventServiceDNS
|
||||
AnalyticsService -.->|"데이터 수집"| EventServiceDNS
|
||||
AnalyticsService -.->|"데이터 수집"| ParticipationServiceDNS
|
||||
|
||||
%% 스타일 정의
|
||||
classDef azureStyle fill:#0078D4,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef k8sStyle fill:#326CE5,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef appStyle fill:#28A745,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef frontStyle fill:#17A2B8,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef dbStyle fill:#DC3545,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef cacheStyle fill:#FF6B35,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef serviceStyle fill:#6610F2,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef queueStyle fill:#FD7E14,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef externalStyle fill:#FFC107,stroke:#fff,stroke-width:2px,color:#000
|
||||
|
||||
%% 스타일 적용
|
||||
class AzureCloud,VNet azureStyle
|
||||
class AKSCluster,AKSSubnet,IngressController k8sStyle
|
||||
class AppTier,EventService,TemplateService,ParticipationService,AnalyticsService,AIService,AdminService appStyle
|
||||
class FrontendTier,UserPortal,AdminPortal frontStyle
|
||||
class DBTier,PostgreSQL,PostgreSQLStorage dbStyle
|
||||
class CacheTier,Redis cacheStyle
|
||||
class ClusterServices,EventServiceDNS,TemplateServiceDNS,ParticipationServiceDNS,AnalyticsServiceDNS,AIServiceDNS,AdminServiceDNS,UserPortalDNS,AdminPortalDNS,PostgreSQLDNS,RedisDNS serviceStyle
|
||||
class ServiceBus,ServiceBusSubnet,Queues,EventQueue,ScheduleQueue,NotificationQueue,AnalyticsQueue queueStyle
|
||||
class ExternalAPIs,ExternalServices,OpenAI,KakaoAPI,NaverAPI,InstagramAPI externalStyle
|
||||
@@ -0,0 +1,353 @@
|
||||
# KT 이벤트 마케팅 서비스 - 운영환경 네트워크 아키텍처
|
||||
|
||||
## 📋 문서 정보
|
||||
|
||||
- **작성일**: 2025-10-29
|
||||
- **환경**: Azure Production Environment
|
||||
- **다이어그램**: network-prod.mmd
|
||||
- **참조**: claude/sample-network-prod.mmd
|
||||
|
||||
## 🎯 아키텍처 개요
|
||||
|
||||
운영환경에 최적화된 고가용성 네트워크 아키텍처로, 다중 가용영역(Multi-Zone) 배포와 프라이빗 엔드포인트를 통한 보안 강화를 제공합니다.
|
||||
|
||||
### 핵심 특징
|
||||
|
||||
1. **고가용성**: 3개 가용영역(AZ)에 분산 배포
|
||||
2. **보안 강화**: Private Endpoints 및 NSG 기반 네트워크 격리
|
||||
3. **성능 최적화**: Redis Cluster, Read Replica, CDN 활용
|
||||
4. **확장성**: HPA(Horizontal Pod Autoscaler) 기반 자동 스케일링
|
||||
5. **모니터링**: Application Insights, Prometheus, Grafana 통합
|
||||
|
||||
## 🏗️ 네트워크 구성
|
||||
|
||||
### VNet 구조 (10.0.0.0/16)
|
||||
|
||||
```
|
||||
VNet: 10.0.0.0/16
|
||||
├── Gateway Subnet (10.0.4.0/24)
|
||||
│ └── Application Gateway v2 + WAF
|
||||
├── Application Subnet (10.0.1.0/24)
|
||||
│ └── AKS Premium Cluster (Multi-Zone)
|
||||
├── Database Subnet (10.0.2.0/24)
|
||||
│ └── PostgreSQL Flexible Servers (7개)
|
||||
├── Cache Subnet (10.0.3.0/24)
|
||||
│ └── Azure Cache for Redis Premium
|
||||
├── Service Subnet (10.0.5.0/24)
|
||||
│ └── Azure Service Bus Premium
|
||||
└── Management Subnet (10.0.6.0/24)
|
||||
├── Monitoring (Log Analytics, App Insights, Prometheus, Grafana)
|
||||
└── Security (Key Vault, Defender)
|
||||
```
|
||||
|
||||
## 🔐 보안 아키텍처
|
||||
|
||||
### 1. 네트워크 보안
|
||||
|
||||
| 계층 | 보안 요소 | 설명 |
|
||||
|------|----------|------|
|
||||
| Edge | Azure Front Door + CDN | DDoS 보호, 글로벌 가속 |
|
||||
| Gateway | Application Gateway + WAF v2 | OWASP CRS 3.2, Rate Limiting |
|
||||
| Network | NSG (Network Security Groups) | 서브넷 간 트래픽 제어 |
|
||||
| Data | Private Endpoints | 모든 백엔드 서비스 프라이빗 연결 |
|
||||
| Access | Azure Key Vault Premium | 민감 정보 중앙 관리 |
|
||||
| Monitoring | Azure Defender for Cloud | 실시간 위협 탐지 |
|
||||
|
||||
### 2. Private Endpoints
|
||||
|
||||
모든 백엔드 서비스는 Private Endpoints를 통해 VNet 내부에서만 접근 가능:
|
||||
|
||||
- PostgreSQL (7개 서비스별 DB)
|
||||
- Redis Premium Cluster
|
||||
- Service Bus Premium
|
||||
- Key Vault Premium
|
||||
|
||||
### 3. Private DNS Zones
|
||||
|
||||
Private Link 서비스의 DNS 해석을 위한 전용 DNS 영역:
|
||||
|
||||
- `privatelink.postgres.database.azure.com`
|
||||
- `privatelink.redis.cache.windows.net`
|
||||
- `privatelink.servicebus.windows.net`
|
||||
- `privatelink.vaultcore.azure.net`
|
||||
|
||||
## ⚙️ AKS 클러스터 구성
|
||||
|
||||
### Node Pool 구성
|
||||
|
||||
| Node Pool | VM Size | Nodes | Zone Distribution | 용도 |
|
||||
|-----------|---------|-------|-------------------|------|
|
||||
| System | Standard_D4s_v3 | 3 | AZ1, AZ2, AZ3 | K8s 시스템 컴포넌트 |
|
||||
| Application | Standard_D8s_v3 | 5 | AZ1(2), AZ2(2), AZ3(1) | 애플리케이션 워크로드 |
|
||||
|
||||
### 마이크로서비스 구성
|
||||
|
||||
| 서비스 | Replicas | HPA 범위 | NodePort |
|
||||
|--------|----------|----------|----------|
|
||||
| User Service | 3 | 2-5 | 30080 |
|
||||
| Event Service | 3 | 2-6 | 30081 |
|
||||
| AI Service | 2 | 2-4 | 30082 |
|
||||
| Content Service | 2 | 2-4 | 30083 |
|
||||
| Distribution Service | 2 | 2-4 | 30084 |
|
||||
| Participation Service | 3 | 2-5 | 30085 |
|
||||
| Analytics Service | 2 | 2-4 | 30086 |
|
||||
|
||||
## 🗄️ 데이터베이스 아키텍처
|
||||
|
||||
### PostgreSQL Flexible Server (7개)
|
||||
|
||||
각 마이크로서비스는 독립적인 데이터베이스 사용:
|
||||
|
||||
| 서비스 | Database | 구성 | Backup |
|
||||
|--------|----------|------|--------|
|
||||
| User | user-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
| Event | event-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
| AI | ai-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
| Content | content-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
| Distribution | distribution-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
| Participation | participation-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
| Analytics | analytics-db | Primary + Replica (Zone 1, 2) | Geo-redundant, 35일 |
|
||||
|
||||
### 고가용성 전략
|
||||
|
||||
- **Primary-Replica 구성**: 각 DB는 Zone 1(Primary), Zone 2(Replica)에 배포
|
||||
- **자동 백업**: Geo-redundant backup, 35일 보관
|
||||
- **Point-in-time Recovery**: 최대 35일 내 복구 가능
|
||||
- **Read Replica**: 읽기 부하 분산
|
||||
|
||||
## ⚡ 캐시 아키텍처
|
||||
|
||||
### Azure Cache for Redis Premium
|
||||
|
||||
- **구성**: Clustered, 6GB
|
||||
- **노드**: Primary + 2 Replicas (3 Zones)
|
||||
- **Shards**: 3개 샤드로 분산
|
||||
- **HA**: Zone-redundant 고가용성
|
||||
|
||||
### 캐시 용도
|
||||
|
||||
- 세션 관리 (User Service)
|
||||
- API 응답 캐싱 (Event Service)
|
||||
- AI 결과 캐싱 (AI Service)
|
||||
- 실시간 통계 (Analytics Service)
|
||||
|
||||
## 📨 메시지 큐 아키텍처
|
||||
|
||||
### Azure Service Bus Premium
|
||||
|
||||
- **Namespace**: sb-kt-event-prod
|
||||
- **구성**: Zone-redundant
|
||||
- **총 용량**: 128GB (Partitioned Queues)
|
||||
|
||||
### Queue 구성
|
||||
|
||||
| Queue | Size | Partitioned | 용도 |
|
||||
|-------|------|-------------|------|
|
||||
| ai-event-generation | 32GB | Yes | AI 이벤트 생성 비동기 처리 |
|
||||
| content-generation | 32GB | Yes | 콘텐츠 생성 비동기 처리 |
|
||||
| distribution | 32GB | Yes | 다채널 배포 비동기 처리 |
|
||||
| notification | 16GB | Yes | 알림 발송 비동기 처리 |
|
||||
| analytics | 16GB | Yes | 분석 데이터 수집 |
|
||||
|
||||
### 메시지 흐름
|
||||
|
||||
```
|
||||
AI Queue → Content Queue → Distribution Queue → Notification Queue
|
||||
↓
|
||||
Analytics Queue
|
||||
```
|
||||
|
||||
## 📊 모니터링 & 관리
|
||||
|
||||
### Application Insights (7 instances)
|
||||
|
||||
각 마이크로서비스별 독립적인 Application Insights 인스턴스:
|
||||
|
||||
- 애플리케이션 성능 모니터링 (APM)
|
||||
- 분산 추적 (Distributed Tracing)
|
||||
- 실시간 메트릭 수집
|
||||
- 로그 집계 및 분석
|
||||
|
||||
### Log Analytics Workspace
|
||||
|
||||
- 모든 Application Insights 데이터 집계
|
||||
- 통합 쿼리 및 분석
|
||||
- 알림 규칙 관리
|
||||
|
||||
### Prometheus + Grafana
|
||||
|
||||
- Kubernetes 클러스터 메트릭
|
||||
- 컨테이너 리소스 사용량
|
||||
- 커스텀 비즈니스 메트릭
|
||||
- 실시간 대시보드
|
||||
|
||||
## 🚦 트래픽 흐름
|
||||
|
||||
### 1. 외부 → 내부
|
||||
|
||||
```
|
||||
사용자
|
||||
↓ HTTPS (TLS 1.3)
|
||||
Azure Front Door + CDN
|
||||
↓ Anycast
|
||||
Application Gateway (Public IP)
|
||||
↓ SSL Termination
|
||||
WAF (OWASP CRS 3.2)
|
||||
↓ Rate Limiting (200 req/min/IP)
|
||||
Application Gateway (Private IP)
|
||||
↓ Path-based Routing
|
||||
AKS Internal Load Balancer
|
||||
↓ ClusterIP
|
||||
Microservices (Pods)
|
||||
```
|
||||
|
||||
### 2. 서비스 → 데이터베이스
|
||||
|
||||
```
|
||||
Microservices
|
||||
↓ Private Link (TCP:5432)
|
||||
PostgreSQL Private Endpoint
|
||||
↓ DNS Resolution (Private DNS Zone)
|
||||
PostgreSQL Primary/Replica
|
||||
```
|
||||
|
||||
### 3. 서비스 → 캐시
|
||||
|
||||
```
|
||||
Microservices
|
||||
↓ Private Link (TCP:6379)
|
||||
Redis Private Endpoint
|
||||
↓ DNS Resolution (Private DNS Zone)
|
||||
Redis Primary + Replicas
|
||||
```
|
||||
|
||||
### 4. 서비스 → 메시지 큐
|
||||
|
||||
```
|
||||
Microservices
|
||||
↓ Private Link (AMQP)
|
||||
Service Bus Private Endpoint
|
||||
↓ DNS Resolution (Private DNS Zone)
|
||||
Service Bus Queues
|
||||
```
|
||||
|
||||
## 🔧 운영 고려사항
|
||||
|
||||
### 1. 스케일링 전략
|
||||
|
||||
**Horizontal Pod Autoscaler (HPA)**
|
||||
|
||||
- CPU 사용률 70% 이상 시 자동 스케일 아웃
|
||||
- 메모리 사용률 80% 이상 시 자동 스케일 아웃
|
||||
- 최소/최대 Replica 수 설정
|
||||
|
||||
**Node Pool Auto-scaling**
|
||||
|
||||
- Application Node Pool: 5-15 노드
|
||||
- Zone별 균등 분산 유지
|
||||
|
||||
### 2. 백업 및 복구
|
||||
|
||||
**데이터베이스 백업**
|
||||
|
||||
- 자동 백업: 매일 1회
|
||||
- 보관 기간: 35일
|
||||
- Geo-redundant 저장소
|
||||
- Point-in-time Recovery 지원
|
||||
|
||||
**클러스터 백업**
|
||||
|
||||
- AKS 클러스터 구성 백업
|
||||
- ConfigMaps 및 Secrets 백업
|
||||
- Persistent Volume 스냅샷
|
||||
|
||||
### 3. 재해 복구 (DR)
|
||||
|
||||
**RTO/RPO 목표**
|
||||
|
||||
- RTO (Recovery Time Objective): 1시간
|
||||
- RPO (Recovery Point Objective): 15분
|
||||
|
||||
**DR 전략**
|
||||
|
||||
- Multi-Zone 배포로 Zone 장애 대응
|
||||
- Geo-redundant 백업으로 Region 장애 대응
|
||||
- 자동 장애 조치 (Automatic Failover)
|
||||
|
||||
### 4. 보안 운영
|
||||
|
||||
**정기 점검 항목**
|
||||
|
||||
- [ ] NSG 규칙 검토 (월 1회)
|
||||
- [ ] WAF 정책 업데이트 (분기 1회)
|
||||
- [ ] Key Vault 접근 로그 검토 (주 1회)
|
||||
- [ ] Defender 알림 모니터링 (실시간)
|
||||
- [ ] 취약점 스캔 (월 1회)
|
||||
|
||||
**인증서 관리**
|
||||
|
||||
- SSL/TLS 인증서: 90일 전 갱신 알림
|
||||
- Key Vault 키 로테이션: 연 1회
|
||||
- 서비스 주체 시크릿: 180일 전 갱신
|
||||
|
||||
## 📈 성능 최적화
|
||||
|
||||
### 1. 네트워크 성능
|
||||
|
||||
**Application Gateway**
|
||||
|
||||
- WAF 규칙 최적화 (불필요한 규칙 비활성화)
|
||||
- 연결 드레이닝 설정 (30초)
|
||||
- 백엔드 헬스 체크 간격 최적화
|
||||
|
||||
**AKS 네트워킹**
|
||||
|
||||
- Azure CNI 사용 (빠른 Pod 네트워킹)
|
||||
- Calico 네트워크 정책 적용
|
||||
- Service Mesh (Istio) 선택적 사용
|
||||
|
||||
### 2. 데이터베이스 성능
|
||||
|
||||
**쿼리 최적화**
|
||||
|
||||
- Read Replica 활용 (읽기 부하 분산)
|
||||
- 연결 풀링 (HikariCP 최적화)
|
||||
- 인덱스 전략 수립
|
||||
|
||||
**리소스 튜닝**
|
||||
|
||||
- 적절한 vCore 및 메모리 할당
|
||||
- IOPS 모니터링 및 조정
|
||||
- 쿼리 성능 분석 (pg_stat_statements)
|
||||
|
||||
### 3. 캐시 성능
|
||||
|
||||
**Redis 최적화**
|
||||
|
||||
- 적절한 TTL 설정
|
||||
- 캐시 히트율 모니터링 (목표: 95% 이상)
|
||||
- 메모리 정책: allkeys-lru
|
||||
|
||||
## 🔗 관련 문서
|
||||
|
||||
- [High-Level 아키텍처](../high-level-architecture.md)
|
||||
- [유저스토리](../../userstory.md)
|
||||
- [API 설계](../api/)
|
||||
- [데이터베이스 설계](../database/)
|
||||
|
||||
## 📝 변경 이력
|
||||
|
||||
| 날짜 | 버전 | 변경 내용 | 작성자 |
|
||||
|------|------|----------|--------|
|
||||
| 2025-10-29 | 1.0 | 최초 작성 | System Architect |
|
||||
|
||||
## ✅ 검증 체크리스트
|
||||
|
||||
- [x] 29개 subgraph와 29개 end 문 균형 확인
|
||||
- [x] 7개 마이크로서비스 반영
|
||||
- [x] Multi-Zone (3 AZs) 구성
|
||||
- [x] Private Endpoints 모든 백엔드 서비스 적용
|
||||
- [x] NSG 규칙 서브넷 간 적용
|
||||
- [x] 모니터링 및 보안 서비스 통합
|
||||
- [x] High Availability 구성 (Primary + Replica)
|
||||
- [ ] Mermaid 문법 검증 (Docker 컨테이너 필요)
|
||||
@@ -0,0 +1,360 @@
|
||||
graph TB
|
||||
%% 운영환경 네트워크 다이어그램
|
||||
%% KT AI 기반 소상공인 이벤트 자동 생성 서비스 - 운영환경
|
||||
|
||||
%% 외부 영역
|
||||
subgraph Internet["🌐 인터넷"]
|
||||
Users["👥 소상공인 사용자<br/>(1만~10만 명)"]
|
||||
CDN["🌍 Azure Front Door<br/>+ CDN Premium"]
|
||||
end
|
||||
|
||||
%% Azure 클라우드 영역
|
||||
subgraph AzureCloud["☁️ Azure Cloud (운영환경)"]
|
||||
|
||||
%% Virtual Network
|
||||
subgraph VNet["🏢 Virtual Network (VNet)<br/>주소 공간: 10.0.0.0/16"]
|
||||
|
||||
%% Gateway Subnet
|
||||
subgraph GatewaySubnet["🚪 Gateway Subnet<br/>10.0.4.0/24"]
|
||||
subgraph AppGateway["🛡️ Application Gateway v2 + WAF"]
|
||||
PublicIP["📍 Public IP<br/>(고정, Zone-redundant)"]
|
||||
PrivateIP["📍 Private IP<br/>(10.0.4.10)"]
|
||||
WAF["🛡️ WAF<br/>(OWASP CRS 3.2)"]
|
||||
RateLimiter["⏱️ Rate Limiting<br/>(200 req/min/IP)"]
|
||||
SSLTermination["🔒 SSL/TLS Termination<br/>(TLS 1.3)"]
|
||||
end
|
||||
end
|
||||
|
||||
%% Application Subnet
|
||||
subgraph AppSubnet["🎯 Application Subnet<br/>10.0.1.0/24"]
|
||||
|
||||
%% AKS 클러스터
|
||||
subgraph AKSCluster["⚙️ AKS Premium Cluster<br/>(Multi-Zone, Auto-scaling)"]
|
||||
|
||||
%% System Node Pool
|
||||
subgraph SystemNodes["🔧 System Node Pool<br/>(Standard_D4s_v3)"]
|
||||
SystemNode1["📦 System Node 1<br/>(Zone 1, AZ1)"]
|
||||
SystemNode2["📦 System Node 2<br/>(Zone 2, AZ2)"]
|
||||
SystemNode3["📦 System Node 3<br/>(Zone 3, AZ3)"]
|
||||
end
|
||||
|
||||
%% Application Node Pool
|
||||
subgraph AppNodes["🚀 Application Node Pool<br/>(Standard_D8s_v3)"]
|
||||
AppNode1["📦 App Node 1<br/>(Zone 1, AZ1)"]
|
||||
AppNode2["📦 App Node 2<br/>(Zone 2, AZ2)"]
|
||||
AppNode3["📦 App Node 3<br/>(Zone 3, AZ3)"]
|
||||
AppNode4["📦 App Node 4<br/>(Zone 1, AZ1)"]
|
||||
AppNode5["📦 App Node 5<br/>(Zone 2, AZ2)"]
|
||||
end
|
||||
|
||||
%% Application Services (High Availability)
|
||||
subgraph AppServices["🚀 Application Services"]
|
||||
UserServiceHA["👤 User Service<br/>(3 replicas, HPA 2-5)"]
|
||||
EventServiceHA["🎪 Event Service<br/>(3 replicas, HPA 2-6)"]
|
||||
AIServiceHA["🤖 AI Service<br/>(2 replicas, HPA 2-4)"]
|
||||
ContentServiceHA["📝 Content Service<br/>(2 replicas, HPA 2-4)"]
|
||||
DistributionServiceHA["📤 Distribution Service<br/>(2 replicas, HPA 2-4)"]
|
||||
ParticipationServiceHA["🎯 Participation Service<br/>(3 replicas, HPA 2-5)"]
|
||||
AnalyticsServiceHA["📊 Analytics Service<br/>(2 replicas, HPA 2-4)"]
|
||||
end
|
||||
|
||||
%% Internal Load Balancer
|
||||
subgraph InternalLB["⚖️ Internal Services<br/>(ClusterIP)"]
|
||||
UserServiceLB["user-service:8080"]
|
||||
EventServiceLB["event-service:8080"]
|
||||
AIServiceLB["ai-service:8080"]
|
||||
ContentServiceLB["content-service:8080"]
|
||||
DistributionServiceLB["distribution-service:8080"]
|
||||
ParticipationServiceLB["participation-service:8080"]
|
||||
AnalyticsServiceLB["analytics-service:8080"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%% Database Subnet
|
||||
subgraph DBSubnet["🗄️ Database Subnet<br/>10.0.2.0/24<br/>(Private, NSG Protected)"]
|
||||
subgraph UserDB["🐘 User PostgreSQL<br/>(Flexible Server)"]
|
||||
UserDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
UserDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
subgraph EventDB["🐘 Event PostgreSQL<br/>(Flexible Server)"]
|
||||
EventDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
EventDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
subgraph AIDB["🐘 AI PostgreSQL<br/>(Flexible Server)"]
|
||||
AIDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
AIDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
subgraph ContentDB["🐘 Content PostgreSQL<br/>(Flexible Server)"]
|
||||
ContentDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
ContentDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
subgraph DistributionDB["🐘 Distribution PostgreSQL<br/>(Flexible Server)"]
|
||||
DistributionDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
DistributionDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
subgraph ParticipationDB["🐘 Participation PostgreSQL<br/>(Flexible Server)"]
|
||||
ParticipationDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
ParticipationDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
subgraph AnalyticsDB["🐘 Analytics PostgreSQL<br/>(Flexible Server)"]
|
||||
AnalyticsDBPrimary["📊 Primary<br/>(Zone 1)"]
|
||||
AnalyticsDBReplica["📊 Read Replica<br/>(Zone 2)"]
|
||||
end
|
||||
|
||||
DBBackup["💾 Automated Backup<br/>(Geo-redundant, 35 days)"]
|
||||
end
|
||||
|
||||
%% Cache Subnet
|
||||
subgraph CacheSubnet["⚡ Cache Subnet<br/>10.0.3.0/24<br/>(Private, NSG Protected)"]
|
||||
subgraph AzureRedis["🔴 Azure Cache for Redis Premium<br/>(Clustered, 6GB)"]
|
||||
RedisPrimary["⚡ Primary Node<br/>(Zone 1)"]
|
||||
RedisReplica1["⚡ Replica Node 1<br/>(Zone 2)"]
|
||||
RedisReplica2["⚡ Replica Node 2<br/>(Zone 3)"]
|
||||
RedisCluster["🔗 Redis Cluster<br/>(3 shards, HA enabled)"]
|
||||
end
|
||||
end
|
||||
|
||||
%% Service Subnet
|
||||
subgraph ServiceSubnet["📨 Service Subnet<br/>10.0.5.0/24<br/>(Private, NSG Protected)"]
|
||||
subgraph ServiceBus["📨 Azure Service Bus Premium<br/>(Zone-redundant)"]
|
||||
ServiceBusNamespace["📮 Namespace<br/>(sb-kt-event-prod)"]
|
||||
|
||||
subgraph QueuesHA["📬 Premium Message Queues"]
|
||||
AIQueueHA["🤖 ai-event-generation<br/>(Partitioned, 32GB)"]
|
||||
ContentQueueHA["📝 content-generation<br/>(Partitioned, 32GB)"]
|
||||
DistributionQueueHA["📤 distribution<br/>(Partitioned, 32GB)"]
|
||||
NotificationQueueHA["🔔 notification<br/>(Partitioned, 16GB)"]
|
||||
AnalyticsQueueHA["📊 analytics<br/>(Partitioned, 16GB)"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%% Management Subnet
|
||||
subgraph MgmtSubnet["🔧 Management Subnet<br/>10.0.6.0/24<br/>(Private)"]
|
||||
subgraph Monitoring["📊 Monitoring & Logging"]
|
||||
LogAnalytics["📋 Log Analytics<br/>Workspace"]
|
||||
AppInsights["📈 Application Insights<br/>(7 instances)"]
|
||||
Prometheus["🔍 Prometheus<br/>(Managed)"]
|
||||
Grafana["📊 Grafana<br/>(Managed)"]
|
||||
end
|
||||
|
||||
subgraph Security["🔐 Security Services"]
|
||||
KeyVault["🔑 Azure Key Vault<br/>(Premium)"]
|
||||
Defender["🛡️ Azure Defender<br/>for Cloud"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%% Private Endpoints
|
||||
subgraph PrivateEndpoints["🔒 Private Endpoints<br/>(VNet Integration)"]
|
||||
DBPrivateEndpoint["🔐 PostgreSQL<br/>Private Endpoints (7)"]
|
||||
RedisPrivateEndpoint["🔐 Redis<br/>Private Endpoint"]
|
||||
ServiceBusPrivateEndpoint["🔐 Service Bus<br/>Private Endpoint"]
|
||||
KeyVaultPrivateEndpoint["🔐 Key Vault<br/>Private Endpoint"]
|
||||
end
|
||||
|
||||
%% Private DNS Zones
|
||||
subgraph PrivateDNS["🌐 Private DNS Zones"]
|
||||
PostgreSQLDNS["privatelink.postgres.database.azure.com"]
|
||||
RedisDNS["privatelink.redis.cache.windows.net"]
|
||||
ServiceBusDNS["privatelink.servicebus.windows.net"]
|
||||
KeyVaultDNS["privatelink.vaultcore.azure.net"]
|
||||
end
|
||||
end
|
||||
|
||||
%% 네트워크 연결 관계
|
||||
|
||||
%% 외부에서 Azure로의 접근
|
||||
Users -->|"HTTPS 요청<br/>(TLS 1.3)"| CDN
|
||||
CDN -->|"글로벌 가속<br/>(Anycast)"| PublicIP
|
||||
|
||||
%% Application Gateway 내부 흐름
|
||||
PublicIP --> SSLTermination
|
||||
SSLTermination --> WAF
|
||||
WAF --> RateLimiter
|
||||
RateLimiter --> PrivateIP
|
||||
|
||||
%% Application Gateway에서 AKS로 (Path-based Routing)
|
||||
PrivateIP -->|"/api/users/**<br/>NodePort 30080"| UserServiceLB
|
||||
PrivateIP -->|"/api/events/**<br/>NodePort 30081"| EventServiceLB
|
||||
PrivateIP -->|"/api/ai/**<br/>NodePort 30082"| AIServiceLB
|
||||
PrivateIP -->|"/api/contents/**<br/>NodePort 30083"| ContentServiceLB
|
||||
PrivateIP -->|"/api/distribution/**<br/>NodePort 30084"| DistributionServiceLB
|
||||
PrivateIP -->|"/api/participation/**<br/>NodePort 30085"| ParticipationServiceLB
|
||||
PrivateIP -->|"/api/analytics/**<br/>NodePort 30086"| AnalyticsServiceLB
|
||||
|
||||
%% Load Balancer에서 실제 서비스로
|
||||
UserServiceLB -->|"고가용성 라우팅"| UserServiceHA
|
||||
EventServiceLB -->|"고가용성 라우팅"| EventServiceHA
|
||||
AIServiceLB -->|"고가용성 라우팅"| AIServiceHA
|
||||
ContentServiceLB -->|"고가용성 라우팅"| ContentServiceHA
|
||||
DistributionServiceLB -->|"고가용성 라우팅"| DistributionServiceHA
|
||||
ParticipationServiceLB -->|"고가용성 라우팅"| ParticipationServiceHA
|
||||
AnalyticsServiceLB -->|"고가용성 라우팅"| AnalyticsServiceHA
|
||||
|
||||
%% 서비스 배치 (Multi-Zone Distribution)
|
||||
UserServiceHA -.->|"Pod 배치"| AppNode1
|
||||
UserServiceHA -.->|"Pod 배치"| AppNode2
|
||||
UserServiceHA -.->|"Pod 배치"| AppNode3
|
||||
|
||||
EventServiceHA -.->|"Pod 배치"| AppNode2
|
||||
EventServiceHA -.->|"Pod 배치"| AppNode3
|
||||
EventServiceHA -.->|"Pod 배치"| AppNode4
|
||||
|
||||
AIServiceHA -.->|"Pod 배치"| AppNode3
|
||||
AIServiceHA -.->|"Pod 배치"| AppNode4
|
||||
|
||||
%% Application Services에서 Database로 (Private Link)
|
||||
UserServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
EventServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
AIServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
ContentServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
DistributionServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
ParticipationServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
AnalyticsServiceHA -->|"Private Link<br/>TCP:5432"| DBPrivateEndpoint
|
||||
|
||||
%% Private Endpoint에서 실제 DB로 (서비스별 전용 DB)
|
||||
DBPrivateEndpoint --> UserDBPrimary
|
||||
DBPrivateEndpoint --> UserDBReplica
|
||||
DBPrivateEndpoint --> EventDBPrimary
|
||||
DBPrivateEndpoint --> EventDBReplica
|
||||
DBPrivateEndpoint --> AIDBPrimary
|
||||
DBPrivateEndpoint --> AIDBReplica
|
||||
DBPrivateEndpoint --> ContentDBPrimary
|
||||
DBPrivateEndpoint --> ContentDBReplica
|
||||
DBPrivateEndpoint --> DistributionDBPrimary
|
||||
DBPrivateEndpoint --> DistributionDBReplica
|
||||
DBPrivateEndpoint --> ParticipationDBPrimary
|
||||
DBPrivateEndpoint --> ParticipationDBReplica
|
||||
DBPrivateEndpoint --> AnalyticsDBPrimary
|
||||
DBPrivateEndpoint --> AnalyticsDBReplica
|
||||
|
||||
%% Application Services에서 Cache로 (Private Link)
|
||||
UserServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
EventServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
AIServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
ContentServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
DistributionServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
ParticipationServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
AnalyticsServiceHA -->|"Private Link<br/>TCP:6379"| RedisPrivateEndpoint
|
||||
|
||||
%% Private Endpoint에서 Redis로
|
||||
RedisPrivateEndpoint --> RedisPrimary
|
||||
RedisPrivateEndpoint --> RedisReplica1
|
||||
RedisPrivateEndpoint --> RedisReplica2
|
||||
|
||||
%% Redis High Availability
|
||||
RedisPrimary -.->|"HA 동기화"| RedisReplica1
|
||||
RedisPrimary -.->|"HA 동기화"| RedisReplica2
|
||||
RedisPrimary -.->|"Cluster 구성"| RedisCluster
|
||||
RedisReplica1 -.->|"Cluster 구성"| RedisCluster
|
||||
RedisReplica2 -.->|"Cluster 구성"| RedisCluster
|
||||
|
||||
%% Database High Availability
|
||||
UserDBPrimary -.->|"복제"| UserDBReplica
|
||||
EventDBPrimary -.->|"복제"| EventDBReplica
|
||||
AIDBPrimary -.->|"복제"| AIDBReplica
|
||||
ContentDBPrimary -.->|"복제"| ContentDBReplica
|
||||
DistributionDBPrimary -.->|"복제"| DistributionDBReplica
|
||||
ParticipationDBPrimary -.->|"복제"| ParticipationDBReplica
|
||||
AnalyticsDBPrimary -.->|"복제"| AnalyticsDBReplica
|
||||
|
||||
UserDBPrimary -.->|"자동 백업"| DBBackup
|
||||
EventDBPrimary -.->|"자동 백업"| DBBackup
|
||||
AIDBPrimary -.->|"자동 백업"| DBBackup
|
||||
ContentDBPrimary -.->|"자동 백업"| DBBackup
|
||||
DistributionDBPrimary -.->|"자동 백업"| DBBackup
|
||||
ParticipationDBPrimary -.->|"자동 백업"| DBBackup
|
||||
AnalyticsDBPrimary -.->|"자동 백업"| DBBackup
|
||||
|
||||
%% Service Bus 연결 (Private Link)
|
||||
AIServiceHA -->|"Private Link<br/>AMQP"| ServiceBusPrivateEndpoint
|
||||
ContentServiceHA -->|"Private Link<br/>AMQP"| ServiceBusPrivateEndpoint
|
||||
DistributionServiceHA -->|"Private Link<br/>AMQP"| ServiceBusPrivateEndpoint
|
||||
ParticipationServiceHA -->|"Private Link<br/>AMQP"| ServiceBusPrivateEndpoint
|
||||
AnalyticsServiceHA -->|"Private Link<br/>AMQP"| ServiceBusPrivateEndpoint
|
||||
|
||||
ServiceBusPrivateEndpoint --> ServiceBusNamespace
|
||||
ServiceBusNamespace --> AIQueueHA
|
||||
ServiceBusNamespace --> ContentQueueHA
|
||||
ServiceBusNamespace --> DistributionQueueHA
|
||||
ServiceBusNamespace --> NotificationQueueHA
|
||||
ServiceBusNamespace --> AnalyticsQueueHA
|
||||
|
||||
%% Service Bus Queue 간 연계
|
||||
AIQueueHA -.->|"메시지 전달"| ContentQueueHA
|
||||
ContentQueueHA -.->|"메시지 전달"| DistributionQueueHA
|
||||
DistributionQueueHA -.->|"메시지 전달"| NotificationQueueHA
|
||||
ParticipationServiceHA -.->|"통계 수집"| AnalyticsQueueHA
|
||||
|
||||
%% Monitoring 연결
|
||||
UserServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
EventServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
AIServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
ContentServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
DistributionServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
ParticipationServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
AnalyticsServiceHA -.->|"메트릭/로그"| AppInsights
|
||||
|
||||
AppInsights -.->|"집계"| LogAnalytics
|
||||
Prometheus -.->|"시각화"| Grafana
|
||||
AKSCluster -.->|"메트릭"| Prometheus
|
||||
|
||||
%% Security 연결
|
||||
UserServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
EventServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
AIServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
ContentServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
DistributionServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
ParticipationServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
AnalyticsServiceHA -->|"Private Link<br/>HTTPS"| KeyVaultPrivateEndpoint
|
||||
|
||||
KeyVaultPrivateEndpoint --> KeyVault
|
||||
Defender -.->|"보안 모니터링"| AKSCluster
|
||||
Defender -.->|"보안 모니터링"| DBSubnet
|
||||
Defender -.->|"보안 모니터링"| CacheSubnet
|
||||
|
||||
%% Private DNS Resolution
|
||||
DBPrivateEndpoint -.->|"DNS 해석"| PostgreSQLDNS
|
||||
RedisPrivateEndpoint -.->|"DNS 해석"| RedisDNS
|
||||
ServiceBusPrivateEndpoint -.->|"DNS 해석"| ServiceBusDNS
|
||||
KeyVaultPrivateEndpoint -.->|"DNS 해석"| KeyVaultDNS
|
||||
|
||||
%% NSG Rules (방화벽 규칙)
|
||||
GatewaySubnet -.->|"NSG: 443 허용"| AppSubnet
|
||||
AppSubnet -.->|"NSG: 5432 허용"| DBSubnet
|
||||
AppSubnet -.->|"NSG: 6379 허용"| CacheSubnet
|
||||
AppSubnet -.->|"NSG: 5671-5672 허용"| ServiceSubnet
|
||||
|
||||
%% 스타일 정의
|
||||
classDef azureStyle fill:#0078D4,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef k8sStyle fill:#326CE5,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef appStyle fill:#28A745,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef dbStyle fill:#DC3545,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef cacheStyle fill:#FF6B35,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef serviceStyle fill:#6610F2,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef queueStyle fill:#FD7E14,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef securityStyle fill:#E83E8C,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef haStyle fill:#20C997,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef monitoringStyle fill:#17A2B8,stroke:#fff,stroke-width:2px,color:#fff
|
||||
classDef dnsStyle fill:#6C757D,stroke:#fff,stroke-width:2px,color:#fff
|
||||
|
||||
%% 스타일 적용
|
||||
class AzureCloud,VNet azureStyle
|
||||
class AKSCluster,AppSubnet,SystemNodes,AppNodes k8sStyle
|
||||
class AppServices,UserServiceHA,EventServiceHA,AIServiceHA,ContentServiceHA,DistributionServiceHA,ParticipationServiceHA,AnalyticsServiceHA appStyle
|
||||
class DBSubnet,UserDB,EventDB,AIDB,ContentDB,DistributionDB,ParticipationDB,AnalyticsDB,UserDBPrimary,EventDBPrimary,AIDBPrimary,ContentDBPrimary,DistributionDBPrimary,ParticipationDBPrimary,AnalyticsDBPrimary,UserDBReplica,EventDBReplica,AIDBReplica,ContentDBReplica,DistributionDBReplica,ParticipationDBReplica,AnalyticsDBReplica,DBBackup dbStyle
|
||||
class CacheSubnet,AzureRedis,RedisPrimary,RedisReplica1,RedisReplica2,RedisCluster cacheStyle
|
||||
class InternalLB,UserServiceLB,EventServiceLB,AIServiceLB,ContentServiceLB,DistributionServiceLB,ParticipationServiceLB,AnalyticsServiceLB serviceStyle
|
||||
class ServiceSubnet,ServiceBus,ServiceBusNamespace,QueuesHA,AIQueueHA,ContentQueueHA,DistributionQueueHA,NotificationQueueHA,AnalyticsQueueHA queueStyle
|
||||
class AppGateway,WAF,RateLimiter,SSLTermination,PrivateEndpoints,DBPrivateEndpoint,RedisPrivateEndpoint,ServiceBusPrivateEndpoint,KeyVaultPrivateEndpoint,Security,KeyVault,Defender securityStyle
|
||||
class CDN,SystemNode1,SystemNode2,SystemNode3,AppNode1,AppNode2,AppNode3,AppNode4,AppNode5 haStyle
|
||||
class MgmtSubnet,Monitoring,LogAnalytics,AppInsights,Prometheus,Grafana monitoringStyle
|
||||
class PrivateDNS,PostgreSQLDNS,RedisDNS,ServiceBusDNS,KeyVaultDNS dnsStyle
|
||||
@@ -0,0 +1,402 @@
|
||||
# KT 이벤트 마케팅 서비스 - 개발환경 물리아키텍처 설계서
|
||||
|
||||
## 1. 개요
|
||||
|
||||
### 1.1 설계 목적
|
||||
|
||||
본 문서는 KT 이벤트 마케팅 서비스의 개발환경 물리 아키텍처를 정의합니다.
|
||||
|
||||
- **설계 범위**: 개발환경 전용 물리 인프라 설계
|
||||
- **설계 목적**:
|
||||
- 비용 효율적인 개발환경 구축
|
||||
- 빠른 배포와 테스트 지원
|
||||
- 개발팀 생산성 최적화
|
||||
- **대상 환경**: Azure 기반 개발환경 (Development)
|
||||
- **대상 시스템**: 7개 마이크로서비스 + 백킹서비스
|
||||
|
||||
### 1.2 설계 원칙
|
||||
|
||||
개발환경에 적합한 4가지 핵심 설계 원칙을 정의합니다.
|
||||
|
||||
| 원칙 | 설명 | 적용 방법 |
|
||||
|------|------|-----------|
|
||||
| **MVP 우선** | 최소 기능으로 빠른 검증 | Pod 기반 백킹서비스, 단일 인스턴스 |
|
||||
| **비용 최적화** | 개발환경 비용 최소화 | Basic 티어 서비스, 스팟 인스턴스 활용 |
|
||||
| **개발 편의성** | 개발자 접근성 최대화 | 직접 접근 가능한 네트워크, 단순한 보안 |
|
||||
| **단순성** | 복잡성 최소화 | 단일 VNet, 최소 보안 정책, 모니터링 생략 |
|
||||
|
||||
### 1.3 참조 아키텍처
|
||||
|
||||
| 아키텍처 문서 | 연관관계 | 참조 방법 |
|
||||
|---------------|----------|-----------|
|
||||
| [아키텍처 패턴](../pattern/architecture-pattern.md) | 마이크로서비스 패턴 기반 | 서비스 분리 및 통신 패턴 |
|
||||
| [논리 아키텍처](../logical/) | 논리적 컴포넌트 구조 | 물리적 배치 및 연결 관계 |
|
||||
| [데이터 설계서](../database/) | 데이터 저장소 요구사항 | PostgreSQL/Redis 구성 |
|
||||
| [HighLevel 아키텍처](../high-level-architecture.md) | 전체 시스템 구조 | CI/CD 및 백킹서비스 선정 |
|
||||
|
||||
## 2. 개발환경 아키텍처 개요
|
||||
|
||||
### 2.1 환경 특성
|
||||
|
||||
| 특성 | 개발환경 설정값 | 근거 |
|
||||
|------|----------------|------|
|
||||
| **목적** | 개발자 기능 개발 및 통합 테스트 | 빠른 피드백 루프 |
|
||||
| **사용자 규모** | 개발팀 10명 내외 | 소규모 동시 접근 |
|
||||
| **가용성 목표** | 90% (업무시간 기준) | 야간/주말 중단 허용 |
|
||||
| **확장성** | 수동 스케일링 | 예측 가능한 부하 |
|
||||
| **보안 수준** | 기본 보안 (개발자 편의성 우선) | 접근 용이성 중요 |
|
||||
| **데이터 보호** | 테스트 데이터 (실제 개인정보 없음) | 규제 요구사항 최소 |
|
||||
|
||||
### 2.2 전체 아키텍처
|
||||
|
||||
전체 시스템은 사용자 → Ingress → 마이크로서비스 → 백킹서비스 플로우로 구성됩니다.
|
||||
|
||||
- **아키텍처 다이어그램**: [physical-architecture-dev.mmd](./physical-architecture-dev.mmd)
|
||||
- **네트워크 다이어그램**: [network-dev.mmd](./network-dev.mmd)
|
||||
|
||||
**주요 컴포넌트**:
|
||||
- **Frontend**: 개발자 및 QA팀 접근
|
||||
- **Kubernetes Ingress**: NGINX 기반 라우팅
|
||||
- **7개 마이크로서비스**: user, event, content, ai, participation, analytics, distribution
|
||||
- **PostgreSQL Pod**: 통합 데이터베이스
|
||||
- **Redis Pod**: 캐시 및 세션 저장소
|
||||
- **Azure Service Bus**: 비동기 메시징 (Basic 티어)
|
||||
|
||||
## 3. 컴퓨팅 아키텍처
|
||||
|
||||
### 3.1 Kubernetes 클러스터 구성
|
||||
|
||||
#### 3.1.1 클러스터 설정
|
||||
|
||||
| 설정 항목 | 설정값 | 설명 |
|
||||
|-----------|--------|------|
|
||||
| **Kubernetes 버전** | 1.28.x | 안정된 최신 버전 |
|
||||
| **서비스 계층** | Free 티어 | 개발환경 비용 절약 |
|
||||
| **네트워크 플러그인** | Azure CNI | Azure 네이티브 통합 |
|
||||
| **DNS** | CoreDNS | 기본 DNS 서비스 |
|
||||
| **RBAC** | 활성화 | 기본 보안 설정 |
|
||||
| **Pod Security** | 기본 설정 | 개발 편의성 우선 |
|
||||
| **Ingress Controller** | NGINX | 단순하고 가벼운 설정 |
|
||||
|
||||
#### 3.1.2 노드 풀 구성
|
||||
|
||||
| 노드 풀 | 인스턴스 크기 | 노드 수 | 스케일링 | 가용영역 | 가격 정책 |
|
||||
|---------|---------------|---------|----------|----------|----------|
|
||||
| **Default** | Standard_B2s | 2-4 노드 | 수동 | Single Zone | 스팟 인스턴스 50% |
|
||||
| **사양** | 2 vCPU, 4GB RAM | 최소 2, 최대 4 | kubectl 수동 확장 | Korea Central | 비용 우선 |
|
||||
|
||||
### 3.2 서비스별 리소스 할당
|
||||
|
||||
#### 3.2.1 애플리케이션 서비스
|
||||
|
||||
| 서비스명 | CPU Requests | CPU Limits | Memory Requests | Memory Limits | Replicas |
|
||||
|----------|--------------|------------|-----------------|---------------|----------|
|
||||
| **user-service** | 100m | 200m | 128Mi | 256Mi | 1 |
|
||||
| **event-service** | 100m | 200m | 128Mi | 256Mi | 1 |
|
||||
| **content-service** | 100m | 200m | 128Mi | 256Mi | 1 |
|
||||
| **ai-service** | 100m | 300m | 256Mi | 512Mi | 1 |
|
||||
| **participation-service** | 100m | 200m | 128Mi | 256Mi | 1 |
|
||||
| **analytics-service** | 100m | 200m | 128Mi | 256Mi | 1 |
|
||||
| **distribution-service** | 100m | 200m | 128Mi | 256Mi | 1 |
|
||||
|
||||
#### 3.2.2 백킹 서비스
|
||||
|
||||
| 서비스명 | CPU Requests | CPU Limits | Memory Requests | Memory Limits | Storage |
|
||||
|----------|--------------|------------|-----------------|---------------|---------|
|
||||
| **postgresql** | 200m | 500m | 512Mi | 1Gi | 20Gi (Premium SSD) |
|
||||
| **redis** | 100m | 200m | 128Mi | 256Mi | 1Gi (메모리 기반) |
|
||||
|
||||
#### 3.2.3 스토리지 클래스 구성
|
||||
|
||||
| 스토리지 클래스 | 종류 | 성능 | 용도 | 비용 |
|
||||
|----------------|------|------|------|------|
|
||||
| **managed-premium** | Azure Premium SSD | 최대 5,000 IOPS | PostgreSQL 데이터 | 중간 |
|
||||
| **managed** | Azure Standard SSD | 최대 2,000 IOPS | 로그 및 임시 데이터 | 저비용 |
|
||||
|
||||
## 4. 네트워크 아키텍처
|
||||
|
||||
### 4.1 네트워크 구성
|
||||
|
||||
#### 4.1.1 네트워크 토폴로지
|
||||
|
||||
**네트워크 구성**:
|
||||
- **VNet 주소 공간**: 10.0.0.0/16
|
||||
- **AKS 서브넷**: 10.0.1.0/24 (사용자, 서비스, 백킹서비스 통합)
|
||||
- **Service Bus 서브넷**: 10.0.2.0/24 (Azure Service Bus Basic)
|
||||
|
||||
**네트워크 다이어그램**: [network-dev.mmd](./network-dev.mmd)
|
||||
|
||||
#### 4.1.2 네트워크 보안
|
||||
|
||||
| 정책 유형 | 설정 | 설명 |
|
||||
|-----------|------|------|
|
||||
| **Network Policy** | 기본 허용 | 개발 편의성 우선 |
|
||||
| **접근 제한** | 개발팀 IP 대역만 허용 | 기본 보안 유지 |
|
||||
| **포트 정책** | 표준 HTTP/HTTPS 포트 | 80, 443, 8080-8087 |
|
||||
|
||||
### 4.2 서비스 디스커버리
|
||||
|
||||
| 서비스명 | 내부 DNS 주소 | 포트 | 용도 |
|
||||
|----------|---------------|------|------|
|
||||
| **user-service** | user-service:8080 | 8080 | 사용자 관리 API |
|
||||
| **event-service** | event-service:8080 | 8080 | 이벤트 관리 API |
|
||||
| **content-service** | content-service:8080 | 8080 | 콘텐츠 관리 API |
|
||||
| **ai-service** | ai-service:8080 | 8080 | AI 추천 API |
|
||||
| **participation-service** | participation-service:8080 | 8080 | 참여 관리 API |
|
||||
| **analytics-service** | analytics-service:8080 | 8080 | 분석 API |
|
||||
| **distribution-service** | distribution-service:8080 | 8080 | 배포 관리 API |
|
||||
| **postgresql** | postgresql:5432 | 5432 | 주 데이터베이스 |
|
||||
| **redis** | redis:6379 | 6379 | 캐시 및 세션 |
|
||||
|
||||
## 5. 데이터 아키텍처
|
||||
|
||||
### 5.1 데이터베이스 구성
|
||||
|
||||
#### 5.1.1 주 데이터베이스 Pod 구성
|
||||
|
||||
| 설정 항목 | 설정값 | 설명 |
|
||||
|-----------|--------|------|
|
||||
| **컨테이너 이미지** | postgres:15-alpine | 경량화된 PostgreSQL |
|
||||
| **CPU** | 200m requests, 500m limits | 개발환경 적정 사양 |
|
||||
| **Memory** | 512Mi requests, 1Gi limits | 기본 워크로드 처리 |
|
||||
| **Storage** | 20Gi Premium SSD | Azure Disk 연동 |
|
||||
| **백업** | 수동 스냅샷 | 주간 단위 수동 백업 |
|
||||
| **HA 구성** | 단일 인스턴스 | 비용 최적화 |
|
||||
|
||||
#### 5.1.2 캐시 Pod 구성
|
||||
|
||||
| 설정 항목 | 설정값 | 설명 |
|
||||
|-----------|--------|------|
|
||||
| **컨테이너 이미지** | redis:7-alpine | 경량화된 Redis |
|
||||
| **CPU** | 100m requests, 200m limits | 가벼운 캐시 워크로드 |
|
||||
| **Memory** | 128Mi requests, 256Mi limits | 기본 캐시 용량 |
|
||||
| **Storage** | 1Gi (선택적) | 영구 저장이 필요한 경우만 |
|
||||
| **설정** | Default 설정 | 특별한 튜닝 없음 |
|
||||
|
||||
### 5.2 데이터 관리 전략
|
||||
|
||||
#### 5.2.1 데이터 초기화
|
||||
|
||||
```yaml
|
||||
# 데이터 초기화 Job 예시
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: db-init-job
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: db-init
|
||||
image: postgres:15-alpine
|
||||
command: ["/bin/sh"]
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
psql -h postgresql -U postgres -d kt_event_marketing << EOF
|
||||
-- 테스트 데이터 생성
|
||||
INSERT INTO users (username, email) VALUES ('test_user', 'test@example.com');
|
||||
INSERT INTO stores (name, address) VALUES ('테스트 매장', '서울시 강남구');
|
||||
EOF
|
||||
restartPolicy: OnFailure
|
||||
```
|
||||
|
||||
**실행 절차**:
|
||||
1. `kubectl apply -f db-init-job.yaml`
|
||||
2. `kubectl logs job/db-init-job` 실행 결과 확인
|
||||
3. `kubectl delete job db-init-job` 정리
|
||||
|
||||
#### 5.2.2 백업 전략
|
||||
|
||||
| 서비스 | 백업 방법 | 주기 | 보존 기간 | 복구 절차 |
|
||||
|--------|-----------|------|-----------|-----------|
|
||||
| **PostgreSQL** | Azure Disk 스냅샷 | 주 1회 (금요일) | 4주 | 스냅샷 복원 |
|
||||
| **Redis** | RDB 덤프 | 일 1회 | 1주 | 덤프 파일 복원 |
|
||||
|
||||
## 6. 메시징 아키텍처
|
||||
|
||||
### 6.1 Message Queue 구성
|
||||
|
||||
#### 6.1.1 Basic Tier 설정
|
||||
|
||||
| 설정 항목 | 설정값 | 설명 |
|
||||
|-----------|--------|------|
|
||||
| **서비스** | Azure Service Bus Basic | 개발환경 최소 비용 |
|
||||
| **네임스페이스** | kt-event-dev | 개발 전용 네임스페이스 |
|
||||
| **큐 개수** | 3개 | ai-schedule, location-search, notification |
|
||||
| **메시지 크기** | 최대 256KB | Basic 티어 제한 |
|
||||
| **TTL** | 14일 | 기본 설정 |
|
||||
|
||||
#### 6.1.2 연결 설정
|
||||
|
||||
| 설정 항목 | 설정값 | 설명 |
|
||||
|-----------|--------|------|
|
||||
| **인증** | Connection String | 개발환경 단순 인증 |
|
||||
| **연결 풀** | 기본 설정 | 특별한 튜닝 없음 |
|
||||
| **재시도 정책** | 3회 재시도 | 기본 resilience |
|
||||
| **배치 처리** | 비활성화 | 단순한 메시지 처리 |
|
||||
|
||||
## 7. 보안 아키텍처
|
||||
|
||||
### 7.1 개발환경 보안 정책
|
||||
|
||||
#### 7.1.1 기본 보안 설정
|
||||
|
||||
| 보안 계층 | 설정값 | 수준 | 관리 대상 시크릿 |
|
||||
|-----------|--------|------|-----------------|
|
||||
| **네트워크** | 기본 NSG | 기본 | - |
|
||||
| **클러스터** | RBAC 활성화 | 기본 | ServiceAccount 토큰 |
|
||||
| **애플리케이션** | 기본 설정 | 기본 | DB 연결 정보 |
|
||||
| **데이터** | 전송 암호화만 | 기본 | Redis 비밀번호 |
|
||||
|
||||
#### 7.1.2 시크릿 관리
|
||||
|
||||
| 시크릿 유형 | 저장 방식 | 순환 정책 | 저장소 |
|
||||
|-------------|-----------|-----------|--------|
|
||||
| **DB 비밀번호** | Kubernetes Secret | 수동 | etcd |
|
||||
| **API 키** | Kubernetes Secret | 월 1회 | etcd |
|
||||
| **Service Bus** | Connection String | 수동 | etcd |
|
||||
|
||||
### 7.2 Network Policies
|
||||
|
||||
#### 7.2.1 기본 정책
|
||||
|
||||
```yaml
|
||||
# 기본적으로 모든 통신 허용 (개발 편의성)
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-all-dev
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
- {}
|
||||
egress:
|
||||
- {}
|
||||
```
|
||||
|
||||
## 8. 모니터링 및 로깅
|
||||
|
||||
### 8.1 기본 모니터링
|
||||
|
||||
#### 8.1.1 Kubernetes 기본 모니터링
|
||||
|
||||
| 컴포넌트 | 설정 | 임계값 |
|
||||
|----------|------|--------|
|
||||
| **kubectl top** | 기본 메트릭 | CPU 80%, Memory 80% |
|
||||
| **기본 알림** | 비활성화 | 개발환경 알림 불필요 |
|
||||
|
||||
#### 8.1.2 애플리케이션 모니터링
|
||||
|
||||
| 메트릭 유형 | 수집 방법 | 설정 |
|
||||
|-------------|-----------|------|
|
||||
| **헬스체크** | Spring Actuator | /actuator/health |
|
||||
| **메트릭** | 기본 로그 | stdout 로그만 |
|
||||
|
||||
### 8.2 로깅
|
||||
|
||||
#### 8.2.1 로그 수집
|
||||
|
||||
| 로그 유형 | 수집 방식 | 저장 방식 | 보존 기간 | 로그 레벨 |
|
||||
|-----------|-----------|-----------|-----------|-----------|
|
||||
| **애플리케이션** | stdout | kubectl logs | 7일 | DEBUG |
|
||||
| **시스템** | kubelet | 로컬 | 3일 | INFO |
|
||||
|
||||
## 9. 배포 관련 컴포넌트
|
||||
|
||||
| 컴포넌트 | 역할 | 설정 |
|
||||
|----------|------|------|
|
||||
| **GitHub Actions** | CI/CD 파이프라인 | 기본 워크플로우 |
|
||||
| **Docker Registry** | 컨테이너 이미지 저장소 | Azure Container Registry |
|
||||
| **kubectl** | 배포 도구 | 수동 배포 |
|
||||
| **IntelliJ 프로파일** | 로컬 개발 | 서비스별 실행 프로파일 |
|
||||
|
||||
## 10. 비용 최적화
|
||||
|
||||
### 10.1 개발환경 비용 구조
|
||||
|
||||
#### 10.1.1 주요 비용 요소
|
||||
|
||||
| 구성요소 | 사양 | 월간 예상 비용 (USD) | 절약 방안 |
|
||||
|----------|------|---------------------|-----------|
|
||||
| **AKS 클러스터** | Free 티어 | $0 | Free 티어 활용 |
|
||||
| **VM 노드** | 2 x Standard_B2s (스팟 50%) | $50 | 스팟 인스턴스 활용 |
|
||||
| **Storage** | 50Gi Premium SSD | $10 | 최소 필요 용량만 |
|
||||
| **Service Bus** | Basic 티어 | $5 | Basic 티어 사용 |
|
||||
| **네트워크** | Standard Load Balancer | $15 | 기본 설정 |
|
||||
| **총 예상 비용** | - | **$80** | - |
|
||||
|
||||
#### 10.1.2 비용 절약 전략
|
||||
|
||||
| 영역 | 절약 방안 | 절약률 |
|
||||
|------|-----------|--------|
|
||||
| **컴퓨팅** | 스팟 인스턴스 50% 혼합 | 25% |
|
||||
| **스토리지** | 최소 필요 용량만 할당 | 30% |
|
||||
| **네트워킹** | 단일 VNet 구성 | 20% |
|
||||
|
||||
## 11. 개발환경 운영 가이드
|
||||
|
||||
### 11.1 일상 운영
|
||||
|
||||
#### 11.1.1 환경 시작/종료
|
||||
|
||||
```bash
|
||||
# 클러스터 시작 (매일 오전)
|
||||
az aks start --resource-group kt-event-dev --name kt-event-aks-dev
|
||||
|
||||
# 서비스 상태 확인
|
||||
kubectl get pods -A
|
||||
kubectl get svc
|
||||
|
||||
# 클러스터 종료 (매일 저녁)
|
||||
az aks stop --resource-group kt-event-dev --name kt-event-aks-dev
|
||||
```
|
||||
|
||||
#### 11.1.2 데이터 관리
|
||||
|
||||
```bash
|
||||
# PostgreSQL 데이터 백업
|
||||
kubectl exec -it postgresql-0 -- pg_dump -U postgres kt_event_marketing > backup.sql
|
||||
|
||||
# Redis 데이터 백업
|
||||
kubectl exec -it redis-0 -- redis-cli --rdb dump.rdb
|
||||
|
||||
# 데이터 복원
|
||||
kubectl exec -i postgresql-0 -- psql -U postgres -d kt_event_marketing < backup.sql
|
||||
```
|
||||
|
||||
### 11.2 트러블슈팅
|
||||
|
||||
#### 11.2.1 일반적인 문제 해결
|
||||
|
||||
| 문제 유형 | 원인 | 해결방안 | 예방법 |
|
||||
|-----------|------|----------|--------|
|
||||
| **Pod 시작 실패** | 리소스 부족 | 노드 스케일 업 | 리소스 모니터링 |
|
||||
| **DB 연결 실패** | 네트워크 정책 | Service 확인 | 헬스체크 활성화 |
|
||||
| **Service Bus 연결 오류** | 인증 정보 | Secret 재생성 | 정기 키 순환 |
|
||||
|
||||
## 12. 개발환경 특성 요약
|
||||
|
||||
**핵심 설계 원칙**:
|
||||
- **비용 우선**: 개발환경은 최소 비용으로 구성하여 월 $80 이하 목표
|
||||
- **단순성**: 복잡한 HA 구성 없이 단순한 아키텍처 유지
|
||||
- **개발 편의성**: 개발자가 쉽게 접근하고 디버깅할 수 있는 환경
|
||||
|
||||
**주요 제약사항**:
|
||||
- **가용성**: 90% (업무시간 기준), 야간/주말 중단 허용
|
||||
- **확장성**: 수동 스케일링으로 예측 가능한 부하만 처리
|
||||
- **보안**: 기본 보안 설정으로 개발 편의성 우선
|
||||
|
||||
**최적화 목표**:
|
||||
- **빠른 배포**: 5분 이내 전체 환경 배포 완료
|
||||
- **비용 효율**: 월 $80 이하 운영 비용 유지
|
||||
- **개발 생산성**: 로컬 개발과 유사한 편의성 제공
|
||||
|
||||
---
|
||||
|
||||
**문서 버전**: v1.0
|
||||
**최종 수정일**: 2025-10-29
|
||||
**작성자**: System Architect (박영자 "전문 아키텍트")
|
||||
@@ -0,0 +1,61 @@
|
||||
graph TB
|
||||
%% Development Environment Physical Architecture
|
||||
%% Core Flow: Users → Ingress → Services → Database
|
||||
|
||||
Users[Mobile/Web Users] --> Ingress[Kubernetes Ingress Controller]
|
||||
|
||||
subgraph "Azure Kubernetes Service - Development"
|
||||
Ingress --> UserService[User Service Pod]
|
||||
Ingress --> EventService[Event Service Pod]
|
||||
Ingress --> ContentService[Content Service Pod]
|
||||
Ingress --> AIService[AI Service Pod]
|
||||
Ingress --> ParticipationService[Participation Service Pod]
|
||||
Ingress --> AnalyticsService[Analytics Service Pod]
|
||||
Ingress --> DistributionService[Distribution Service Pod]
|
||||
|
||||
UserService --> PostgreSQL[PostgreSQL Pod<br/>All Services DB<br/>20GB Storage]
|
||||
EventService --> PostgreSQL
|
||||
ContentService --> PostgreSQL
|
||||
AIService --> PostgreSQL
|
||||
ParticipationService --> PostgreSQL
|
||||
AnalyticsService --> PostgreSQL
|
||||
DistributionService --> PostgreSQL
|
||||
|
||||
UserService --> Redis[Redis Pod<br/>Cache & Session]
|
||||
EventService --> Redis
|
||||
ContentService --> Redis
|
||||
AIService --> Redis
|
||||
ParticipationService --> Redis
|
||||
AnalyticsService --> Redis
|
||||
DistributionService --> Redis
|
||||
|
||||
EventService --> ServiceBus[Azure Service Bus<br/>Basic Tier]
|
||||
AIService --> ServiceBus
|
||||
ContentService --> ServiceBus
|
||||
DistributionService --> ServiceBus
|
||||
AnalyticsService --> ServiceBus
|
||||
end
|
||||
|
||||
%% External APIs
|
||||
ExternalAPI[External APIs<br/>OpenAI, Image Gen, SNS] --> AIService
|
||||
ExternalAPI --> ContentService
|
||||
ExternalAPI --> DistributionService
|
||||
|
||||
%% Essential Azure Services
|
||||
AKS --> ContainerRegistry[Azure Container Registry]
|
||||
|
||||
%% Node Configuration
|
||||
subgraph "Node Pool"
|
||||
NodePool[2x Standard B2s<br/>2 vCPU, 4GB RAM]
|
||||
end
|
||||
|
||||
%% Styling
|
||||
classDef azureService fill:#0078d4,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef microservice fill:#ff6b6b,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef database fill:#4ecdc4,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef external fill:#95e1d3,stroke:#333,stroke-width:2px,color:#333
|
||||
|
||||
class Ingress,ServiceBus,ContainerRegistry azureService
|
||||
class UserService,EventService,ContentService,AIService,ParticipationService,AnalyticsService,DistributionService microservice
|
||||
class PostgreSQL,Redis database
|
||||
class Users,ExternalAPI external
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,267 @@
|
||||
graph TB
|
||||
%% Production Environment Physical Architecture
|
||||
%% KT Event Marketing Service - Azure Cloud Enterprise Architecture
|
||||
|
||||
Users[Mobile/Web Users<br/>초기 100명, 확장 10만명] --> CDN[Azure Front Door<br/>+ CDN]
|
||||
|
||||
subgraph "Azure Cloud - Production Environment"
|
||||
CDN --> AppGateway[Application Gateway<br/>+ WAF v2<br/>Zone Redundant]
|
||||
|
||||
subgraph "VNet (10.0.0.0/16)"
|
||||
subgraph "Gateway Subnet (10.0.5.0/24)"
|
||||
AppGateway
|
||||
end
|
||||
|
||||
subgraph "Application Subnet (10.0.1.0/24)"
|
||||
subgraph "AKS Premium Cluster - Multi-Zone"
|
||||
direction TB
|
||||
|
||||
subgraph "System Node Pool"
|
||||
SystemNode1[System Node 1<br/>Zone 1<br/>D2s_v3]
|
||||
SystemNode2[System Node 2<br/>Zone 2<br/>D2s_v3]
|
||||
SystemNode3[System Node 3<br/>Zone 3<br/>D2s_v3]
|
||||
end
|
||||
|
||||
subgraph "Application Node Pool"
|
||||
AppNode1[App Node 1<br/>Zone 1<br/>D4s_v3]
|
||||
AppNode2[App Node 2<br/>Zone 2<br/>D4s_v3]
|
||||
AppNode3[App Node 3<br/>Zone 3<br/>D4s_v3]
|
||||
end
|
||||
|
||||
subgraph "Application Services - 7 Microservices"
|
||||
UserService[User Service<br/>Layered Arch<br/>3 replicas, HPA 2-10]
|
||||
EventService[Event Service<br/>Clean Arch<br/>3 replicas, HPA 3-15]
|
||||
AIService[AI Service<br/>Clean Arch<br/>2 replicas, HPA 2-8]
|
||||
ContentService[Content Service<br/>Clean Arch<br/>2 replicas, HPA 2-8]
|
||||
DistService[Distribution Service<br/>Layered Arch<br/>2 replicas, HPA 2-10]
|
||||
PartService[Participation Service<br/>Layered Arch<br/>2 replicas, HPA 2-8]
|
||||
AnalService[Analytics Service<br/>Layered Arch<br/>2 replicas, HPA 2-10]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
AppGateway -->|NodePort 30080-30086| UserService
|
||||
AppGateway -->|NodePort 30080-30086| EventService
|
||||
AppGateway -->|NodePort 30080-30086| AIService
|
||||
AppGateway -->|NodePort 30080-30086| ContentService
|
||||
AppGateway -->|NodePort 30080-30086| DistService
|
||||
AppGateway -->|NodePort 30080-30086| PartService
|
||||
AppGateway -->|NodePort 30080-30086| AnalService
|
||||
|
||||
subgraph "Database Subnet (10.0.2.0/24)"
|
||||
subgraph "Per-Service Databases"
|
||||
UserDB[User PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D2s_v3]
|
||||
EventDB[Event PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D4s_v3]
|
||||
AIDB[AI PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D2s_v3]
|
||||
ContentDB[Content PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D2s_v3]
|
||||
DistDB[Distribution PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D2s_v3]
|
||||
PartDB[Participation PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D2s_v3]
|
||||
AnalDB[Analytics PostgreSQL<br/>Flexible Server<br/>Primary - Zone 1<br/>GP_Standard_D4s_v3]
|
||||
end
|
||||
|
||||
subgraph "Database HA"
|
||||
UserReplica[User DB Replica<br/>Zone 2]
|
||||
EventReplica[Event DB Replica<br/>Zone 2]
|
||||
AnalReplica[Analytics DB Replica<br/>Zone 2]
|
||||
AutoBackup[Automated Backup<br/>Point-in-time Recovery<br/>35 days retention]
|
||||
end
|
||||
end
|
||||
|
||||
subgraph "Cache Subnet (10.0.3.0/24)"
|
||||
RedisPrimary[Azure Redis Premium<br/>P2 - 6GB<br/>Primary - Zone 1<br/>AI결과/이미지/사업자검증 캐시]
|
||||
RedisSecondary[Redis Secondary<br/>Zone 2<br/>HA Enabled]
|
||||
end
|
||||
end
|
||||
|
||||
subgraph "Service Bus Premium"
|
||||
ServiceBusPremium[Azure Service Bus<br/>Premium Tier<br/>sb-kt-event-prod]
|
||||
|
||||
subgraph "Message Queues"
|
||||
AIQueue[ai-event-generation<br/>Partitioned, 16GB<br/>비동기 AI 처리]
|
||||
ContentQueue[content-generation<br/>Partitioned, 16GB<br/>비동기 이미지 생성]
|
||||
DistQueue[distribution-jobs<br/>Partitioned, 16GB<br/>다중 채널 배포]
|
||||
AnalQueue[analytics-aggregation<br/>Partitioned, 8GB<br/>실시간 분석]
|
||||
end
|
||||
end
|
||||
|
||||
subgraph "Private Endpoints"
|
||||
UserDBEndpoint[User DB<br/>Private Endpoint<br/>10.0.2.10]
|
||||
EventDBEndpoint[Event DB<br/>Private Endpoint<br/>10.0.2.11]
|
||||
AIDBEndpoint[AI DB<br/>Private Endpoint<br/>10.0.2.12]
|
||||
ContentDBEndpoint[Content DB<br/>Private Endpoint<br/>10.0.2.13]
|
||||
DistDBEndpoint[Distribution DB<br/>Private Endpoint<br/>10.0.2.14]
|
||||
PartDBEndpoint[Participation DB<br/>Private Endpoint<br/>10.0.2.15]
|
||||
AnalDBEndpoint[Analytics DB<br/>Private Endpoint<br/>10.0.2.16]
|
||||
RedisEndpoint[Redis<br/>Private Endpoint<br/>10.0.3.10]
|
||||
ServiceBusEndpoint[Service Bus<br/>Private Endpoint<br/>10.0.4.10]
|
||||
KeyVaultEndpoint[Key Vault<br/>Private Endpoint<br/>10.0.6.10]
|
||||
end
|
||||
|
||||
subgraph "Security & Management"
|
||||
KeyVault[Azure Key Vault<br/>Premium<br/>HSM-backed<br/>시크릿 관리]
|
||||
AAD[Azure Active Directory<br/>RBAC Integration]
|
||||
Monitor[Azure Monitor<br/>+ Application Insights<br/>Log Analytics]
|
||||
end
|
||||
|
||||
%% Database Private Link Connections
|
||||
UserService -->|Private Link| UserDBEndpoint
|
||||
EventService -->|Private Link| EventDBEndpoint
|
||||
AIService -->|Private Link| AIDBEndpoint
|
||||
ContentService -->|Private Link| ContentDBEndpoint
|
||||
DistService -->|Private Link| DistDBEndpoint
|
||||
PartService -->|Private Link| PartDBEndpoint
|
||||
AnalService -->|Private Link| AnalDBEndpoint
|
||||
|
||||
UserDBEndpoint --> UserDB
|
||||
EventDBEndpoint --> EventDB
|
||||
AIDBEndpoint --> AIDB
|
||||
ContentDBEndpoint --> ContentDB
|
||||
DistDBEndpoint --> DistDB
|
||||
PartDBEndpoint --> PartDB
|
||||
AnalDBEndpoint --> AnalDB
|
||||
|
||||
%% Cache Private Link Connections - Cache-Aside Pattern
|
||||
UserService -->|Private Link<br/>Cache-Aside| RedisEndpoint
|
||||
AIService -->|Private Link<br/>Cache-Aside<br/>24h TTL| RedisEndpoint
|
||||
ContentService -->|Private Link<br/>Cache-Aside<br/>이미지 캐싱| RedisEndpoint
|
||||
AnalService -->|Private Link<br/>Cache-Aside<br/>5분 간격| RedisEndpoint
|
||||
|
||||
RedisEndpoint --> RedisPrimary
|
||||
RedisEndpoint --> RedisSecondary
|
||||
|
||||
%% Service Bus Private Link Connections - Async Request-Reply Pattern
|
||||
AIService -->|Private Link<br/>Async Request-Reply| ServiceBusEndpoint
|
||||
ContentService -->|Private Link<br/>Async Request-Reply| ServiceBusEndpoint
|
||||
DistService -->|Private Link<br/>7개 채널 배포| ServiceBusEndpoint
|
||||
AnalService -->|Private Link<br/>실시간 분석| ServiceBusEndpoint
|
||||
|
||||
ServiceBusEndpoint --> ServiceBusPremium
|
||||
ServiceBusPremium --> AIQueue
|
||||
ServiceBusPremium --> ContentQueue
|
||||
ServiceBusPremium --> DistQueue
|
||||
ServiceBusPremium --> AnalQueue
|
||||
|
||||
%% High Availability Connections
|
||||
UserDB -.->|Replication| UserReplica
|
||||
EventDB -.->|Replication| EventReplica
|
||||
AnalDB -.->|Replication| AnalReplica
|
||||
UserDB -.->|Auto Backup| AutoBackup
|
||||
EventDB -.->|Auto Backup| AutoBackup
|
||||
AIDB -.->|Auto Backup| AutoBackup
|
||||
ContentDB -.->|Auto Backup| AutoBackup
|
||||
DistDB -.->|Auto Backup| AutoBackup
|
||||
PartDB -.->|Auto Backup| AutoBackup
|
||||
AnalDB -.->|Auto Backup| AutoBackup
|
||||
RedisPrimary -.->|HA Sync| RedisSecondary
|
||||
|
||||
%% Security Connections - Managed Identity
|
||||
UserService -.->|Managed Identity| KeyVaultEndpoint
|
||||
EventService -.->|Managed Identity| KeyVaultEndpoint
|
||||
AIService -.->|Managed Identity| KeyVaultEndpoint
|
||||
ContentService -.->|Managed Identity| KeyVaultEndpoint
|
||||
DistService -.->|Managed Identity| KeyVaultEndpoint
|
||||
PartService -.->|Managed Identity| KeyVaultEndpoint
|
||||
AnalService -.->|Managed Identity| KeyVaultEndpoint
|
||||
|
||||
KeyVaultEndpoint --> KeyVault
|
||||
|
||||
UserService -.->|RBAC| AAD
|
||||
EventService -.->|RBAC| AAD
|
||||
AIService -.->|RBAC| AAD
|
||||
ContentService -.->|RBAC| AAD
|
||||
DistService -.->|RBAC| AAD
|
||||
PartService -.->|RBAC| AAD
|
||||
AnalService -.->|RBAC| AAD
|
||||
|
||||
%% Monitoring Connections
|
||||
UserService -.->|Telemetry| Monitor
|
||||
EventService -.->|Telemetry| Monitor
|
||||
AIService -.->|Telemetry| Monitor
|
||||
ContentService -.->|Telemetry| Monitor
|
||||
DistService -.->|Telemetry| Monitor
|
||||
PartService -.->|Telemetry| Monitor
|
||||
AnalService -.->|Telemetry| Monitor
|
||||
end
|
||||
|
||||
%% External Integrations - Circuit Breaker Pattern
|
||||
subgraph "External Services - Circuit Breaker 적용"
|
||||
TaxAPI[국세청 API<br/>사업자번호 검증]
|
||||
ClaudeAPI[Claude API<br/>트렌드 분석 및 추천]
|
||||
SDAPI[Stable Diffusion<br/>SNS 이미지 생성]
|
||||
UriAPI[우리동네TV API<br/>영상 송출]
|
||||
RingoAPI[링고비즈 API<br/>연결음]
|
||||
GenieAPI[지니TV API<br/>광고 등록]
|
||||
InstagramAPI[Instagram API<br/>SNS 포스팅]
|
||||
NaverAPI[Naver Blog API<br/>블로그 포스팅]
|
||||
KakaoAPI[Kakao API<br/>채널 포스팅]
|
||||
end
|
||||
|
||||
%% External API Connections with Circuit Breaker
|
||||
UserService -->|Circuit Breaker<br/>실패율 5% 임계값| TaxAPI
|
||||
AIService -->|Circuit Breaker<br/>10초 타임아웃| ClaudeAPI
|
||||
ContentService -->|Circuit Breaker<br/>5초 타임아웃| SDAPI
|
||||
DistService -->|Circuit Breaker<br/>독립 채널 처리| UriAPI
|
||||
DistService -->|Circuit Breaker<br/>독립 채널 처리| RingoAPI
|
||||
DistService -->|Circuit Breaker<br/>독립 채널 처리| GenieAPI
|
||||
DistService -->|Circuit Breaker<br/>독립 채널 처리| InstagramAPI
|
||||
DistService -->|Circuit Breaker<br/>독립 채널 처리| NaverAPI
|
||||
DistService -->|Circuit Breaker<br/>독립 채널 처리| KakaoAPI
|
||||
|
||||
%% DevOps & CI/CD
|
||||
subgraph "DevOps Infrastructure"
|
||||
GitHubActions[GitHub Actions<br/>Enterprise CI/CD]
|
||||
ArgoCD[ArgoCD<br/>GitOps Deployment<br/>HA Mode]
|
||||
ContainerRegistry[Azure Container Registry<br/>Premium Tier<br/>Geo-replicated]
|
||||
end
|
||||
|
||||
%% DevOps Connections
|
||||
GitHubActions -->|Build & Push| ContainerRegistry
|
||||
ArgoCD -->|Deploy| UserService
|
||||
ArgoCD -->|Deploy| EventService
|
||||
ArgoCD -->|Deploy| AIService
|
||||
ArgoCD -->|Deploy| ContentService
|
||||
ArgoCD -->|Deploy| DistService
|
||||
ArgoCD -->|Deploy| PartService
|
||||
ArgoCD -->|Deploy| AnalService
|
||||
|
||||
%% Backup & DR
|
||||
subgraph "Backup & Disaster Recovery"
|
||||
BackupVault[Azure Backup Vault<br/>GRS - 99.999999999%]
|
||||
DRSite[DR Site<br/>Secondary Region<br/>Korea Central]
|
||||
end
|
||||
|
||||
UserDB -.->|Automated Backup| BackupVault
|
||||
EventDB -.->|Automated Backup| BackupVault
|
||||
AIDB -.->|Automated Backup| BackupVault
|
||||
ContentDB -.->|Automated Backup| BackupVault
|
||||
DistDB -.->|Automated Backup| BackupVault
|
||||
PartDB -.->|Automated Backup| BackupVault
|
||||
AnalDB -.->|Automated Backup| BackupVault
|
||||
RedisPrimary -.->|Data Persistence| BackupVault
|
||||
ContainerRegistry -.->|Image Backup| BackupVault
|
||||
BackupVault -.->|Geo-replication| DRSite
|
||||
|
||||
%% Styling
|
||||
classDef azureService fill:#0078d4,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef microservice fill:#28a745,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef database fill:#dc3545,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef cache fill:#ff6b6b,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef security fill:#ffc107,stroke:#333,stroke-width:2px,color:#333
|
||||
classDef external fill:#17a2b8,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef devops fill:#6f42c1,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef backup fill:#e83e8c,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef privateEndpoint fill:#fd7e14,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef nodePool fill:#20c997,stroke:#333,stroke-width:2px,color:#fff
|
||||
classDef queue fill:#f8b500,stroke:#333,stroke-width:2px,color:#333
|
||||
|
||||
class CDN,AppGateway,ServiceBusPremium,ContainerRegistry,Monitor,AAD azureService
|
||||
class UserService,EventService,AIService,ContentService,DistService,PartService,AnalService microservice
|
||||
class UserDB,EventDB,AIDB,ContentDB,DistDB,PartDB,AnalDB,UserReplica,EventReplica,AnalReplica,AutoBackup database
|
||||
class RedisPrimary,RedisSecondary cache
|
||||
class KeyVault,KeyVaultEndpoint security
|
||||
class Users,TaxAPI,ClaudeAPI,SDAPI,UriAPI,RingoAPI,GenieAPI,InstagramAPI,NaverAPI,KakaoAPI external
|
||||
class GitHubActions,ArgoCD devops
|
||||
class BackupVault,DRSite backup
|
||||
class UserDBEndpoint,EventDBEndpoint,AIDBEndpoint,ContentDBEndpoint,DistDBEndpoint,PartDBEndpoint,AnalDBEndpoint,RedisEndpoint,ServiceBusEndpoint privateEndpoint
|
||||
class SystemNode1,SystemNode2,SystemNode3,AppNode1,AppNode2,AppNode3 nodePool
|
||||
class AIQueue,ContentQueue,DistQueue,AnalQueue queue
|
||||
@@ -0,0 +1,312 @@
|
||||
# KT 소상공인 이벤트 자동 생성 서비스 - 물리 아키텍처 설계서 (마스터 인덱스)
|
||||
|
||||
## 1. 개요
|
||||
|
||||
### 1.1 설계 목적
|
||||
- KT 소상공인 이벤트 자동 생성 서비스의 Azure Cloud 기반 물리 아키텍처 설계
|
||||
- 개발환경과 운영환경의 체계적인 아키텍처 분리 및 관리
|
||||
- 환경별 특화 구성과 단계적 확장 전략 제시
|
||||
- 7개 마이크로서비스의 효율적인 배포 및 운영 아키텍처 구성
|
||||
|
||||
### 1.2 아키텍처 분리 원칙
|
||||
- **환경별 특화**: 개발환경과 운영환경의 목적에 맞는 최적화
|
||||
- **단계적 발전**: 개발→운영 단계적 아키텍처 진화
|
||||
- **비용 효율성**: 환경별 비용 최적화 전략
|
||||
- **운영 단순성**: 환경별 복잡도 적정 수준 유지
|
||||
- **확장성 고려**: 향후 확장 가능한 구조 설계
|
||||
|
||||
### 1.3 문서 구조
|
||||
```
|
||||
physical-architecture.md (마스터 인덱스)
|
||||
├── physical-architecture-dev.md (개발환경)
|
||||
├── physical-architecture-prod.md (운영환경)
|
||||
├── physical-architecture-dev.mmd (개발환경 다이어그램)
|
||||
├── physical-architecture-prod.mmd (운영환경 다이어그램)
|
||||
├── network-dev.mmd (개발환경 네트워크 다이어그램)
|
||||
└── network-prod.mmd (운영환경 네트워크 다이어그램)
|
||||
```
|
||||
|
||||
### 1.4 참조 아키텍처
|
||||
- **HighLevel아키텍처정의서**: design/high-level-architecture.md
|
||||
- **논리아키텍처**: design/backend/logical/logical-architecture.md
|
||||
- **아키텍처패턴**: design/pattern/architecture-pattern.md
|
||||
- **API설계서**: design/backend/api/*.yaml
|
||||
- **데이터설계서**: design/backend/database/database-design.md
|
||||
|
||||
## 2. 환경별 아키텍처 개요
|
||||
|
||||
### 2.1 환경별 특성 비교
|
||||
|
||||
| 구분 | 개발환경 | 운영환경 |
|
||||
|------|----------|----------|
|
||||
| **목적** | MVP 개발/검증/테스트 | 실제 서비스 운영 |
|
||||
| **가용성** | 95% (09:00-18:00) | 99.9% (24/7) |
|
||||
| **사용자** | 개발팀(10명) | 실사용자(1만~10만) |
|
||||
| **확장성** | 고정 리소스 | Auto Scaling (2x~10x) |
|
||||
| **보안** | 기본 수준 | 엔터프라이즈급 |
|
||||
| **비용** | 최소화($200/월) | 최적화($3,500/월) |
|
||||
| **복잡도** | 단순화 | 고도화 |
|
||||
| **배포** | 수동/반자동 | 완전 자동화 |
|
||||
| **모니터링** | 기본 메트릭 | 종합 관측성 |
|
||||
|
||||
### 2.2 환경별 세부 문서
|
||||
|
||||
#### 2.2.1 개발환경 아키텍처
|
||||
📄 **[물리 아키텍처 설계서 - 개발환경](./physical-architecture-dev.md)**
|
||||
|
||||
**주요 특징:**
|
||||
- **비용 최적화**: Basic SKU 리소스 활용으로 월 $200 이하
|
||||
- **개발 편의성**: 복잡한 설정 최소화, 빠른 배포 (5분 이내)
|
||||
- **단순한 보안**: 기본 Network Policy, JWT 검증
|
||||
- **Pod 기반 백킹서비스**: PostgreSQL, Redis Pod으로 외부 의존성 제거
|
||||
|
||||
**핵심 구성:**
|
||||
📊 **[개발환경 물리 아키텍처 다이어그램](./physical-architecture-dev.mmd)**
|
||||
- NGINX Ingress → AKS Basic → Pod Services 구조
|
||||
- 7개 애플리케이션 Pod + PostgreSQL Pod + Redis Pod 배치
|
||||
- Single Zone 배포로 비용 최적화
|
||||
|
||||
📊 **[개발환경 네트워크 다이어그램](./network-dev.mmd)**
|
||||
- VNet 단일 서브넷 구성 (10.0.0.0/16)
|
||||
- External LoadBalancer를 통한 외부 접근
|
||||
- Internal ClusterIP 서비스 간 통신
|
||||
|
||||
#### 2.2.2 운영환경 아키텍처
|
||||
📄 **[물리 아키텍처 설계서 - 운영환경](./physical-architecture-prod.md)**
|
||||
|
||||
**주요 특징:**
|
||||
- **고가용성**: Multi-Zone 배포, 자동 장애조치 (99.9% SLA)
|
||||
- **확장성**: HPA 기반 자동 스케일링 (최대 10배 확장)
|
||||
- **엔터프라이즈 보안**: 다층 보안, Private Endpoint, WAF
|
||||
- **관리형 서비스**: Azure Database for PostgreSQL, Azure Cache for Redis
|
||||
|
||||
**핵심 구성:**
|
||||
📊 **[운영환경 물리 아키텍처 다이어그램](./physical-architecture-prod.mmd)**
|
||||
- Azure Front Door → App Gateway + WAF → AKS Premium 구조
|
||||
- Multi-Zone Apps + Azure PostgreSQL Flexible + Azure Redis Premium 배치
|
||||
- Reserved Instance로 30% 비용 절약
|
||||
|
||||
📊 **[운영환경 네트워크 다이어그램](./network-prod.mmd)**
|
||||
- Multi-Subnet VNet 구성 (App/DB/Cache/Gateway 서브넷 분리)
|
||||
- Private Endpoint를 통한 보안 통신
|
||||
- WAF + Rate Limiting으로 보안 강화
|
||||
|
||||
### 2.3 핵심 아키텍처 결정사항
|
||||
|
||||
#### 2.3.1 공통 아키텍처 원칙
|
||||
- **서비스 메시 제거**: Istio 대신 Kubernetes Network Policies 사용으로 복잡도 감소
|
||||
- **선택적 비동기**: AI 일정 생성 등 장시간 작업만 비동기, 나머지는 동기 통신
|
||||
- **캐시 우선**: Redis 캐시를 통한 성능 최적화 및 서비스 간 의존성 최소화
|
||||
- **Managed Identity**: 키 없는 인증으로 보안 강화
|
||||
- **다층 보안**: L1(Network) → L2(Gateway) → L3(Identity) → L4(Data)
|
||||
|
||||
#### 2.3.2 환경별 차별화 전략
|
||||
|
||||
**개발환경 최적화:**
|
||||
- 개발 속도와 비용 효율성 우선
|
||||
- Pod 기반 백킹서비스로 Azure 관리형 서비스 비용 절약
|
||||
- 단순한 구성으로 운영 부담 최소화
|
||||
- 기능 검증 중심의 최소 보안 설정
|
||||
|
||||
**운영환경 최적화:**
|
||||
- 가용성과 확장성 우선 (99.9% SLA 달성)
|
||||
- Azure 관리형 서비스로 운영 안정성 확보
|
||||
- 엔터프라이즈급 보안 및 종합 모니터링
|
||||
- 실사용자 대응 성능 최적화
|
||||
|
||||
## 3. 네트워크 아키텍처 비교
|
||||
|
||||
### 3.1 환경별 네트워크 전략
|
||||
|
||||
#### 3.1.1 환경별 네트워크 전략 비교
|
||||
|
||||
| 구성 요소 | 개발환경 | 운영환경 | 비교 |
|
||||
|-----------|----------|----------|------|
|
||||
| **인그레스** | NGINX Ingress | Azure App Gateway + WAF | 비용 vs 보안 |
|
||||
| **네트워크** | Single VNet + 단일 서브넷 | Multi-Subnet VNet | 단순성 vs 격리 |
|
||||
| **보안** | Basic Network Policy | WAF + Rate Limiting | 기본 vs 고급 |
|
||||
| **접근** | Public LoadBalancer | Private Endpoint | 편의성 vs 보안 |
|
||||
| **DNS** | ClusterIP 서비스 | Azure Private DNS | 내부 vs 통합 |
|
||||
| **트래픽** | HTTP/HTTPS | HTTPS + TLS 1.3 | 기본 vs 강화 |
|
||||
|
||||
### 3.2 네트워크 보안 전략
|
||||
|
||||
#### 3.2.1 공통 보안 원칙
|
||||
- **Network Policies**: Pod 간 통신 제어 및 마이크로서비스 간 격리
|
||||
- **Managed Identity**: Azure AD 통합 인증으로 키 관리 부담 제거
|
||||
- **Private Endpoints**: 운영환경에서 Azure 서비스 간 프라이빗 통신
|
||||
- **TLS 암호화**: 모든 서비스 간 통신에 TLS 1.2 이상 적용
|
||||
|
||||
#### 3.2.2 환경별 보안 수준
|
||||
|
||||
| 보안 영역 | 개발환경 | 운영환경 | 강화 수준 |
|
||||
|-----------|----------|----------|----------|
|
||||
| **Network Policy** | 기본 Pod 격리 | 세밀한 서비스별 제어 | 5배 강화 |
|
||||
| **시크릿 관리** | Kubernetes Secret | Azure Key Vault | 10배 강화 |
|
||||
| **암호화** | TLS 1.2 | TLS 1.3 + Perfect Forward Secrecy | 2배 강화 |
|
||||
| **웹 보안** | 없음 | WAF + DDoS Protection | 신규 도입 |
|
||||
|
||||
## 4. 데이터 아키텍처 비교
|
||||
|
||||
### 4.1 환경별 데이터 전략
|
||||
|
||||
#### 4.1.1 환경별 데이터 구성 비교
|
||||
|
||||
| 구분 | 개발환경 | 운영환경 | 성능 차이 |
|
||||
|------|----------|----------|----------|
|
||||
| **주 데이터베이스** | PostgreSQL 13 Pod | Azure Database for PostgreSQL Flexible | 3배 성능 향상 |
|
||||
| **가용성** | Single Pod | Multi-Zone HA + 읽기 복제본 | 99.9% vs 95% |
|
||||
| **백업** | 수동 스냅샷 | 자동 백업 (35일 보존) | 자동화 |
|
||||
| **확장성** | 고정 리소스 | 자동 스케일링 | 10배 확장 |
|
||||
| **비용** | $20/월 | $400/월 | 20배 차이 |
|
||||
|
||||
### 4.2 캐시 전략 비교
|
||||
|
||||
#### 4.2.1 다층 캐시 아키텍처
|
||||
|
||||
| 캐시 레벨 | 용도 | 개발환경 | 운영환경 |
|
||||
|-----------|------|----------|----------|
|
||||
| **L1 Application** | 메모리 캐시 | In-Memory (1GB) | In-Memory (4GB) |
|
||||
| **L2 Distributed** | 분산 캐시 | Redis Pod | Azure Cache for Redis Premium |
|
||||
| **성능** | 응답 시간 | 100ms | 50ms |
|
||||
| **가용성** | 캐시 SLA | 95% | 99.9% |
|
||||
|
||||
#### 4.2.2 환경별 캐시 특성 비교
|
||||
|
||||
| 특성 | 개발환경 | 운영환경 | 개선 효과 |
|
||||
|------|----------|----------|----------|
|
||||
| **캐시 구성** | 단일 Redis Pod | Redis Cluster (Multi-Zone) | 고가용성 |
|
||||
| **데이터 지속성** | 임시 저장 | 영구 저장 + 백업 | 데이터 안정성 |
|
||||
| **성능 특성** | 기본 | Premium with RDB persistence | 2배 성능 향상 |
|
||||
| **메모리** | 1GB | 6GB (P2 SKU) | 6배 확장 |
|
||||
|
||||
## 5. 보안 아키텍처 비교
|
||||
|
||||
### 5.1 다층 보안 아키텍처
|
||||
|
||||
#### 5.1.1 공통 보안 계층
|
||||
|
||||
| 보안 계층 | 보안 기술 | 적용 범위 | 보안 목적 |
|
||||
|-----------|----------|----------|----------|
|
||||
| **L1 Network** | Network Policies, NSG | Pod/서브넷 간 통신 | 네트워크 격리 |
|
||||
| **L2 Gateway** | WAF, Rate Limiting | 외부 → 내부 트래픽 | 애플리케이션 보호 |
|
||||
| **L3 Identity** | Azure AD, Managed Identity | 서비스 인증/인가 | ID 기반 보안 |
|
||||
| **L4 Data** | TDE, 저장소 암호화 | 데이터 저장/전송 | 데이터 보호 |
|
||||
|
||||
### 5.2 환경별 보안 수준
|
||||
|
||||
#### 5.2.1 환경별 보안 수준 비교
|
||||
|
||||
| 보안 영역 | 개발환경 | 운영환경 | 강화 방안 |
|
||||
|-----------|----------|----------|----------|
|
||||
| **인증** | JWT 기본 검증 | Azure AD B2C + MFA | 다단계 인증 |
|
||||
| **네트워크** | Basic Network Policy | Micro-segmentation | 세분화된 제어 |
|
||||
| **시크릿** | K8s Secret | Azure Key Vault + HSM | 하드웨어 보안 |
|
||||
| **암호화** | TLS 1.2 | TLS 1.3 + E2E 암호화 | 종단간 암호화 |
|
||||
|
||||
## 6. 모니터링 및 운영
|
||||
|
||||
### 6.1 환경별 모니터링 전략
|
||||
|
||||
#### 6.1.1 환경별 모니터링 도구 비교
|
||||
|
||||
| 모니터링 영역 | 개발환경 | 운영환경 | 커버리지 |
|
||||
|---------------|----------|----------|----------|
|
||||
| **모니터링 도구** | Kubernetes Dashboard | Azure Monitor + Application Insights | 기본 vs 종합 |
|
||||
| **메트릭** | CPU, Memory | CPU, Memory, 비즈니스 메트릭 | 10배 확장 |
|
||||
| **알림** | 없음 | 심각도별 알림 (5분 이내) | 신규 도입 |
|
||||
| **로그 수집** | kubectl logs | 중앙집중식 Log Analytics | 통합 관리 |
|
||||
| **APM** | 없음 | Application Insights | 성능 추적 |
|
||||
|
||||
### 6.2 CI/CD 및 배포 전략
|
||||
|
||||
#### 6.2.1 환경별 배포 방식 비교
|
||||
|
||||
| 배포 측면 | 개발환경 | 운영환경 | 자동화 수준 |
|
||||
|-----------|----------|----------|-------------|
|
||||
| **배포 방식** | kubectl apply | GitOps (ArgoCD) | 수동 vs 자동 |
|
||||
| **자동화** | 부분 자동화 | 완전 자동화 | 5배 향상 |
|
||||
| **테스트** | 단위 테스트 | 단위+통합+E2E 테스트 | 3배 확장 |
|
||||
| **다운타임** | 허용 (30초) | Zero-downtime 배포 | 99.9% 개선 |
|
||||
| **롤백** | 수동 | 자동 롤백 (2분 이내) | 완전 자동화 |
|
||||
|
||||
## 7. 비용 분석
|
||||
|
||||
### 7.1 환경별 비용 구조
|
||||
|
||||
#### 7.1.1 월간 비용 비교
|
||||
|
||||
| 구성 요소 | 개발환경 | 운영환경 | 비용 차이 |
|
||||
|-----------|----------|----------|----------|
|
||||
| **AKS 클러스터** | $30 (Basic) | $400 (Standard) | 13배 |
|
||||
| **컴퓨팅 리소스** | $50 (B2s) | $800 (D4s_v3) | 16배 |
|
||||
| **데이터베이스** | $20 (Pod) | $600 (Flexible) | 30배 |
|
||||
| **캐시** | $0 (Pod) | $300 (Premium P2) | 신규 비용 |
|
||||
| **네트워킹** | $10 | $150 (App Gateway) | 15배 |
|
||||
| **스토리지** | $20 | $100 | 5배 |
|
||||
| **모니터링** | $0 | $150 | 신규 비용 |
|
||||
| **보안** | $0 | $100 (Key Vault) | 신규 비용 |
|
||||
| **예비비(10%)** | $13 | $260 | - |
|
||||
| **총 월간 비용** | **$143** | **$2,860** | **20배** |
|
||||
|
||||
#### 7.1.2 환경별 비용 최적화 전략 비교
|
||||
|
||||
| 최적화 영역 | 개발환경 | 운영환경 | 절약 효과 |
|
||||
|-------------|----------|----------|----------|
|
||||
| **컴퓨팅** | Spot Instance 활용 | Reserved Instance 1년 | 30% 절약 |
|
||||
| **백킹서비스** | Pod 기반으로 무료 | 관리형 서비스 필요 | 운영비 vs 인건비 |
|
||||
| **리소스 관리** | 고정 리소스 | Auto Scaling | 50% 활용률 개선 |
|
||||
|
||||
## 8. 전환 및 확장 계획
|
||||
|
||||
### 8.1 개발환경 → 운영환경 전환 체크리스트
|
||||
|
||||
| 카테고리 | 전환 작업 | 예상 시간 | 담당자 |
|
||||
|----------|----------|----------|--------|
|
||||
| **데이터 마이그레이션** | PostgreSQL Pod → Azure Database | 4시간 | Backend Dev |
|
||||
| **설정 변경** | ConfigMap → Azure Key Vault | 2시간 | DevOps |
|
||||
| **네트워크 구성** | NGINX → App Gateway + WAF | 6시간 | DevOps |
|
||||
| **모니터링 설정** | Azure Monitor + Application Insights | 4시간 | DevOps |
|
||||
| **보안 강화** | Private Endpoint + RBAC | 4시간 | Security |
|
||||
| **성능 테스트** | 부하 테스트 및 튜닝 | 8시간 | QA + DevOps |
|
||||
| **문서화** | 운영 가이드 작성 | 4시간 | Technical Writer |
|
||||
|
||||
### 8.2 단계별 확장 로드맵
|
||||
|
||||
| 단계 | 기간 | 핵심 목표 | 주요 작업 | 사용자 지원 | 가용성 |
|
||||
|------|------|----------|----------|-------------|----------|
|
||||
| **Phase 1** | 1-3개월 | MVP 검증 | 개발환경 구축, 기능 개발 | 100명 | 95% |
|
||||
| **Phase 2** | 4-6개월 | 베타 런칭 | 운영환경 전환, 보안 강화 | 1,000명 | 99% |
|
||||
| **Phase 3** | 7-12개월 | 상용 서비스 | 자동 스케일링, 성능 최적화 | 10,000명 | 99.9% |
|
||||
|
||||
## 9. 핵심 SLA 지표
|
||||
|
||||
### 9.1 환경별 서비스 수준 목표
|
||||
|
||||
| SLA 지표 | 개발환경 | 운영환경 | 개선 비율 |
|
||||
|----------|----------|----------|----------|
|
||||
| **가용성** | 95% (09:00-18:00) | 99.9% (24/7) | 50배 개선 |
|
||||
| **응답시간** | <1초 (50%ile) | <500ms (95%ile) | 2배 개선 |
|
||||
| **배포시간** | 10분 | 5분 (Zero-downtime) | 2배 개선 |
|
||||
| **복구시간** | 30분 | 5분 (자동 복구) | 6배 개선 |
|
||||
| **동시사용자** | 100명 | 10,000명 | 100배 확장 |
|
||||
| **월간비용** | $143 | $2,860 | - |
|
||||
|
||||
---
|
||||
|
||||
## 결론
|
||||
|
||||
본 마스터 인덱스는 KT 소상공인 이벤트 자동 생성 서비스의 Azure 기반 물리 아키텍처를 환경별로 체계적으로 정리한 문서입니다.
|
||||
|
||||
**핵심 성과:**
|
||||
- **비용 효율성**: 개발환경 월 $143로 초기 비용 최소화
|
||||
- **확장성**: 운영환경에서 100배 사용자 확장 지원
|
||||
- **안정성**: 99.9% SLA 달성을 위한 고가용성 아키텍처
|
||||
- **보안**: 다층 보안으로 엔터프라이즈급 보안 수준 확보
|
||||
|
||||
**향후 계획:**
|
||||
1. Phase 1에서 개발환경 기반 MVP 검증
|
||||
2. Phase 2에서 운영환경 전환 및 베타 서비스
|
||||
3. Phase 3에서 상용 서비스 및 성능 최적화
|
||||
|
||||
이를 통해 안정적이고 확장 가능한 AI 기반 이벤트 생성 서비스를 제공할 수 있습니다.
|
||||
Reference in New Issue
Block a user