hgzero/deploy/k8s/backend/ai-service.yaml
Minseo-Jo c9d24ce1af feat: AI 서비스 AKS 배포 준비 및 API 경로 수정
## API 경로 변경
- /api/v1/ai → /api/ai 로 경로 단순화
- 최종 엔드포인트: /api/ai/suggestions/meetings/{meetingId}/stream

## Docker 컨테이너화
- Dockerfile 작성 (Python 3.11 slim 기반)
- .dockerignore 추가
- 헬스 체크 포함

## Kubernetes 배포
- Deployment 및 Service 매니페스트 작성
- Replica: 1, Port: 8087
- Liveness/Readiness Probe 설정
- 리소스 제한: CPU 250m-1000m, Memory 512Mi-1024Mi

## Secret 및 ConfigMap
- ai-secret: Claude API Key
- azure-secret: Event Hub Connection String (AI Listen Policy)
- redis-config/redis-secret: Redis 연결 정보

## Ingress 설정
- /api/ai/suggestions 경로 추가 (ai-service:8087)
- 기존 /api/ai 경로 유지 (ai:8080)

## 배포 문서
- DEPLOYMENT.md: 상세한 AKS 배포 가이드
  - Docker 이미지 빌드 및 푸시
  - Secret/ConfigMap 생성
  - 배포 및 검증
  - 트러블슈팅

## ACR 이미지
- acrdigitalgarage02.azurecr.io/hgzero/ai-service:latest

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 17:08:28 +09:00

131 lines
2.8 KiB
YAML

---
# AI Service (Python) Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-service
namespace: hgzero
labels:
app: ai-service
tier: backend
language: python
spec:
replicas: 1
selector:
matchLabels:
app: ai-service
template:
metadata:
labels:
app: ai-service
tier: backend
language: python
spec:
containers:
- name: ai-service
image: acrdigitalgarage02.azurecr.io/hgzero/ai-service:latest
imagePullPolicy: Always
ports:
- containerPort: 8087
name: http
env:
# 서버 설정
- name: PORT
value: "8087"
- name: HOST
value: "0.0.0.0"
- name: LOG_LEVEL
value: "INFO"
# Claude API
- name: CLAUDE_API_KEY
valueFrom:
secretKeyRef:
name: ai-secret
key: claude-api-key
- name: CLAUDE_MODEL
value: "claude-3-5-sonnet-20241022"
- name: CLAUDE_MAX_TOKENS
value: "2000"
- name: CLAUDE_TEMPERATURE
value: "0.3"
# Redis
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: redis-config
key: host
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: redis-config
key: port
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-secret
key: password
- name: REDIS_DB
value: "4"
# Azure Event Hub
- name: EVENTHUB_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: azure-secret
key: eventhub-ai-connection-string
- name: EVENTHUB_NAME
value: "hgzero-eventhub-name"
- name: EVENTHUB_CONSUMER_GROUP
value: "$Default"
# CORS
- name: CORS_ORIGINS
value: '["*"]'
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
livenessProbe:
httpGet:
path: /health
port: 8087
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 8087
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
---
# AI Service Service
apiVersion: v1
kind: Service
metadata:
name: ai-service
namespace: hgzero
labels:
app: ai-service
spec:
type: ClusterIP
ports:
- port: 8087
targetPort: 8087
protocol: TCP
name: http
selector:
app: ai-service