release
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# deployment/manifests/configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: restaurant-api-config
|
||||
data:
|
||||
# 애플리케이션 설정
|
||||
APP_TITLE: "카카오 API 기반 음식점 수집 서비스"
|
||||
APP_VERSION: "1.0.0"
|
||||
APP_DESCRIPTION: "카카오 로컬 API를 활용한 음식점 정보 수집 시스템"
|
||||
|
||||
# 서버 설정
|
||||
HOST: "0.0.0.0"
|
||||
PORT: "18000"
|
||||
LOG_LEVEL: "info"
|
||||
|
||||
# 카카오 API 설정
|
||||
KAKAO_API_URL: "https://dapi.kakao.com/v2/local/search/keyword.json"
|
||||
|
||||
# 검색 기본값
|
||||
DEFAULT_QUERY: "음식점"
|
||||
DEFAULT_REGION: "서울"
|
||||
DEFAULT_SIZE: "15"
|
||||
MAX_SIZE: "15"
|
||||
MAX_PAGES: "45"
|
||||
|
||||
# 파일 설정
|
||||
OUTPUT_FILE: "restaurant.json"
|
||||
DATA_DIR: "/app/data"
|
||||
|
||||
# 요청 제한 설정
|
||||
REQUEST_DELAY: "0.1"
|
||||
REQUEST_TIMEOUT: "30"
|
||||
HEALTH_CHECK_TIMEOUT: "10"
|
||||
@@ -0,0 +1,81 @@
|
||||
# deployment/manifests/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: restaurant-api
|
||||
labels:
|
||||
app: restaurant-api
|
||||
version: v1
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: restaurant-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: restaurant-api
|
||||
version: v1
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
containers:
|
||||
- name: api
|
||||
image: acrdigitalgarage03.azurecr.io/restaurant-api:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 18000
|
||||
name: http
|
||||
|
||||
# ConfigMap 환경 변수
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: restaurant-api-config
|
||||
|
||||
# Secret 환경 변수
|
||||
env:
|
||||
- name: KAKAO_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: restaurant-api-secret
|
||||
key: KAKAO_API_KEY
|
||||
|
||||
# 리소스 제한
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "500m"
|
||||
|
||||
# 헬스 체크
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 18000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 30
|
||||
timeoutSeconds: 10
|
||||
failureThreshold: 3
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 18000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
|
||||
# 볼륨 마운트 (데이터 저장용)
|
||||
volumeMounts:
|
||||
- name: data-volume
|
||||
mountPath: /app/data
|
||||
|
||||
# 볼륨 정의
|
||||
volumes:
|
||||
- name: data-volume
|
||||
emptyDir: {}
|
||||
|
||||
restartPolicy: Always
|
||||
@@ -0,0 +1,38 @@
|
||||
# deployment/manifests/ingress.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: restaurant-api-ingress
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: "10m"
|
||||
# 타임아웃 설정 (API 수집 시간 고려)
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
|
||||
nginx.ingress.kubernetes.io/client-body-timeout: "300"
|
||||
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: restaurant-api.20.249.191.180.nip.io
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: restaurant-api-service
|
||||
port:
|
||||
number: 80
|
||||
# TLS 설정 (HTTPS 필요시 주석 해제)
|
||||
# tls:
|
||||
# - hosts:
|
||||
# - restaurant-api.example.com
|
||||
# secretName: restaurant-api-tls
|
||||
@@ -0,0 +1,10 @@
|
||||
# deployment/manifests/secret.yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: restaurant-api-secret
|
||||
type: Opaque
|
||||
data:
|
||||
# 카카오 API 키 (Base64 인코딩 필요)
|
||||
# echo -n "5cdc24407edbf8544f3954cfaa4650c6" | base64
|
||||
KAKAO_API_KEY: NWNkYzI0NDA3ZWRiZjg1NDRmMzk1NGNmYWE0NjUwYzY=
|
||||
@@ -0,0 +1,16 @@
|
||||
# deployment/manifests/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: restaurant-api-service
|
||||
labels:
|
||||
app: restaurant-api
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 18000
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: restaurant-api
|
||||
Reference in New Issue
Block a user