mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2026-06-13 10:19:12 +00:00
백엔드 서비스 AKS 배포 및 설정 완료
- Kubernetes 매니페스트 파일 생성 (7개 서비스) * user-service, event-service, ai-service, content-service * participation-service, analytics-service, distribution-service * 공통 리소스: Ingress, ConfigMap, Secret, ImagePullSecret - analytics-service 배포 문제 해결 * Hibernate PostgreSQL dialect 추가 * DB 자격증명 수정 (eventuser/Hi5Jessica!) * analytics_db 데이터베이스 생성 - content-service Probe 경로 수정 * Context path 포함 (/api/v1/content/actuator/health) - distribution-service 신규 배포 * Docker 이미지 빌드 및 ACR 푸시 * K8s 매니페스트 생성 및 배포 * Ingress 경로 추가 (/distribution) - Gradle bootJar 설정 추가 * 5개 서비스에 archiveFileName 설정 - 배포 가이드 문서 추가 * deployment/k8s/deploy-k8s-guide.md * claude/deploy-k8s-back.md * deployment/container/build-image.md 업데이트 배포 완료: 모든 백엔드 서비스(7개) 정상 실행 중 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,248 @@
|
||||
# 환경변수 매핑 테이블
|
||||
|
||||
## 1. user-service 환경변수 매핑
|
||||
|
||||
| 환경변수 | 값 | 지정 객체 | 비고 |
|
||||
|---------|-----|----------|------|
|
||||
| SERVER_PORT | 8081 | cm-user-service | |
|
||||
| DB_URL | jdbc:postgresql://user-postgresql:5432/userdb | cm-user-service | |
|
||||
| DB_DRIVER | org.postgresql.Driver | cm-user-service | |
|
||||
| DB_HOST | user-postgresql | cm-user-service | ClusterIP 서비스명 |
|
||||
| DB_PORT | 5432 | cm-user-service | |
|
||||
| DB_NAME | userdb | cm-user-service | |
|
||||
| DB_USERNAME | eventuser | cm-user-service | |
|
||||
| DB_PASSWORD | Hi5Jessica! | secret-user-service | |
|
||||
| DB_KIND | postgresql | cm-user-service | |
|
||||
| DDL_AUTO | update | cm-common | 공통 |
|
||||
| SHOW_SQL | false | cm-common | 공통 |
|
||||
| JPA_DIALECT | org.hibernate.dialect.PostgreSQLDialect | cm-common | 공통 |
|
||||
| H2_CONSOLE_ENABLED | false | cm-common | 공통 |
|
||||
| REDIS_ENABLED | true | cm-common | 공통 |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP 서비스명, 공통 |
|
||||
| REDIS_PORT | 6379 | cm-common | 공통 |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | 공통 |
|
||||
| REDIS_DATABASE | 0 | cm-user-service | |
|
||||
| EXCLUDE_REDIS | "" | cm-common | 공통 |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | 공통 |
|
||||
| KAFKA_CONSUMER_GROUP | user-service-consumers | cm-user-service | |
|
||||
| EXCLUDE_KAFKA | "" | cm-common | 공통 |
|
||||
| JWT_SECRET | ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE= | secret-common | openssl 생성, 공통 |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | 공통 |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | 공통 |
|
||||
| LOG_LEVEL_APP | INFO | cm-common | 공통 |
|
||||
| LOG_LEVEL_WEB | INFO | cm-common | 공통 |
|
||||
| LOG_LEVEL_SQL | WARN | cm-common | 공통 |
|
||||
| LOG_LEVEL_SQL_TYPE | WARN | cm-common | 공통 |
|
||||
| LOG_FILE_PATH | logs/user-service.log | cm-user-service | |
|
||||
|
||||
## 2. event-service 환경변수 매핑
|
||||
|
||||
| 환경변수 | 값 | 지정 객체 | 비고 |
|
||||
|---------|-----|----------|------|
|
||||
| SERVER_PORT | 8080 | cm-event-service | |
|
||||
| DB_HOST | event-postgresql | cm-event-service | ClusterIP 서비스명 |
|
||||
| DB_PORT | 5432 | cm-event-service | |
|
||||
| DB_NAME | eventdb | cm-event-service | |
|
||||
| DB_USERNAME | eventuser | cm-event-service | |
|
||||
| DB_PASSWORD | Hi5Jessica! | secret-event-service | |
|
||||
| DDL_AUTO | update | cm-common | 공통 |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP 서비스명, 공통 |
|
||||
| REDIS_PORT | 6379 | cm-common | 공통 |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | 공통 |
|
||||
| REDIS_DATABASE | 2 | cm-event-service | |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | 공통 |
|
||||
| KAFKA_CONSUMER_GROUP | event-service-consumers | cm-event-service | |
|
||||
| CONTENT_SERVICE_URL | http://content-service | cm-event-service | |
|
||||
| DISTRIBUTION_SERVICE_URL | http://distribution-service | cm-event-service | |
|
||||
| JWT_SECRET | ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE= | secret-common | 공통 |
|
||||
| LOG_LEVEL | INFO | cm-event-service | |
|
||||
| SQL_LOG_LEVEL | WARN | cm-event-service | |
|
||||
|
||||
## 3. ai-service 환경변수 매핑
|
||||
|
||||
| 환경변수 | 값 | 지정 객체 | 비고 |
|
||||
|---------|-----|----------|------|
|
||||
| SERVER_PORT | 8083 | cm-ai-service | |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP 서비스명, 공통 |
|
||||
| REDIS_PORT | 6379 | cm-common | 공통 |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | 공통 |
|
||||
| REDIS_DATABASE | 3 | cm-ai-service | |
|
||||
| REDIS_TIMEOUT | 3000 | cm-ai-service | |
|
||||
| REDIS_POOL_MAX | 8 | cm-common | 공통 |
|
||||
| REDIS_POOL_IDLE | 8 | cm-common | 공통 |
|
||||
| REDIS_POOL_MIN | 2 | cm-ai-service | |
|
||||
| REDIS_POOL_WAIT | -1ms | cm-common | 공통 |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | 공통 |
|
||||
| KAFKA_CONSUMER_GROUP | ai-service-consumers | cm-ai-service | |
|
||||
| KAFKA_TOPICS_AI_JOB | ai-event-generation-job | cm-ai-service | |
|
||||
| KAFKA_TOPICS_AI_JOB_DLQ | ai-event-generation-job-dlq | cm-ai-service | |
|
||||
| JWT_SECRET | ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE= | secret-common | 공통 |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | 공통 |
|
||||
| JWT_REFRESH_TOKEN_VALIDITY | 86400 | cm-common | 공통 |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | 공통 |
|
||||
| CORS_ALLOWED_METHODS | GET,POST,PUT,DELETE,OPTIONS,PATCH | cm-common | 공통 |
|
||||
| CORS_ALLOWED_HEADERS | * | cm-common | 공통 |
|
||||
| CORS_ALLOW_CREDENTIALS | true | cm-common | 공통 |
|
||||
| CORS_MAX_AGE | 3600 | cm-common | 공통 |
|
||||
| LOG_LEVEL_ROOT | INFO | cm-common | 공통 |
|
||||
| LOG_LEVEL_AI | DEBUG | cm-ai-service | |
|
||||
| LOG_LEVEL_KAFKA | INFO | cm-ai-service | |
|
||||
| LOG_LEVEL_REDIS | INFO | cm-ai-service | |
|
||||
| LOG_LEVEL_RESILIENCE4J | DEBUG | cm-ai-service | |
|
||||
| LOG_FILE_NAME | logs/ai-service.log | cm-ai-service | |
|
||||
| LOG_FILE_MAX_SIZE | 10MB | cm-common | 공통 |
|
||||
| LOG_FILE_MAX_HISTORY | 7 | cm-common | 공통 |
|
||||
| LOG_FILE_TOTAL_CAP | 100MB | cm-common | 공통 |
|
||||
| AI_PROVIDER | CLAUDE | cm-ai-service | |
|
||||
| AI_CLAUDE_API_URL | https://api.anthropic.com/v1/messages | cm-ai-service | |
|
||||
| AI_CLAUDE_API_KEY | sk-ant-api03-... | secret-ai-service | |
|
||||
| AI_CLAUDE_ANTHROPIC_VERSION | 2023-06-01 | cm-ai-service | |
|
||||
| AI_CLAUDE_MODEL | claude-sonnet-4-5-20250929 | cm-ai-service | |
|
||||
| AI_CLAUDE_MAX_TOKENS | 4096 | cm-ai-service | |
|
||||
| AI_CLAUDE_TEMPERATURE | 0.7 | cm-ai-service | |
|
||||
| AI_CLAUDE_TIMEOUT | 300000 | cm-ai-service | |
|
||||
| CACHE_TTL_RECOMMENDATION | 86400 | cm-ai-service | |
|
||||
| CACHE_TTL_JOB_STATUS | 86400 | cm-ai-service | |
|
||||
| CACHE_TTL_TREND | 3600 | cm-ai-service | |
|
||||
| CACHE_TTL_FALLBACK | 604800 | cm-ai-service | |
|
||||
|
||||
## 4. content-service 환경변수 매핑
|
||||
|
||||
| 환경변수 | 값 | 지정 객체 | 비고 |
|
||||
|---------|-----|----------|------|
|
||||
| SERVER_PORT | 8084 | cm-content-service | application.yml 기본값 |
|
||||
| REDIS_ENABLED | true | cm-common | 공통 |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP 서비스명, 공통 |
|
||||
| REDIS_PORT | 6379 | cm-common | 공통 |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | 공통 |
|
||||
| REDIS_TIMEOUT | 2000ms | cm-common | 공통 |
|
||||
| REDIS_POOL_MAX | 8 | cm-common | 공통 |
|
||||
| REDIS_POOL_IDLE | 8 | cm-common | 공통 |
|
||||
| REDIS_POOL_MIN | 0 | cm-common | 공통 |
|
||||
| REDIS_POOL_WAIT | -1ms | cm-common | 공통 |
|
||||
| REDIS_DATABASE | 1 | cm-content-service | |
|
||||
| JWT_SECRET | ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE= | secret-common | 공통 |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | 공통 (실제 3600000) |
|
||||
| JWT_REFRESH_TOKEN_VALIDITY | 86400 | cm-common | 공통 (실제 604800000) |
|
||||
| AZURE_STORAGE_CONNECTION_STRING | DefaultEndpointsProtocol=https;AccountName=... | secret-content-service | |
|
||||
| AZURE_CONTAINER_NAME | content-images | cm-content-service | |
|
||||
| REPLICATE_API_URL | https://api.replicate.com | cm-content-service | |
|
||||
| REPLICATE_API_TOKEN | (값 없음) | secret-content-service | |
|
||||
| REPLICATE_MODEL_VERSION | stability-ai/sdxl:... | cm-content-service | |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | 공통 |
|
||||
| LOG_LEVEL_APP | INFO | cm-common | 공통 (실제 DEBUG) |
|
||||
| LOG_LEVEL_WEB | INFO | cm-common | 공통 |
|
||||
| LOG_LEVEL_ROOT | INFO | cm-common | 공통 |
|
||||
| LOG_FILE_PATH | logs/content-service.log | cm-content-service | |
|
||||
| LOG_FILE_MAX_SIZE | 10MB | cm-common | 공통 |
|
||||
| LOG_FILE_MAX_HISTORY | 7 | cm-common | 공통 |
|
||||
| LOG_FILE_TOTAL_CAP | 100MB | cm-common | 공통 |
|
||||
|
||||
## 5. participation-service 환경변수 매핑
|
||||
|
||||
| 환경변수 | 값 | 지정 객체 | 비고 |
|
||||
|---------|-----|----------|------|
|
||||
| SERVER_PORT | 8084 | cm-participation-service | |
|
||||
| DB_HOST | participation-postgresql | cm-participation-service | ClusterIP 서비스명 |
|
||||
| DB_PORT | 5432 | cm-participation-service | |
|
||||
| DB_NAME | participationdb | cm-participation-service | |
|
||||
| DB_USERNAME | eventuser | cm-participation-service | |
|
||||
| DB_PASSWORD | Hi5Jessica! | secret-participation-service | |
|
||||
| DDL_AUTO | update | cm-common | 공통 |
|
||||
| SHOW_SQL | false | cm-participation-service | |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP 서비스명, 공통 |
|
||||
| REDIS_PORT | 6379 | cm-common | 공통 |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | 공통 |
|
||||
| REDIS_DATABASE | 4 | cm-participation-service | |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | 공통 |
|
||||
| KAFKA_CONSUMER_GROUP | participation-service-consumers | cm-participation-service | |
|
||||
| JWT_SECRET | ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE= | secret-common | 공통 |
|
||||
| JWT_EXPIRATION | 86400000 | JWT_ACCESS_TOKEN_VALIDITY 대체 | |
|
||||
| LOG_LEVEL | INFO | cm-participation-service | |
|
||||
| LOG_FILE | logs/participation-service.log | cm-participation-service | |
|
||||
|
||||
## 6. analytics-service 환경변수 매핑
|
||||
|
||||
| 환경변수 | 값 | 지정 객체 | 비고 |
|
||||
|---------|-----|----------|------|
|
||||
| SERVER_PORT | 8086 | cm-analytics-service | |
|
||||
| DB_KIND | postgresql | cm-common | 공통 |
|
||||
| DB_HOST | analytic-postgresql | cm-analytics-service | ClusterIP 서비스명 |
|
||||
| DB_PORT | 5432 | cm-analytics-service | |
|
||||
| DB_NAME | analytics_db | cm-analytics-service | 실행프로파일은 analyticdb |
|
||||
| DB_USERNAME | analytics_user | cm-analytics-service | 실행프로파일은 eventuser |
|
||||
| DB_PASSWORD | Hi5Jessica! | secret-analytics-service | |
|
||||
| DDL_AUTO | update | cm-analytics-service | 실행프로파일은 create |
|
||||
| SHOW_SQL | false | cm-analytics-service | 실행프로파일은 true |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP 서비스명, 공통 |
|
||||
| REDIS_PORT | 6379 | cm-common | 공통 |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | 공통 |
|
||||
| REDIS_DATABASE | 5 | cm-analytics-service | |
|
||||
| KAFKA_ENABLED | true | cm-analytics-service | |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | 공통 |
|
||||
| KAFKA_CONSUMER_GROUP_ID | analytics-service | cm-analytics-service | 실행프로파일은 analytics-service-consumers |
|
||||
| SAMPLE_DATA_ENABLED | true | cm-analytics-service | |
|
||||
| JWT_SECRET | ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE= | secret-common | 공통 |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | 실행프로파일은 1800 |
|
||||
| JWT_REFRESH_TOKEN_VALIDITY | 86400 | cm-common | 실행프로파일은 86400 |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | 공통 |
|
||||
| LOG_FILE | logs/analytics-service.log | cm-analytics-service | |
|
||||
| LOG_LEVEL_APP | INFO | cm-common | 실행프로파일은 DEBUG |
|
||||
| LOG_LEVEL_WEB | INFO | cm-common | 공통 |
|
||||
| LOG_LEVEL_SQL | WARN | cm-common | 실행프로파일은 DEBUG |
|
||||
| LOG_LEVEL_SQL_TYPE | WARN | cm-common | 실행프로파일은 TRACE |
|
||||
|
||||
## 주요 체크 사항
|
||||
|
||||
### 1. ClusterIP 서비스명 사용 확인
|
||||
- ✅ Redis HOST: `redis` (ClusterIP 서비스명)
|
||||
- ✅ user-service DB HOST: `user-postgresql`
|
||||
- ✅ event-service DB HOST: `event-postgresql`
|
||||
- ✅ participation-service DB HOST: `participation-postgresql`
|
||||
- ✅ analytics-service DB HOST: `analytic-postgresql`
|
||||
|
||||
### 2. Secret에 stringData 사용 확인
|
||||
- ✅ secret-common.yaml: stringData 사용
|
||||
- ✅ secret-user-service.yaml: stringData 사용
|
||||
- ✅ secret-event-service.yaml: stringData 사용
|
||||
- ✅ secret-ai-service.yaml: stringData 사용
|
||||
- ✅ secret-content-service.yaml: stringData 사용
|
||||
- ✅ secret-participation-service.yaml: stringData 사용
|
||||
- ✅ secret-analytics-service.yaml: stringData 사용
|
||||
|
||||
### 3. JWT_SECRET openssl 생성 확인
|
||||
- ✅ openssl rand -base64 32로 생성: `ShiBpV6q7NwnjOafujT87XcgxzTdEFmEKO5Y+8zNPvE=`
|
||||
|
||||
### 4. 매니페스트 내 환경변수 미사용 확인
|
||||
- ✅ Ingress host: kt-event-marketing-api.20.214.196.128.nip.io (실제 값 사용)
|
||||
- ✅ 모든 매니페스트에 실제 값만 지정
|
||||
|
||||
### 5. Image Pull Secret 설정 확인
|
||||
- ✅ secret-imagepull.yaml: USERNAME과 PASSWORD 실제 값 지정
|
||||
- ✅ Deployment에 imagePullSecrets 설정
|
||||
|
||||
### 6. Image명 형식 확인
|
||||
- ✅ 형식: acrdigitalgarage01.azurecr.io/kt-event-marketing/{서비스명}:latest
|
||||
|
||||
### 7. Ingress 설정 확인
|
||||
- ✅ Ingress External IP: 20.214.196.128
|
||||
- ✅ Service port: 80
|
||||
- ✅ Ingress annotation에 rewrite-target 설정 없음
|
||||
|
||||
### 8. envFrom 사용 확인
|
||||
- ✅ 모든 Deployment에서 env 대신 envFrom 사용
|
||||
|
||||
### 9. REDIS_DATABASE 서비스별 분리 확인
|
||||
- ✅ user-service: 0
|
||||
- ✅ content-service: 1
|
||||
- ✅ event-service: 2
|
||||
- ✅ ai-service: 3
|
||||
- ✅ participation-service: 4
|
||||
- ✅ analytics-service: 5
|
||||
|
||||
### 10. 보안 환경변수 Secret 분리 확인
|
||||
- ✅ JWT_SECRET: secret-common
|
||||
- ✅ REDIS_PASSWORD: secret-common
|
||||
- ✅ DB_PASSWORD: 각 서비스별 secret
|
||||
- ✅ AI_CLAUDE_API_KEY: secret-ai-service
|
||||
- ✅ AZURE_STORAGE_CONNECTION_STRING: secret-content-service
|
||||
@@ -0,0 +1,56 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-ai-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8083"
|
||||
|
||||
# Redis Configuration (service-specific)
|
||||
REDIS_DATABASE: "3"
|
||||
REDIS_TIMEOUT: "3000"
|
||||
REDIS_POOL_MIN: "2"
|
||||
|
||||
# Kafka Configuration (service-specific)
|
||||
KAFKA_CONSUMER_GROUP: "ai-service-consumers"
|
||||
|
||||
# Kafka Topics Configuration
|
||||
KAFKA_TOPICS_AI_JOB: "ai-event-generation-job"
|
||||
KAFKA_TOPICS_AI_JOB_DLQ: "ai-event-generation-job-dlq"
|
||||
|
||||
# AI Provider Configuration
|
||||
AI_PROVIDER: "CLAUDE"
|
||||
AI_CLAUDE_API_URL: "https://api.anthropic.com/v1/messages"
|
||||
AI_CLAUDE_ANTHROPIC_VERSION: "2023-06-01"
|
||||
AI_CLAUDE_MODEL: "claude-sonnet-4-5-20250929"
|
||||
AI_CLAUDE_MAX_TOKENS: "4096"
|
||||
AI_CLAUDE_TEMPERATURE: "0.7"
|
||||
AI_CLAUDE_TIMEOUT: "300000"
|
||||
|
||||
# Circuit Breaker Configuration
|
||||
RESILIENCE4J_CIRCUITBREAKER_FAILURE_RATE_THRESHOLD: "50"
|
||||
RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_RATE_THRESHOLD: "50"
|
||||
RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_DURATION_THRESHOLD: "60s"
|
||||
RESILIENCE4J_CIRCUITBREAKER_PERMITTED_CALLS_HALF_OPEN: "3"
|
||||
RESILIENCE4J_CIRCUITBREAKER_SLIDING_WINDOW_SIZE: "10"
|
||||
RESILIENCE4J_CIRCUITBREAKER_MINIMUM_CALLS: "5"
|
||||
RESILIENCE4J_CIRCUITBREAKER_WAIT_DURATION_OPEN: "60s"
|
||||
RESILIENCE4J_TIMELIMITER_TIMEOUT_DURATION: "300s"
|
||||
|
||||
# Redis Cache TTL Configuration (seconds)
|
||||
CACHE_TTL_RECOMMENDATION: "86400"
|
||||
CACHE_TTL_JOB_STATUS: "86400"
|
||||
CACHE_TTL_TREND: "3600"
|
||||
CACHE_TTL_FALLBACK: "604800"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_LEVEL_ROOT: "INFO"
|
||||
LOG_LEVEL_AI: "DEBUG"
|
||||
LOG_LEVEL_KAFKA: "INFO"
|
||||
LOG_LEVEL_REDIS: "INFO"
|
||||
LOG_LEVEL_RESILIENCE4J: "DEBUG"
|
||||
LOG_FILE_NAME: "logs/ai-service.log"
|
||||
LOG_FILE_MAX_SIZE: "10MB"
|
||||
LOG_FILE_MAX_HISTORY: "7"
|
||||
LOG_FILE_TOTAL_CAP: "100MB"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ai-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: ai-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ai-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ai-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: ai-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8083
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-ai-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-ai-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8083
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8083
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8083
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-ai-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Claude API Key
|
||||
AI_CLAUDE_API_KEY: "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"
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ai-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: ai-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8083
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: ai-service
|
||||
@@ -0,0 +1,38 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-analytics-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8086"
|
||||
|
||||
# Database Configuration
|
||||
DB_HOST: "analytic-postgresql"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "analytics_db"
|
||||
DB_USERNAME: "eventuser"
|
||||
|
||||
# Redis Configuration (service-specific)
|
||||
REDIS_DATABASE: "5"
|
||||
|
||||
# Kafka Configuration (service-specific)
|
||||
KAFKA_ENABLED: "true"
|
||||
KAFKA_CONSUMER_GROUP_ID: "analytics-service"
|
||||
|
||||
# Sample Data Configuration (MVP only)
|
||||
SAMPLE_DATA_ENABLED: "true"
|
||||
|
||||
# Batch Scheduler Configuration
|
||||
BATCH_REFRESH_INTERVAL: "300000" # 5분 (밀리초)
|
||||
BATCH_INITIAL_DELAY: "30000" # 30초 (밀리초)
|
||||
BATCH_ENABLED: "true"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_LEVEL_APP: "INFO"
|
||||
LOG_LEVEL_WEB: "INFO"
|
||||
LOG_LEVEL_SQL: "WARN"
|
||||
LOG_LEVEL_SQL_TYPE: "WARN"
|
||||
SHOW_SQL: "false"
|
||||
DDL_AUTO: "update"
|
||||
LOG_FILE: "logs/analytics-service.log"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: analytics-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: analytics-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: analytics-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: analytics-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: analytics-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/analytics-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8086
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-analytics-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-analytics-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8086
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8086
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8086
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-analytics-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_PASSWORD: "Hi5Jessica!"
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: analytics-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: analytics-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8086
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: analytics-service
|
||||
@@ -0,0 +1,47 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-common
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Redis Configuration
|
||||
REDIS_ENABLED: "true"
|
||||
REDIS_HOST: "redis"
|
||||
REDIS_PORT: "6379"
|
||||
REDIS_TIMEOUT: "2000ms"
|
||||
REDIS_POOL_MAX: "8"
|
||||
REDIS_POOL_IDLE: "8"
|
||||
REDIS_POOL_MIN: "0"
|
||||
REDIS_POOL_WAIT: "-1ms"
|
||||
|
||||
# Kafka Configuration
|
||||
KAFKA_BOOTSTRAP_SERVERS: "20.249.182.13:9095,4.217.131.59:9095"
|
||||
EXCLUDE_KAFKA: ""
|
||||
EXCLUDE_REDIS: ""
|
||||
|
||||
# CORS Configuration
|
||||
CORS_ALLOWED_ORIGINS: "http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084,http://kt-event-marketing.20.214.196.128.nip.io"
|
||||
CORS_ALLOWED_METHODS: "GET,POST,PUT,DELETE,OPTIONS,PATCH"
|
||||
CORS_ALLOWED_HEADERS: "*"
|
||||
CORS_ALLOW_CREDENTIALS: "true"
|
||||
CORS_MAX_AGE: "3600"
|
||||
|
||||
# JWT Configuration
|
||||
JWT_ACCESS_TOKEN_VALIDITY: "604800000"
|
||||
JWT_REFRESH_TOKEN_VALIDITY: "86400000"
|
||||
|
||||
# JPA Configuration
|
||||
DDL_AUTO: "update"
|
||||
SHOW_SQL: "false"
|
||||
JPA_DIALECT: "org.hibernate.dialect.PostgreSQLDialect"
|
||||
H2_CONSOLE_ENABLED: "false"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_LEVEL_APP: "INFO"
|
||||
LOG_LEVEL_WEB: "INFO"
|
||||
LOG_LEVEL_SQL: "WARN"
|
||||
LOG_LEVEL_SQL_TYPE: "WARN"
|
||||
LOG_LEVEL_ROOT: "INFO"
|
||||
LOG_FILE_MAX_SIZE: "10MB"
|
||||
LOG_FILE_MAX_HISTORY: "7"
|
||||
LOG_FILE_TOTAL_CAP: "100MB"
|
||||
@@ -0,0 +1,117 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: kt-event-marketing
|
||||
namespace: kt-event-marketing
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: kt-event-marketing-api.20.214.196.128.nip.io
|
||||
http:
|
||||
paths:
|
||||
# User Service
|
||||
- path: /api/v1/users
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: user-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# Content Service
|
||||
- path: /api/v1/content
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: content-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# Event Service
|
||||
- path: /api/v1/events
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: event-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
- path: /api/v1/jobs
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: event-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
- path: /api/v1/redis-test
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: event-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# AI Service
|
||||
- path: /api/v1/ai-service
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ai-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# Participation Service
|
||||
- path: /api/v1/participations
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: participation-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
- path: /api/v1/winners
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: participation-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
- path: /debug
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: participation-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# Analytics Service - Event Analytics
|
||||
- path: /api/v1/events/([0-9]+)/analytics
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: analytics-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# Analytics Service - User Analytics
|
||||
- path: /api/v1/users/([0-9]+)/analytics
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: analytics-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
# Distribution Service
|
||||
- path: /distribution
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: distribution-service
|
||||
port:
|
||||
number: 80
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-common
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Redis Password
|
||||
REDIS_PASSWORD: "Hi5Jessica!"
|
||||
|
||||
# JWT Secret
|
||||
JWT_SECRET: "QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU="
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: kt-event-marketing
|
||||
namespace: kt-event-marketing
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
stringData:
|
||||
.dockerconfigjson: |
|
||||
{
|
||||
"auths": {
|
||||
"acrdigitalgarage01.azurecr.io": {
|
||||
"username": "acrdigitalgarage01",
|
||||
"password": "+OY+rmOagorjWvQe/tTk6oqvnZI8SmNbY/Y2o5EDcY+ACRDCDbYk",
|
||||
"auth": "YWNyZGlnaXRhbGdhcmFnZTAxOitPWStybU9hZ29yald2UWUvdFRrNm9xdm5aSThTbU5iWS9ZMm81RURjWStBQ1JEQ0RiWWs="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-content-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8084"
|
||||
|
||||
# Redis Configuration (service-specific)
|
||||
REDIS_DATABASE: "1"
|
||||
|
||||
# Replicate API Configuration (Stable Diffusion)
|
||||
REPLICATE_API_URL: "https://api.replicate.com"
|
||||
REPLICATE_MODEL_VERSION: "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b"
|
||||
|
||||
# HuggingFace API Configuration
|
||||
HUGGINGFACE_API_URL: "https://api-inference.huggingface.co"
|
||||
HUGGINGFACE_MODEL: "runwayml/stable-diffusion-v1-5"
|
||||
|
||||
# Azure Blob Storage Configuration
|
||||
AZURE_CONTAINER_NAME: "content-images"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_FILE_PATH: "logs/content-service.log"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: content-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: content-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: content-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: content-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: content-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8084
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-content-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-content-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /api/v1/content/actuator/health
|
||||
port: 8084
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/v1/content/actuator/health/readiness
|
||||
port: 8084
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/v1/content/actuator/health/liveness
|
||||
port: 8084
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-content-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Azure Blob Storage Connection String
|
||||
AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=https;AccountName=blobkteventstorage;AccountKey=tcBN7mAfojbl0uGsOpU7RNuKNhHnzmwDiWjN31liSMVSrWaEK+HHnYKZrjBXXAC6ZPsuxUDlsf8x+AStd++QYg==;EndpointSuffix=core.windows.net"
|
||||
|
||||
# Replicate API Token
|
||||
REPLICATE_API_TOKEN: ""
|
||||
|
||||
# HuggingFace API Token
|
||||
HUGGINGFACE_API_TOKEN: ""
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: content-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: content-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8084
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: content-service
|
||||
@@ -0,0 +1,738 @@
|
||||
# Kubernetes 배포 가이드
|
||||
|
||||
## 1. 시스템 개요
|
||||
|
||||
- **시스템명**: kt-event-marketing
|
||||
- **네임스페이스**: kt-event-marketing
|
||||
- **ACR**: acrdigitalgarage01
|
||||
- **AKS 클러스터**: aks-digitalgarage-01
|
||||
- **Ingress External IP**: 20.214.196.128
|
||||
- **파드 수**: 1 (각 서비스)
|
||||
- **리소스 할당**: CPU 256m/1024m, Memory 256Mi/1024Mi
|
||||
|
||||
## 2. 서비스 구성
|
||||
|
||||
| 서비스 | 포트 | 데이터베이스 | Redis DB | API Path |
|
||||
|--------|------|------------|----------|----------|
|
||||
| user-service | 8081 | user-postgresql | 0 | /api/v1/users |
|
||||
| content-service | 8084 | N/A | 1 | /api/v1/content |
|
||||
| event-service | 8080 | event-postgresql | 2 | /api/v1/events, /api/v1/jobs |
|
||||
| ai-service | 8083 | N/A | 3 | /api/v1/ai-service |
|
||||
| participation-service | 8084 | participation-postgresql | 4 | /api/v1/participations, /api/v1/winners |
|
||||
| analytics-service | 8086 | analytic-postgresql | 5 | /api/v1/events/.../analytics, /api/v1/users/.../analytics |
|
||||
|
||||
## 3. 사전 확인
|
||||
|
||||
### 3.1 Azure 로그인 확인
|
||||
```bash
|
||||
az account show
|
||||
```
|
||||
|
||||
**확인 사항**: 올바른 Azure 구독에 로그인되어 있는지 확인
|
||||
|
||||
### 3.2 AKS Credential 확인
|
||||
```bash
|
||||
kubectl cluster-info
|
||||
```
|
||||
|
||||
**확인 사항**: Kubernetes 클러스터에 정상적으로 연결되어 있는지 확인
|
||||
|
||||
### 3.3 Namespace 존재 확인
|
||||
```bash
|
||||
kubectl get ns kt-event-marketing
|
||||
```
|
||||
|
||||
**확인 사항**: kt-event-marketing 네임스페이스가 존재하는지 확인. 없으면 생성:
|
||||
```bash
|
||||
kubectl create namespace kt-event-marketing
|
||||
```
|
||||
|
||||
### 3.4 필수 서비스 확인
|
||||
|
||||
#### Redis 서비스 확인
|
||||
```bash
|
||||
kubectl get svc | grep redis
|
||||
```
|
||||
|
||||
**확인 결과**:
|
||||
```
|
||||
redis ClusterIP 10.0.69.101 <none> 6379/TCP,26379/TCP
|
||||
redis-external LoadBalancer 10.0.68.243 20.214.210.71 6379:30397/TCP,26379:32563/TCP
|
||||
redis-headless ClusterIP None <none> 6379/TCP,26379/TCP
|
||||
```
|
||||
|
||||
**사용할 서비스**: `redis` (ClusterIP)
|
||||
|
||||
#### 데이터베이스 서비스 확인
|
||||
```bash
|
||||
kubectl get svc | grep postgresql
|
||||
```
|
||||
|
||||
**확인 결과**:
|
||||
```
|
||||
user-postgresql ClusterIP 10.0.189.87 <none> 5432/TCP
|
||||
user-postgresql-external LoadBalancer 10.0.186.11 20.249.125.115 5432:30414/TCP
|
||||
event-postgresql ClusterIP 10.0.245.96 <none> 5432/TCP
|
||||
event-postgresql-external LoadBalancer 10.0.200.134 20.249.177.232 5432:31222/TCP
|
||||
```
|
||||
|
||||
**사용할 서비스**:
|
||||
- user-service: `user-postgresql` (ClusterIP)
|
||||
- event-service: `event-postgresql` (ClusterIP)
|
||||
|
||||
#### Ingress Controller 확인
|
||||
```bash
|
||||
kubectl get svc ingress-nginx-controller -n ingress-nginx
|
||||
```
|
||||
|
||||
**확인 결과**:
|
||||
```
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
|
||||
ingress-nginx-controller LoadBalancer 10.0.76.134 20.214.196.128 80:32094/TCP,443:30210/TCP
|
||||
```
|
||||
|
||||
**Ingress Host**: `kt-event-marketing-api.20.214.196.128.nip.io`
|
||||
|
||||
## 4. 매니페스트 적용
|
||||
|
||||
### 4.1 공통 리소스 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/common/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- Secret: `kt-event-marketing` (ImagePullSecret)
|
||||
- ConfigMap: `cm-common`
|
||||
- Secret: `secret-common`
|
||||
- Ingress: `kt-event-marketing`
|
||||
|
||||
### 4.2 user-service 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/user-service/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- ConfigMap: `cm-user-service`
|
||||
- Secret: `secret-user-service`
|
||||
- Service: `user-service`
|
||||
- Deployment: `user-service`
|
||||
|
||||
### 4.3 content-service 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/content-service/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- ConfigMap: `cm-content-service`
|
||||
- Secret: `secret-content-service`
|
||||
- Service: `content-service`
|
||||
- Deployment: `content-service`
|
||||
|
||||
### 4.4 event-service 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/event-service/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- ConfigMap: `cm-event-service`
|
||||
- Secret: `secret-event-service`
|
||||
- Service: `event-service`
|
||||
- Deployment: `event-service`
|
||||
|
||||
### 4.5 ai-service 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/ai-service/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- ConfigMap: `cm-ai-service`
|
||||
- Secret: `secret-ai-service`
|
||||
- Service: `ai-service`
|
||||
- Deployment: `ai-service`
|
||||
|
||||
### 4.6 participation-service 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/participation-service/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- ConfigMap: `cm-participation-service`
|
||||
- Secret: `secret-participation-service`
|
||||
- Service: `participation-service`
|
||||
- Deployment: `participation-service`
|
||||
|
||||
### 4.7 analytics-service 배포
|
||||
```bash
|
||||
kubectl apply -f deployment/k8s/analytics-service/
|
||||
```
|
||||
|
||||
**생성되는 리소스**:
|
||||
- ConfigMap: `cm-analytics-service`
|
||||
- Secret: `secret-analytics-service`
|
||||
- Service: `analytics-service`
|
||||
- Deployment: `analytics-service`
|
||||
|
||||
### 4.8 전체 한번에 배포 (권장)
|
||||
```bash
|
||||
# 공통 리소스 먼저 배포
|
||||
kubectl apply -f deployment/k8s/common/
|
||||
|
||||
# 모든 서비스 배포
|
||||
kubectl apply -f deployment/k8s/user-service/
|
||||
kubectl apply -f deployment/k8s/content-service/
|
||||
kubectl apply -f deployment/k8s/event-service/
|
||||
kubectl apply -f deployment/k8s/ai-service/
|
||||
kubectl apply -f deployment/k8s/participation-service/
|
||||
kubectl apply -f deployment/k8s/analytics-service/
|
||||
```
|
||||
|
||||
## 5. 배포 확인
|
||||
|
||||
### 5.1 ConfigMap 및 Secret 확인
|
||||
```bash
|
||||
kubectl get configmap -n kt-event-marketing
|
||||
kubectl get secret -n kt-event-marketing
|
||||
```
|
||||
|
||||
**예상 출력**:
|
||||
```
|
||||
NAME DATA AGE
|
||||
cm-common 41 1m
|
||||
cm-user-service 18 1m
|
||||
cm-content-service 10 1m
|
||||
cm-event-service 11 1m
|
||||
cm-ai-service 39 1m
|
||||
|
||||
NAME TYPE DATA AGE
|
||||
kt-event-marketing kubernetes.io/dockerconfigjson 1 1m
|
||||
secret-common Opaque 2 1m
|
||||
secret-user-service Opaque 2 1m
|
||||
secret-content-service Opaque 3 1m
|
||||
secret-event-service Opaque 1 1m
|
||||
secret-ai-service Opaque 1 1m
|
||||
```
|
||||
|
||||
### 5.2 Service 확인
|
||||
```bash
|
||||
kubectl get svc -n kt-event-marketing
|
||||
```
|
||||
|
||||
**예상 출력**:
|
||||
```
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
user-service ClusterIP 10.0.x.x <none> 80/TCP 1m
|
||||
content-service ClusterIP 10.0.x.x <none> 80/TCP 1m
|
||||
event-service ClusterIP 10.0.x.x <none> 80/TCP 1m
|
||||
ai-service ClusterIP 10.0.x.x <none> 80/TCP 1m
|
||||
```
|
||||
|
||||
### 5.3 Deployment 확인
|
||||
```bash
|
||||
kubectl get deployment -n kt-event-marketing
|
||||
```
|
||||
|
||||
**예상 출력**:
|
||||
```
|
||||
NAME READY UP-TO-DATE AVAILABLE AGE
|
||||
user-service 1/1 1 1 1m
|
||||
content-service 1/1 1 1 1m
|
||||
event-service 1/1 1 1 1m
|
||||
ai-service 1/1 1 1 1m
|
||||
```
|
||||
|
||||
### 5.4 Pod 확인
|
||||
```bash
|
||||
kubectl get pods -n kt-event-marketing
|
||||
```
|
||||
|
||||
**예상 출력**:
|
||||
```
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
user-service-xxxxxxxxxx-xxxxx 1/1 Running 0 1m
|
||||
content-service-xxxxxxxxxx-xxxxx 1/1 Running 0 1m
|
||||
event-service-xxxxxxxxxx-xxxxx 1/1 Running 0 1m
|
||||
ai-service-xxxxxxxxxx-xxxxx 1/1 Running 0 1m
|
||||
```
|
||||
|
||||
### 5.5 Ingress 확인
|
||||
```bash
|
||||
kubectl get ingress -n kt-event-marketing
|
||||
```
|
||||
|
||||
**예상 출력**:
|
||||
```
|
||||
NAME CLASS HOSTS ADDRESS PORTS AGE
|
||||
kt-event-marketing nginx kt-event-marketing-api.20.214.196.128.nip.io 20.214.196.128 80 1m
|
||||
```
|
||||
|
||||
### 5.6 Pod 로그 확인
|
||||
```bash
|
||||
# user-service 로그
|
||||
kubectl logs -f deployment/user-service -n kt-event-marketing
|
||||
|
||||
# content-service 로그
|
||||
kubectl logs -f deployment/content-service -n kt-event-marketing
|
||||
|
||||
# event-service 로그
|
||||
kubectl logs -f deployment/event-service -n kt-event-marketing
|
||||
|
||||
# ai-service 로그
|
||||
kubectl logs -f deployment/ai-service -n kt-event-marketing
|
||||
```
|
||||
|
||||
### 5.7 Pod 상세 정보 확인
|
||||
```bash
|
||||
kubectl describe pod -l app=user-service -n kt-event-marketing
|
||||
kubectl describe pod -l app=content-service -n kt-event-marketing
|
||||
kubectl describe pod -l app=event-service -n kt-event-marketing
|
||||
kubectl describe pod -l app=ai-service -n kt-event-marketing
|
||||
```
|
||||
|
||||
## 6. API 테스트
|
||||
|
||||
### 6.1 Health Check
|
||||
```bash
|
||||
# user-service
|
||||
curl http://kt-event-marketing-api.20.214.196.128.nip.io/api/v1/users/profile
|
||||
|
||||
# content-service
|
||||
curl http://kt-event-marketing-api.20.214.196.128.nip.io/api/v1/content/images/jobs/test
|
||||
|
||||
# event-service
|
||||
curl http://kt-event-marketing-api.20.214.196.128.nip.io/api/v1/events
|
||||
|
||||
# ai-service
|
||||
curl http://kt-event-marketing-api.20.214.196.128.nip.io/api/v1/ai-service/health
|
||||
```
|
||||
|
||||
### 6.2 Actuator Health Check
|
||||
```bash
|
||||
# ClusterIP를 통한 내부 접근 테스트
|
||||
kubectl run curl-test --image=curlimages/curl -i --rm --restart=Never -n kt-event-marketing -- \
|
||||
curl http://user-service/actuator/health
|
||||
|
||||
kubectl run curl-test --image=curlimages/curl -i --rm --restart=Never -n kt-event-marketing -- \
|
||||
curl http://content-service/actuator/health
|
||||
|
||||
kubectl run curl-test --image=curlimages/curl -i --rm --restart=Never -n kt-event-marketing -- \
|
||||
curl http://event-service/actuator/health
|
||||
|
||||
kubectl run curl-test --image=curlimages/curl -i --rm --restart=Never -n kt-event-marketing -- \
|
||||
curl http://ai-service/actuator/health
|
||||
```
|
||||
|
||||
## 7. 체크리스트 검증 결과
|
||||
|
||||
### 7.1 객체 이름 네이밍 룰 준수 여부
|
||||
✅ **통과**
|
||||
- 공통 ConfigMap: `cm-common`
|
||||
- 공통 Secret: `secret-common`
|
||||
- 서비스별 ConfigMap: `cm-{서비스명}` (예: cm-user-service)
|
||||
- 서비스별 Secret: `secret-{서비스명}` (예: secret-user-service)
|
||||
- Ingress: `kt-event-marketing`
|
||||
- Service: `{서비스명}` (예: user-service)
|
||||
- Deployment: `{서비스명}` (예: user-service)
|
||||
|
||||
### 7.2 Redis Host명을 ClusterIP 타입의 Service 객체로 사용
|
||||
✅ **통과**
|
||||
- **사용 서비스**: `redis` (ClusterIP 타입)
|
||||
- **확인 명령**: `kubectl get svc | grep redis`
|
||||
- **설정 위치**: `deployment/k8s/common/cm-common.yaml`의 `REDIS_HOST: "redis"`
|
||||
|
||||
### 7.3 Database Host명을 ClusterIP 타입의 Service 객체로 사용
|
||||
✅ **통과**
|
||||
|
||||
**user-service**:
|
||||
- **사용 서비스**: `user-postgresql` (ClusterIP)
|
||||
- **확인 명령**: `kubectl get svc | grep user-postgresql`
|
||||
- **설정 위치**: `deployment/k8s/user-service/cm-user-service.yaml`의 `DB_HOST: "user-postgresql"`
|
||||
|
||||
**event-service**:
|
||||
- **사용 서비스**: `event-postgresql` (ClusterIP)
|
||||
- **확인 명령**: `kubectl get svc | grep event-postgresql`
|
||||
- **설정 위치**: `deployment/k8s/event-service/cm-event-service.yaml`의 `DB_HOST: "event-postgresql"`
|
||||
|
||||
### 7.4 Secret 매니페스트에서 'stringData' 사용
|
||||
✅ **통과**
|
||||
- 모든 Secret 매니페스트에서 `stringData` 사용 확인
|
||||
- `data` 필드 대신 `stringData` 사용으로 Base64 인코딩 불필요
|
||||
|
||||
**확인 파일**:
|
||||
- `deployment/k8s/common/secret-common.yaml`
|
||||
- `deployment/k8s/common/secret-imagepull.yaml`
|
||||
- `deployment/k8s/user-service/secret-user-service.yaml`
|
||||
- `deployment/k8s/content-service/secret-content-service.yaml`
|
||||
- `deployment/k8s/event-service/secret-event-service.yaml`
|
||||
- `deployment/k8s/ai-service/secret-ai-service.yaml`
|
||||
|
||||
### 7.5 JWT_SECRET을 openssl 명령으로 생성
|
||||
✅ **통과**
|
||||
- **생성 명령**: `openssl rand -base64 32`
|
||||
- **생성된 값**: `QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU=`
|
||||
- **설정 위치**: `deployment/k8s/common/secret-common.yaml`의 `JWT_SECRET`
|
||||
|
||||
### 7.6 매니페스트 파일에 환경변수 미사용, 실제 값 지정
|
||||
✅ **통과**
|
||||
- 모든 매니페스트에서 `${변수명}` 형태가 아닌 실제 값 사용
|
||||
- Ingress host: `kt-event-marketing-api.20.214.196.128.nip.io` (실제 IP 사용)
|
||||
|
||||
### 7.7 Image Pull Secret에 실제 USERNAME과 PASSWORD 지정
|
||||
✅ **통과**
|
||||
- **USERNAME**: `acrdigitalgarage01`
|
||||
- **PASSWORD**: `+OY+rmOagorjWvQe/tTk6oqvnZI8SmNbY/Y2o5EDcY+ACRDCDbYk`
|
||||
- **확인 명령**:
|
||||
```bash
|
||||
az acr credential show -n acrdigitalgarage01 --query "username" -o tsv
|
||||
az acr credential show -n acrdigitalgarage01 --query "passwords[0].value" -o tsv
|
||||
```
|
||||
- **설정 위치**: `deployment/k8s/common/secret-imagepull.yaml`
|
||||
|
||||
### 7.8 Image명 형식 확인
|
||||
✅ **통과**
|
||||
- **형식**: `{ACR명}.azurecr.io/{시스템명}/{서비스명}:latest`
|
||||
- **예시**:
|
||||
- `acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service:latest`
|
||||
- `acrdigitalgarage01.azurecr.io/kt-event-marketing/content-service:latest`
|
||||
- `acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service:latest`
|
||||
- `acrdigitalgarage01.azurecr.io/kt-event-marketing/ai-service:latest`
|
||||
|
||||
### 7.9 Ingress Controller External IP 확인 및 반영
|
||||
✅ **통과**
|
||||
- **확인 명령**: `kubectl get svc ingress-nginx-controller -n ingress-nginx`
|
||||
- **EXTERNAL-IP**: `20.214.196.128`
|
||||
- **Ingress host**: `kt-event-marketing-api.20.214.196.128.nip.io`
|
||||
- **설정 위치**: `deployment/k8s/common/ingress.yaml`
|
||||
|
||||
### 7.10 Ingress와 Service의 포트 일치 확인
|
||||
✅ **통과**
|
||||
- Ingress의 `backend.service.port.number`: **80**
|
||||
- Service의 `port`: **80**
|
||||
- 모든 서비스에서 일치 확인
|
||||
|
||||
### 7.11 Ingress path가 Controller @RequestMapping과 일치
|
||||
✅ **통과**
|
||||
|
||||
| 서비스 | Controller Path | Ingress Path |
|
||||
|--------|----------------|--------------|
|
||||
| user-service | @RequestMapping("/api/v1/users") | /api/v1/users |
|
||||
| content-service | @RequestMapping("/api/v1/content") | /api/v1/content |
|
||||
| event-service | @RequestMapping("/api/v1/events") | /api/v1/events |
|
||||
| ai-service | /api/v1/ai-service/health | /api/v1/ai-service |
|
||||
|
||||
### 7.12 보안 환경변수를 Secret으로 지정
|
||||
✅ **통과**
|
||||
|
||||
**공통 Secret** (secret-common):
|
||||
- REDIS_PASSWORD
|
||||
- JWT_SECRET
|
||||
|
||||
**서비스별 Secret**:
|
||||
- **user-service**: DB_PASSWORD, DB_URL
|
||||
- **content-service**: AZURE_STORAGE_CONNECTION_STRING, REPLICATE_API_TOKEN, HUGGINGFACE_API_TOKEN
|
||||
- **event-service**: DB_PASSWORD
|
||||
- **ai-service**: AI_CLAUDE_API_KEY
|
||||
|
||||
### 7.13 REDIS_DATABASE가 각 서비스마다 다르게 지정
|
||||
✅ **통과**
|
||||
|
||||
| 서비스 | Redis Database | 설정 위치 |
|
||||
|--------|---------------|-----------|
|
||||
| user-service | 0 | cm-user-service |
|
||||
| content-service | 1 | cm-content-service |
|
||||
| event-service | 2 | cm-event-service |
|
||||
| ai-service | 3 | cm-ai-service |
|
||||
|
||||
### 7.14 ConfigMap과 Secret을 envFrom으로 사용
|
||||
✅ **통과**
|
||||
- 모든 Deployment에서 `env` 대신 `envFrom` 사용
|
||||
- `configMapRef`와 `secretRef`로 ConfigMap과 Secret 참조
|
||||
|
||||
## 8. 실행 프로파일 환경변수 매핑 테이블
|
||||
|
||||
### 8.1 user-service 환경변수 매핑
|
||||
|
||||
| 환경변수명 | 값 | 지정 객체 | 비고 |
|
||||
|-----------|---|----------|------|
|
||||
| SERVER_PORT | 8081 | cm-user-service | |
|
||||
| DB_URL | jdbc:postgresql://user-postgresql:5432/userdb | cm-user-service | |
|
||||
| DB_DRIVER | org.postgresql.Driver | cm-user-service | |
|
||||
| DB_HOST | user-postgresql | cm-user-service | ClusterIP Service |
|
||||
| DB_PORT | 5432 | cm-user-service | |
|
||||
| DB_NAME | userdb | cm-user-service | |
|
||||
| DB_USERNAME | eventuser | cm-user-service | |
|
||||
| DB_PASSWORD | Hi5Jessica! | secret-user-service | Secret |
|
||||
| DB_KIND | postgresql | cm-user-service | |
|
||||
| DDL_AUTO | update | cm-common | |
|
||||
| SHOW_SQL | false | cm-common | |
|
||||
| JPA_DIALECT | org.hibernate.dialect.PostgreSQLDialect | cm-common | |
|
||||
| H2_CONSOLE_ENABLED | false | cm-common | |
|
||||
| REDIS_ENABLED | true | cm-common | |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP Service |
|
||||
| REDIS_PORT | 6379 | cm-common | |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | Secret |
|
||||
| REDIS_DATABASE | 0 | cm-user-service | |
|
||||
| EXCLUDE_REDIS | "" | cm-common | |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | |
|
||||
| KAFKA_CONSUMER_GROUP | user-service-consumers | cm-user-service | |
|
||||
| EXCLUDE_KAFKA | "" | cm-common | |
|
||||
| JWT_SECRET | QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU= | secret-common | Secret (openssl) |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,...,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | |
|
||||
| LOG_LEVEL_APP | INFO | cm-common | |
|
||||
| LOG_LEVEL_WEB | INFO | cm-common | |
|
||||
| LOG_LEVEL_SQL | WARN | cm-common | |
|
||||
| LOG_LEVEL_SQL_TYPE | WARN | cm-common | |
|
||||
| LOG_FILE_PATH | logs/user-service.log | cm-user-service | |
|
||||
| DB_POOL_MAX | 20 | cm-user-service | |
|
||||
| DB_POOL_MIN | 5 | cm-user-service | |
|
||||
| DB_CONN_TIMEOUT | 30000 | cm-user-service | |
|
||||
| DB_IDLE_TIMEOUT | 600000 | cm-user-service | |
|
||||
| DB_MAX_LIFETIME | 1800000 | cm-user-service | |
|
||||
| DB_LEAK_THRESHOLD | 60000 | cm-user-service | |
|
||||
|
||||
### 8.2 content-service 환경변수 매핑
|
||||
|
||||
| 환경변수명 | 값 | 지정 객체 | 비고 |
|
||||
|-----------|---|----------|------|
|
||||
| SERVER_PORT | 8084 | cm-content-service | |
|
||||
| REDIS_ENABLED | true | cm-common | |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP Service |
|
||||
| REDIS_PORT | 6379 | cm-common | |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | Secret |
|
||||
| REDIS_DATABASE | 1 | cm-content-service | |
|
||||
| JWT_SECRET | QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU= | secret-common | Secret |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | |
|
||||
| JWT_REFRESH_TOKEN_VALIDITY | 86400000 | cm-common | |
|
||||
| AZURE_STORAGE_CONNECTION_STRING | DefaultEndpointsProtocol=https;... | secret-content-service | Secret |
|
||||
| AZURE_CONTAINER_NAME | content-images | cm-content-service | |
|
||||
| REPLICATE_API_URL | https://api.replicate.com | cm-content-service | |
|
||||
| REPLICATE_API_TOKEN | "" | secret-content-service | Secret (empty) |
|
||||
| REPLICATE_MODEL_VERSION | stability-ai/sdxl:... | cm-content-service | |
|
||||
| HUGGINGFACE_API_URL | https://api-inference.huggingface.co | cm-content-service | |
|
||||
| HUGGINGFACE_API_TOKEN | "" | secret-content-service | Secret (empty) |
|
||||
| HUGGINGFACE_MODEL | runwayml/stable-diffusion-v1-5 | cm-content-service | |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,...,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | |
|
||||
| LOG_LEVEL_APP | INFO | cm-common | |
|
||||
| LOG_LEVEL_WEB | INFO | cm-common | |
|
||||
| LOG_LEVEL_ROOT | INFO | cm-common | |
|
||||
| LOG_FILE_PATH | logs/content-service.log | cm-content-service | |
|
||||
| LOG_FILE_MAX_SIZE | 10MB | cm-common | |
|
||||
| LOG_FILE_MAX_HISTORY | 7 | cm-common | |
|
||||
| LOG_FILE_TOTAL_CAP | 100MB | cm-common | |
|
||||
|
||||
### 8.3 event-service 환경변수 매핑
|
||||
|
||||
| 환경변수명 | 값 | 지정 객체 | 비고 |
|
||||
|-----------|---|----------|------|
|
||||
| SERVER_PORT | 8080 | cm-event-service | |
|
||||
| DB_HOST | event-postgresql | cm-event-service | ClusterIP Service |
|
||||
| DB_PORT | 5432 | cm-event-service | |
|
||||
| DB_NAME | eventdb | cm-event-service | |
|
||||
| DB_USERNAME | eventuser | cm-event-service | |
|
||||
| DB_PASSWORD | Hi5Jessica! | secret-event-service | Secret |
|
||||
| DDL_AUTO | update | cm-common | |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP Service |
|
||||
| REDIS_PORT | 6379 | cm-common | |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | Secret |
|
||||
| REDIS_DATABASE | 2 | cm-event-service | |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | |
|
||||
| KAFKA_CONSUMER_GROUP | event-service-consumers | cm-event-service | |
|
||||
| CONTENT_SERVICE_URL | http://content-service | cm-event-service | |
|
||||
| DISTRIBUTION_SERVICE_URL | http://distribution-service | cm-event-service | |
|
||||
| JWT_SECRET | QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU= | secret-common | Secret |
|
||||
| LOG_LEVEL | INFO | cm-event-service | |
|
||||
| SQL_LOG_LEVEL | WARN | cm-event-service | |
|
||||
| LOG_FILE | logs/event-service.log | cm-event-service | |
|
||||
|
||||
### 8.4 ai-service 환경변수 매핑
|
||||
|
||||
| 환경변수명 | 값 | 지정 객체 | 비고 |
|
||||
|-----------|---|----------|------|
|
||||
| SERVER_PORT | 8083 | cm-ai-service | |
|
||||
| REDIS_HOST | redis | cm-common | ClusterIP Service |
|
||||
| REDIS_PORT | 6379 | cm-common | |
|
||||
| REDIS_PASSWORD | Hi5Jessica! | secret-common | Secret |
|
||||
| REDIS_DATABASE | 3 | cm-ai-service | |
|
||||
| REDIS_TIMEOUT | 3000 | cm-ai-service | |
|
||||
| REDIS_POOL_MIN | 2 | cm-ai-service | |
|
||||
| KAFKA_BOOTSTRAP_SERVERS | 20.249.182.13:9095,4.217.131.59:9095 | cm-common | |
|
||||
| KAFKA_CONSUMER_GROUP | ai-service-consumers | cm-ai-service | |
|
||||
| KAFKA_TOPICS_AI_JOB | ai-event-generation-job | cm-ai-service | |
|
||||
| KAFKA_TOPICS_AI_JOB_DLQ | ai-event-generation-job-dlq | cm-ai-service | |
|
||||
| JWT_SECRET | QL0czzXckz18kHnxpaTDoWFkq+3qKO7VQXeNvf2bOoU= | secret-common | Secret |
|
||||
| JWT_ACCESS_TOKEN_VALIDITY | 604800000 | cm-common | |
|
||||
| JWT_REFRESH_TOKEN_VALIDITY | 86400000 | cm-common | |
|
||||
| CORS_ALLOWED_ORIGINS | http://localhost:8081,...,http://kt-event-marketing.20.214.196.128.nip.io | cm-common | |
|
||||
| CORS_ALLOWED_METHODS | GET,POST,PUT,DELETE,OPTIONS,PATCH | cm-common | |
|
||||
| CORS_ALLOWED_HEADERS | "*" | cm-common | |
|
||||
| CORS_ALLOW_CREDENTIALS | true | cm-common | |
|
||||
| CORS_MAX_AGE | 3600 | cm-common | |
|
||||
| AI_PROVIDER | CLAUDE | cm-ai-service | |
|
||||
| AI_CLAUDE_API_URL | https://api.anthropic.com/v1/messages | cm-ai-service | |
|
||||
| AI_CLAUDE_API_KEY | sk-ant-api03-mLtyNZ... | secret-ai-service | Secret |
|
||||
| AI_CLAUDE_ANTHROPIC_VERSION | 2023-06-01 | cm-ai-service | |
|
||||
| AI_CLAUDE_MODEL | claude-sonnet-4-5-20250929 | cm-ai-service | |
|
||||
| AI_CLAUDE_MAX_TOKENS | 4096 | cm-ai-service | |
|
||||
| AI_CLAUDE_TEMPERATURE | 0.7 | cm-ai-service | |
|
||||
| AI_CLAUDE_TIMEOUT | 300000 | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_FAILURE_RATE_THRESHOLD | 50 | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_RATE_THRESHOLD | 50 | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_SLOW_CALL_DURATION_THRESHOLD | 60s | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_PERMITTED_CALLS_HALF_OPEN | 3 | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_SLIDING_WINDOW_SIZE | 10 | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_MINIMUM_CALLS | 5 | cm-ai-service | |
|
||||
| RESILIENCE4J_CIRCUITBREAKER_WAIT_DURATION_OPEN | 60s | cm-ai-service | |
|
||||
| RESILIENCE4J_TIMELIMITER_TIMEOUT_DURATION | 300s | cm-ai-service | |
|
||||
| CACHE_TTL_RECOMMENDATION | 86400 | cm-ai-service | |
|
||||
| CACHE_TTL_JOB_STATUS | 86400 | cm-ai-service | |
|
||||
| CACHE_TTL_TREND | 3600 | cm-ai-service | |
|
||||
| CACHE_TTL_FALLBACK | 604800 | cm-ai-service | |
|
||||
| LOG_LEVEL_ROOT | INFO | cm-ai-service | |
|
||||
| LOG_LEVEL_AI | DEBUG | cm-ai-service | |
|
||||
| LOG_LEVEL_KAFKA | INFO | cm-ai-service | |
|
||||
| LOG_LEVEL_REDIS | INFO | cm-ai-service | |
|
||||
| LOG_LEVEL_RESILIENCE4J | DEBUG | cm-ai-service | |
|
||||
| LOG_FILE_NAME | logs/ai-service.log | cm-ai-service | |
|
||||
| LOG_FILE_MAX_SIZE | 10MB | cm-ai-service | |
|
||||
| LOG_FILE_MAX_HISTORY | 7 | cm-ai-service | |
|
||||
| LOG_FILE_TOTAL_CAP | 100MB | cm-ai-service | |
|
||||
|
||||
## 9. 트러블슈팅
|
||||
|
||||
### 9.1 Pod가 ImagePullBackOff 상태인 경우
|
||||
```bash
|
||||
# ImagePullSecret 확인
|
||||
kubectl get secret kt-event-marketing -n kt-event-marketing -o yaml
|
||||
|
||||
# Pod 이벤트 확인
|
||||
kubectl describe pod -l app=user-service -n kt-event-marketing
|
||||
```
|
||||
|
||||
**해결 방법**:
|
||||
1. ACR 자격 증명 재확인
|
||||
2. ImagePullSecret 재생성
|
||||
3. Deployment 재배포
|
||||
|
||||
### 9.2 Pod가 CrashLoopBackOff 상태인 경우
|
||||
```bash
|
||||
# Pod 로그 확인
|
||||
kubectl logs -l app=user-service -n kt-event-marketing --tail=100
|
||||
|
||||
# 이전 컨테이너 로그 확인
|
||||
kubectl logs -l app=user-service -n kt-event-marketing --previous
|
||||
```
|
||||
|
||||
**일반적인 원인**:
|
||||
- 데이터베이스 연결 실패
|
||||
- Redis 연결 실패
|
||||
- 환경변수 설정 오류
|
||||
- 애플리케이션 시작 오류
|
||||
|
||||
### 9.3 Ingress를 통한 접근이 안되는 경우
|
||||
```bash
|
||||
# Ingress 상태 확인
|
||||
kubectl describe ingress kt-event-marketing -n kt-event-marketing
|
||||
|
||||
# Ingress Controller 로그 확인
|
||||
kubectl logs -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx
|
||||
```
|
||||
|
||||
**확인 사항**:
|
||||
1. Ingress host가 올바른지 확인
|
||||
2. Service가 정상적으로 동작하는지 확인
|
||||
3. Service selector와 Pod label이 일치하는지 확인
|
||||
|
||||
### 9.4 데이터베이스 연결 실패
|
||||
```bash
|
||||
# PostgreSQL 서비스 확인
|
||||
kubectl get svc | grep postgresql
|
||||
|
||||
# Pod 내부에서 데이터베이스 연결 테스트
|
||||
kubectl exec -it deployment/user-service -n kt-event-marketing -- /bin/sh
|
||||
# 컨테이너 내부에서
|
||||
nc -zv user-postgresql 5432
|
||||
```
|
||||
|
||||
### 9.5 Redis 연결 실패
|
||||
```bash
|
||||
# Redis 서비스 확인
|
||||
kubectl get svc | grep redis
|
||||
|
||||
# Pod 내부에서 Redis 연결 테스트
|
||||
kubectl exec -it deployment/user-service -n kt-event-marketing -- /bin/sh
|
||||
# 컨테이너 내부에서
|
||||
nc -zv redis 6379
|
||||
```
|
||||
|
||||
## 10. 삭제 및 재배포
|
||||
|
||||
### 10.1 특정 서비스 삭제
|
||||
```bash
|
||||
# user-service 삭제
|
||||
kubectl delete -f deployment/k8s/user-service/
|
||||
|
||||
# content-service 삭제
|
||||
kubectl delete -f deployment/k8s/content-service/
|
||||
|
||||
# event-service 삭제
|
||||
kubectl delete -f deployment/k8s/event-service/
|
||||
|
||||
# ai-service 삭제
|
||||
kubectl delete -f deployment/k8s/ai-service/
|
||||
```
|
||||
|
||||
### 10.2 전체 삭제
|
||||
```bash
|
||||
# 모든 서비스 삭제
|
||||
kubectl delete -f deployment/k8s/user-service/
|
||||
kubectl delete -f deployment/k8s/content-service/
|
||||
kubectl delete -f deployment/k8s/event-service/
|
||||
kubectl delete -f deployment/k8s/ai-service/
|
||||
|
||||
# 공통 리소스 삭제
|
||||
kubectl delete -f deployment/k8s/common/
|
||||
```
|
||||
|
||||
### 10.3 Namespace 전체 삭제 (주의!)
|
||||
```bash
|
||||
# ⚠️ 주의: Namespace를 삭제하면 모든 리소스가 삭제됩니다
|
||||
kubectl delete namespace kt-event-marketing
|
||||
```
|
||||
|
||||
## 11. 참고 사항
|
||||
|
||||
### 11.1 리소스 제한
|
||||
- **CPU 요청**: 256m (0.25 코어)
|
||||
- **CPU 제한**: 1024m (1 코어)
|
||||
- **메모리 요청**: 256Mi
|
||||
- **메모리 제한**: 1024Mi
|
||||
|
||||
필요에 따라 `deployment.yaml`의 `resources` 섹션을 수정하여 조정할 수 있습니다.
|
||||
|
||||
### 11.2 Probe 설정
|
||||
- **StartupProbe**: 초기 시작 확인 (최대 300초)
|
||||
- **ReadinessProbe**: 트래픽 수신 준비 확인
|
||||
- **LivenessProbe**: 컨테이너 생존 확인
|
||||
|
||||
### 11.3 Auto Scaling (추후 적용)
|
||||
HPA (Horizontal Pod Autoscaler) 설정 예시:
|
||||
```bash
|
||||
kubectl autoscale deployment user-service \
|
||||
--cpu-percent=70 \
|
||||
--min=1 \
|
||||
--max=5 \
|
||||
-n kt-event-marketing
|
||||
```
|
||||
|
||||
### 11.4 보안 강화
|
||||
- Secret 암호화: Sealed Secrets 또는 External Secrets Operator 사용 권장
|
||||
- Network Policy: Pod 간 통신 제어
|
||||
- RBAC: 적절한 권한 설정
|
||||
|
||||
## 12. 문의 및 지원
|
||||
|
||||
배포 중 문제가 발생하면 다음 정보를 포함하여 문의하세요:
|
||||
1. Pod 상태: `kubectl get pods -n kt-event-marketing`
|
||||
2. Pod 로그: `kubectl logs <pod-name> -n kt-event-marketing`
|
||||
3. Pod 이벤트: `kubectl describe pod <pod-name> -n kt-event-marketing`
|
||||
4. Ingress 상태: `kubectl describe ingress kt-event-marketing -n kt-event-marketing`
|
||||
@@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-distribution-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8085"
|
||||
|
||||
# Database Configuration
|
||||
DB_HOST: "distribution-postgresql"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "distributiondb"
|
||||
DB_USERNAME: "eventuser"
|
||||
|
||||
# Kafka Configuration
|
||||
KAFKA_ENABLED: "true"
|
||||
KAFKA_CONSUMER_GROUP: "distribution-service"
|
||||
|
||||
# External Channel APIs
|
||||
URIDONGNETV_API_URL: "http://localhost:9001/api/uridongnetv"
|
||||
RINGOBIZ_API_URL: "http://localhost:9002/api/ringobiz"
|
||||
GINITV_API_URL: "http://localhost:9003/api/ginitv"
|
||||
INSTAGRAM_API_URL: "http://localhost:9004/api/instagram"
|
||||
NAVER_API_URL: "http://localhost:9005/api/naver"
|
||||
KAKAO_API_URL: "http://localhost:9006/api/kakao"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_FILE: "logs/distribution-service.log"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: distribution-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: distribution-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: distribution-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: distribution-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: distribution-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/distribution-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8085
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-distribution-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-distribution-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8085
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8085
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8085
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-distribution-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_PASSWORD: "Hi5Jessica!"
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: distribution-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: distribution-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: distribution-service
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 8085
|
||||
protocol: TCP
|
||||
@@ -0,0 +1,29 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-event-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8080"
|
||||
|
||||
# Database Configuration
|
||||
DB_HOST: "event-postgresql"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "eventdb"
|
||||
DB_USERNAME: "eventuser"
|
||||
|
||||
# Redis Configuration (service-specific)
|
||||
REDIS_DATABASE: "2"
|
||||
|
||||
# Kafka Configuration (service-specific)
|
||||
KAFKA_CONSUMER_GROUP: "event-service-consumers"
|
||||
|
||||
# Service URLs
|
||||
CONTENT_SERVICE_URL: "http://content-service"
|
||||
DISTRIBUTION_SERVICE_URL: "http://distribution-service"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_LEVEL: "INFO"
|
||||
SQL_LOG_LEVEL: "WARN"
|
||||
LOG_FILE: "logs/event-service.log"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: event-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: event-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: event-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: event-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: event-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/event-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-event-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-event-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8080
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8080
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8080
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-event-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Database Password
|
||||
DB_PASSWORD: "Hi5Jessica!"
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: event-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: event-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: event-service
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-participation-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8084"
|
||||
|
||||
# Database Configuration
|
||||
DB_HOST: "participation-postgresql"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "participationdb"
|
||||
DB_USERNAME: "eventuser"
|
||||
|
||||
# Redis Configuration (service-specific)
|
||||
REDIS_DATABASE: "4"
|
||||
|
||||
# Kafka Configuration (service-specific)
|
||||
KAFKA_CONSUMER_GROUP: "participation-service-consumers"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_LEVEL: "INFO"
|
||||
SHOW_SQL: "false"
|
||||
LOG_FILE: "logs/participation-service.log"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: participation-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: participation-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: participation-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: participation-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: participation-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/participation-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8084
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-participation-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-participation-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8084
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8084
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8084
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-participation-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_PASSWORD: "Hi5Jessica!"
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: participation-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: participation-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8084
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: participation-service
|
||||
@@ -0,0 +1,32 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-user-service
|
||||
namespace: kt-event-marketing
|
||||
data:
|
||||
# Server Configuration
|
||||
SERVER_PORT: "8081"
|
||||
|
||||
# Database Configuration
|
||||
DB_URL: "jdbc:postgresql://user-postgresql:5432/userdb"
|
||||
DB_HOST: "user-postgresql"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "userdb"
|
||||
DB_USERNAME: "eventuser"
|
||||
DB_DRIVER: "org.postgresql.Driver"
|
||||
DB_KIND: "postgresql"
|
||||
DB_POOL_MAX: "20"
|
||||
DB_POOL_MIN: "5"
|
||||
DB_CONN_TIMEOUT: "30000"
|
||||
DB_IDLE_TIMEOUT: "600000"
|
||||
DB_MAX_LIFETIME: "1800000"
|
||||
DB_LEAK_THRESHOLD: "60000"
|
||||
|
||||
# Redis Configuration (service-specific)
|
||||
REDIS_DATABASE: "0"
|
||||
|
||||
# Kafka Configuration (service-specific)
|
||||
KAFKA_CONSUMER_GROUP: "user-service-consumers"
|
||||
|
||||
# Logging Configuration
|
||||
LOG_FILE_PATH: "logs/user-service.log"
|
||||
@@ -0,0 +1,63 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: user-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: user-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: user-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: user-service
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: kt-event-marketing
|
||||
containers:
|
||||
- name: user-service
|
||||
image: acrdigitalgarage01.azurecr.io/kt-event-marketing/user-service:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8081
|
||||
name: http
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: cm-common
|
||||
- configMapRef:
|
||||
name: cm-user-service
|
||||
- secretRef:
|
||||
name: secret-common
|
||||
- secretRef:
|
||||
name: secret-user-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "256m"
|
||||
memory: "256Mi"
|
||||
limits:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8081
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/readiness
|
||||
port: 8081
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
failureThreshold: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health/liveness
|
||||
port: 8081
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
failureThreshold: 3
|
||||
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-user-service
|
||||
namespace: kt-event-marketing
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Database Password
|
||||
DB_PASSWORD: "Hi5Jessica!"
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: user-service
|
||||
namespace: kt-event-marketing
|
||||
labels:
|
||||
app: user-service
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8081
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: user-service
|
||||
Reference in New Issue
Block a user