refactor: all

This commit is contained in:
OhSeongRak
2025-06-18 13:48:10 +09:00
parent ca1e7dbdf0
commit e6f2c3a810
6 changed files with 266 additions and 50 deletions
+38 -1
View File
@@ -5,6 +5,7 @@ metadata:
namespace: ${namespace}
labels:
app: smarketing-frontend
version: v1
spec:
replicas: ${replicas}
selector:
@@ -14,6 +15,7 @@ spec:
metadata:
labels:
app: smarketing-frontend
version: v1
spec:
imagePullSecrets:
- name: acr-secret
@@ -23,6 +25,7 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: ${export_port}
name: http
resources:
requests:
cpu: ${resources_requests_cpu}
@@ -34,19 +37,53 @@ spec:
- name: runtime-config
mountPath: /usr/share/nginx/html/runtime-env.js
subPath: runtime-env.js
readOnly: true
env:
- name: NGINX_PORT
value: "${export_port}"
livenessProbe:
httpGet:
path: /health
port: ${export_port}
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1
readinessProbe:
httpGet:
path: /health
port: ${export_port}
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
successThreshold: 1
# 시작 프로브 추가 (컨테이너 시작 시간이 오래 걸릴 수 있음)
startupProbe:
httpGet:
path: /health
port: ${export_port}
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 30
successThreshold: 1
volumes:
- name: runtime-config
configMap:
name: smarketing-frontend-config
name: smarketing-frontend-config
defaultMode: 0644
# 배포 전략 설정
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
# 재시작 정책
restartPolicy: Always
# DNS 정책
dnsPolicy: ClusterFirst
+2 -2
View File
@@ -8,14 +8,14 @@ data:
console.log('=== RUNTIME-ENV.JS 로드됨 (배포 환경) ===');
window.__runtime_config__ = {
// 백엔드 API 구조에 맞게 URL 설정
// 백엔드 API 구조에 맞게 URL 설정 - ingress host 사용
AUTH_URL: 'http://${ingress_host}/api/auth',
MEMBER_URL: 'http://${ingress_host}/api/member',
STORE_URL: 'http://${ingress_host}/api/store',
MENU_URL: 'http://${ingress_host}/api/menu',
SALES_URL: 'http://${ingress_host}/api/sales',
CONTENT_URL: 'http://${ingress_host}/api/content',
RECOMMEND_URL: 'http://${ingress_host}/api/recommendations',
RECOMMEND_URL: 'http://${ingress_host}/api/recommend',
// Gateway URL (운영 환경)
GATEWAY_URL: 'http://${ingress_host}',