This commit is contained in:
ondal 2025-06-16 13:36:14 +09:00
parent 59b01d9630
commit a2a7daf6f6
5 changed files with 0 additions and 285 deletions

View File

@ -1,78 +0,0 @@
# deployment/manifests/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: kakao-review-api-config
data:
# 애플리케이션 설정
APP_TITLE: "카카오맵 리뷰 분석 API"
APP_VERSION: "1.0.1"
APP_DESCRIPTION: "교육 목적 전용 - 실제 서비스 사용 금지"
# 서버 설정
HOST: "0.0.0.0"
PORT: "8000"
WORKERS: "1"
LOG_LEVEL: "info"
# API 기본값 설정 (AKS 환경에 최적화)
DEFAULT_MAX_TIME: "300"
DEFAULT_DAYS_LIMIT: "60"
MAX_DAYS_LIMIT: "365"
MIN_MAX_TIME: "60"
MAX_MAX_TIME: "600"
# 🔧 Chrome 브라우저 설정 (AKS 환경 최적화)
CHROME_OPTIONS: |
--headless=new
--no-sandbox
--disable-dev-shm-usage
--disable-gpu
--disable-software-rasterizer
--window-size=1920,1080
--disable-extensions
--disable-plugins
--disable-usb-keyboard-detect
--no-first-run
--no-default-browser-check
--disable-logging
--log-level=3
--disable-background-timer-throttling
--disable-backgrounding-occluded-windows
--disable-renderer-backgrounding
--disable-features=TranslateUI,VizDisplayCompositor
--disable-ipc-flooding-protection
--memory-pressure-off
--max_old_space_size=4096
--no-zygote
--disable-setuid-sandbox
--disable-background-networking
--disable-default-apps
--disable-sync
--metrics-recording-only
--safebrowsing-disable-auto-update
--disable-prompt-on-repost
--disable-hang-monitor
--disable-client-side-phishing-detection
--disable-component-update
--disable-domain-reliability
--user-data-dir=/tmp/chrome-user-data
--data-path=/tmp/chrome-user-data
--disk-cache-dir=/tmp/chrome-cache
--aggressive-cache-discard
--disable-web-security
--allow-running-insecure-content
--disable-blink-features=AutomationControlled
# 스크롤링 설정 (AKS 환경에 맞게 조정)
SCROLL_CHECK_INTERVAL: "5"
SCROLL_NO_CHANGE_LIMIT: "6"
SCROLL_WAIT_TIME_SHORT: "2.0"
SCROLL_WAIT_TIME_LONG: "3.0"
# 법적 경고 메시지
LEGAL_WARNING_ENABLED: "true"
CONTACT_EMAIL: "admin@example.com"
# 건강 체크 설정
HEALTH_CHECK_TIMEOUT: "10"

View File

@ -1,130 +0,0 @@
# deployment/manifests/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kakao-review-api
labels:
app: kakao-review-api
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: kakao-review-api
template:
metadata:
labels:
app: kakao-review-api
version: v1
spec:
imagePullSecrets:
- name: acr-secret
containers:
- name: api
image: acrdigitalgarage03.azurecr.io/kakao-review-api:latest
imagePullPolicy: Always
ports:
- containerPort: 19000
name: http
# 🔧 ConfigMap 환경 변수
envFrom:
- configMapRef:
name: kakao-review-api-config
# 🔧 Secret 환경 변수
env:
- name: EXTERNAL_API_KEY
valueFrom:
secretKeyRef:
name: kakao-review-api-secret
key: EXTERNAL_API_KEY
- name: DB_USERNAME
valueFrom:
secretKeyRef:
name: kakao-review-api-secret
key: DB_USERNAME
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: kakao-review-api-secret
key: DB_PASSWORD
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: kakao-review-api-secret
key: JWT_SECRET
# 🔧 Chrome/ChromeDriver 환경 변수 (VM과 동일)
- name: WDM_LOCAL
value: "/tmp/.wdm"
- name: WDM_LOG_LEVEL
value: "0"
- name: CHROME_BIN
value: "/usr/bin/google-chrome"
- name: CHROMEDRIVER_BIN
value: "/usr/local/bin/chromedriver"
- name: DISPLAY
value: ":99"
- name: DBUS_SESSION_BUS_ADDRESS
value: "/dev/null"
# 🔧 리소스 제한 (Chrome 실행에 충분한 리소스)
resources:
requests:
memory: "2Gi"
cpu: "1000m"
limits:
memory: "4Gi"
cpu: "2000m"
# 🔧 헬스 체크 (타임아웃 증가)
livenessProbe:
httpGet:
path: /health
port: 19000
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 15
failureThreshold: 5
readinessProbe:
httpGet:
path: /health
port: 19000
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 10
failureThreshold: 5
# 🔧 간소화된 보안 컨텍스트 (AKS 호환)
securityContext:
runAsNonRoot: false
runAsUser: 0
allowPrivilegeEscalation: true
readOnlyRootFilesystem: false
capabilities:
add:
- SYS_ADMIN
drop: []
# 🔧 볼륨 마운트 (Chrome 실행 최적화)
volumeMounts:
- name: tmp-volume
mountPath: /tmp
- name: dev-shm
mountPath: /dev/shm
# 🔧 볼륨 정의 (간소화)
volumes:
- name: tmp-volume
emptyDir: {}
- name: dev-shm
emptyDir:
medium: Memory
sizeLimit: 2Gi
restartPolicy: Always
# 🔧 Pod 레벨 보안 설정 제거 (AKS 호환을 위해)
# securityContext: 제거

View File

@ -1,39 +0,0 @@
# deployment/manifests/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kakao-review-api-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-body-size: "10m"
# 🔧 타임아웃 설정 (Chrome 분석 시간 고려)
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
nginx.ingress.kubernetes.io/client-body-timeout: "1800"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"
# 🔧 CORS 설정 (필요시)
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "*"
nginx.ingress.kubernetes.io/cors-allow-methods: "GET, POST, OPTIONS"
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
spec:
ingressClassName: nginx
rules:
# 🔧 환경에 맞게 호스트명 수정 필요
- host: kakao-review-api.20.249.191.180.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kakao-review-api-service
port:
number: 80
# 🔧 TLS 설정 (HTTPS 필요시 주석 해제)
# tls:
# - hosts:
# - kakao-review-api.example.com
# secretName: kakao-review-api-tls

View File

@ -1,21 +0,0 @@
# deployment/manifests/secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: kakao-review-api-secret
type: Opaque
data:
# 🔧 현재 사용하지 않지만 향후 확장을 위한 플레이스홀더
# 실제 값 설정 시: echo -n "your-value" | base64
# API 키 (향후 카카오 공식 API 연동용)
EXTERNAL_API_KEY: ""
# 데이터베이스 연결 정보 (향후 DB 연동용)
DB_USERNAME: ""
DB_PASSWORD: ""
DB_HOST: ""
# JWT 시크릿 (향후 인증 기능용)
JWT_SECRET: ""

View File

@ -1,17 +0,0 @@
# deployment/manifests/service.yaml
apiVersion: v1
kind: Service
metadata:
name: kakao-review-api-service
labels:
app: kakao-review-api
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 19000
protocol: TCP
name: http
selector:
app: kakao-review-api