mirror of
https://github.com/won-ktds/smarketing-backend.git
synced 2026-06-12 20:39:09 +00:00
release
This commit is contained in:
+217
@@ -0,0 +1,217 @@
|
||||
def PIPELINE_ID = "${env.BUILD_NUMBER}"
|
||||
|
||||
def getImageTag() {
|
||||
def dateFormat = new java.text.SimpleDateFormat('yyyyMMddHHmmss')
|
||||
def currentDate = new Date()
|
||||
return dateFormat.format(currentDate)
|
||||
}
|
||||
|
||||
podTemplate(
|
||||
label: "${PIPELINE_ID}",
|
||||
serviceAccount: 'jenkins',
|
||||
containers: [
|
||||
containerTemplate(name: 'gradle', image: 'gradle:jdk17', ttyEnabled: true, command: 'cat'),
|
||||
containerTemplate(name: 'docker', image: 'docker:20.10.16-dind', ttyEnabled: true, privileged: true),
|
||||
containerTemplate(name: 'azure-cli', image: 'hiondal/azure-kubectl:latest', command: 'cat', ttyEnabled: true),
|
||||
containerTemplate(name: 'envsubst', image: "hiondal/envsubst", command: 'sleep', args: '1h')
|
||||
],
|
||||
volumes: [
|
||||
emptyDirVolume(mountPath: '/home/gradle/.gradle', memory: false),
|
||||
emptyDirVolume(mountPath: '/root/.azure', memory: false),
|
||||
emptyDirVolume(mountPath: '/var/run', memory: false)
|
||||
]
|
||||
) {
|
||||
node(PIPELINE_ID) {
|
||||
def props
|
||||
def imageTag = getImageTag()
|
||||
def manifest = "deploy.yaml"
|
||||
def namespace
|
||||
def services = ['member', 'store', 'marketing-content', 'ai-recommend']
|
||||
|
||||
stage("Get Source") {
|
||||
checkout scm
|
||||
|
||||
// smarketing-java 하위에 있는 설정 파일 읽기
|
||||
props = readProperties file: "smarketing-java/deployment/deploy_env_vars"
|
||||
namespace = "${props.namespace}"
|
||||
|
||||
echo "=== Build Information ==="
|
||||
echo "Services: ${services}"
|
||||
echo "Namespace: ${namespace}"
|
||||
echo "Image Tag: ${imageTag}"
|
||||
}
|
||||
|
||||
stage("Setup AKS") {
|
||||
container('azure-cli') {
|
||||
withCredentials([azureServicePrincipal('azure-credentials')]) {
|
||||
sh """
|
||||
echo "=== Azure 로그인 ==="
|
||||
az login --service-principal -u \$AZURE_CLIENT_ID -p \$AZURE_CLIENT_SECRET -t \$AZURE_TENANT_ID
|
||||
az account set --subscription 2513dd36-7978-48e3-9a7c-b221d4874f66
|
||||
|
||||
echo "=== AKS 인증정보 가져오기 ==="
|
||||
az aks get-credentials --resource-group rg-digitalgarage-01 --name aks-digitalgarage-01 --overwrite-existing
|
||||
|
||||
echo "=== 네임스페이스 생성 ==="
|
||||
kubectl create namespace ${namespace} --dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
echo "=== Image Pull Secret 생성 ==="
|
||||
kubectl create secret docker-registry acr-secret \\
|
||||
--docker-server=${props.registry} \\
|
||||
--docker-username=acrdigitalgarage02 \\
|
||||
--docker-password=\$(az acr credential show --name acrdigitalgarage02 --query passwords[0].value -o tsv) \\
|
||||
--namespace=${namespace} \\
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
echo "=== 클러스터 상태 확인 ==="
|
||||
kubectl get nodes
|
||||
kubectl get ns ${namespace}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Applications') {
|
||||
container('gradle') {
|
||||
sh """
|
||||
echo "=== smarketing-java 디렉토리로 이동 ==="
|
||||
cd smarketing-java
|
||||
|
||||
echo "=== gradlew 권한 설정 ==="
|
||||
chmod +x gradlew
|
||||
|
||||
echo "=== 전체 서비스 빌드 ==="
|
||||
./gradlew :member:clean :member:build -x test
|
||||
./gradlew :store:clean :store:build -x test
|
||||
./gradlew :marketing-content:clean :marketing-content:build -x test
|
||||
./gradlew :ai-recommend:clean :ai-recommend:build -x test
|
||||
|
||||
echo "=== 빌드 결과 확인 ==="
|
||||
find . -name "*.jar" -path "*/build/libs/*" | grep -v 'plain.jar'
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build & Push Images') {
|
||||
container('docker') {
|
||||
sh """
|
||||
echo "=== Docker 데몬 시작 대기 ==="
|
||||
timeout 30 sh -c 'until docker info; do sleep 1; done'
|
||||
"""
|
||||
|
||||
// 🔧 ACR Credential을 Jenkins에서 직접 사용
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'acr-credentials',
|
||||
usernameVariable: 'ACR_USERNAME',
|
||||
passwordVariable: 'ACR_PASSWORD'
|
||||
)]) {
|
||||
sh """
|
||||
echo "=== Docker로 ACR 로그인 ==="
|
||||
echo "\$ACR_PASSWORD" | docker login ${props.registry} --username \$ACR_USERNAME --password-stdin
|
||||
"""
|
||||
|
||||
services.each { service ->
|
||||
script {
|
||||
def buildDir = "smarketing-java/${service}"
|
||||
def fullImageName = "${props.registry}/${props.image_org}/${service}:${imageTag}"
|
||||
|
||||
echo "Building image for ${service}: ${fullImageName}"
|
||||
|
||||
// 실제 JAR 파일명 동적 탐지
|
||||
def actualJarFile = sh(
|
||||
script: """
|
||||
cd ${buildDir}/build/libs
|
||||
ls *.jar | grep -v 'plain.jar' | head -1
|
||||
""",
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
if (!actualJarFile) {
|
||||
error "${service} JAR 파일을 찾을 수 없습니다"
|
||||
}
|
||||
|
||||
echo "발견된 JAR 파일: ${actualJarFile}"
|
||||
|
||||
sh """
|
||||
echo "=== ${service} 이미지 빌드 ==="
|
||||
docker build \\
|
||||
--build-arg BUILD_LIB_DIR="${buildDir}/build/libs" \\
|
||||
--build-arg ARTIFACTORY_FILE="${actualJarFile}" \\
|
||||
-f smarketing-java/deployment/container/Dockerfile \\
|
||||
-t ${fullImageName} .
|
||||
|
||||
echo "=== ${service} 이미지 푸시 ==="
|
||||
docker push ${fullImageName}
|
||||
|
||||
echo "Successfully built and pushed: ${fullImageName}"
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Generate & Apply Manifest') {
|
||||
container('envsubst') {
|
||||
sh """
|
||||
echo "=== 환경변수 설정 ==="
|
||||
export namespace=${namespace}
|
||||
export allowed_origins=${props.allowed_origins}
|
||||
export jwt_secret_key=${props.jwt_secret_key}
|
||||
export postgres_user=${props.postgres_user}
|
||||
export postgres_password=${props.postgres_password}
|
||||
export replicas=${props.replicas}
|
||||
# 리소스 요구사항 조정 (작게)
|
||||
export resources_requests_cpu=100m
|
||||
export resources_requests_memory=128Mi
|
||||
export resources_limits_cpu=500m
|
||||
export resources_limits_memory=512Mi
|
||||
|
||||
# 이미지 경로 환경변수 설정
|
||||
export member_image_path=${props.registry}/${props.image_org}/member:${imageTag}
|
||||
export store_image_path=${props.registry}/${props.image_org}/store:${imageTag}
|
||||
export marketing_content_image_path=${props.registry}/${props.image_org}/marketing-content:${imageTag}
|
||||
export ai_recommend_image_path=${props.registry}/${props.image_org}/ai-recommend:${imageTag}
|
||||
|
||||
echo "=== Manifest 생성 ==="
|
||||
envsubst < smarketing-java/deployment/${manifest}.template > smarketing-java/deployment/${manifest}
|
||||
|
||||
echo "=== Generated Manifest File ==="
|
||||
cat smarketing-java/deployment/${manifest}
|
||||
echo "==============================="
|
||||
"""
|
||||
}
|
||||
|
||||
container('azure-cli') {
|
||||
sh """
|
||||
echo "=== PostgreSQL 서비스 확인 ==="
|
||||
kubectl get svc -n ${namespace} | grep postgresql || echo "PostgreSQL 서비스가 없습니다. 먼저 설치해주세요."
|
||||
|
||||
echo "=== Manifest 적용 ==="
|
||||
kubectl apply -f smarketing-java/deployment/${manifest}
|
||||
|
||||
echo "=== 배포 상태 확인 (60초 대기) ==="
|
||||
kubectl -n ${namespace} get deployments
|
||||
kubectl -n ${namespace} get pods
|
||||
|
||||
echo "=== 각 서비스 배포 대기 (60초 timeout) ==="
|
||||
timeout 60 kubectl -n ${namespace} wait --for=condition=available deployment/member --timeout=60s || echo "member deployment 대기 타임아웃"
|
||||
timeout 60 kubectl -n ${namespace} wait --for=condition=available deployment/store --timeout=60s || echo "store deployment 대기 타임아웃"
|
||||
timeout 60 kubectl -n ${namespace} wait --for=condition=available deployment/marketing-content --timeout=60s || echo "marketing-content deployment 대기 타임아웃"
|
||||
timeout 60 kubectl -n ${namespace} wait --for=condition=available deployment/ai-recommend --timeout=60s || echo "ai-recommend deployment 대기 타임아웃"
|
||||
|
||||
echo "=== 최종 상태 ==="
|
||||
kubectl -n ${namespace} get all
|
||||
|
||||
echo "=== 실패한 Pod 상세 정보 ==="
|
||||
for pod in \$(kubectl -n ${namespace} get pods --field-selector=status.phase!=Running -o name 2>/dev/null || true); do
|
||||
if [ ! -z "\$pod" ]; then
|
||||
echo "=== 실패한 Pod: \$pod ==="
|
||||
kubectl -n ${namespace} describe \$pod | tail -20
|
||||
fi
|
||||
done
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
# Build stage
|
||||
FROM eclipse-temurin:17-jre AS builder
|
||||
ARG BUILD_LIB_DIR
|
||||
ARG ARTIFACTORY_FILE
|
||||
WORKDIR /app
|
||||
COPY ${BUILD_LIB_DIR}/${ARTIFACTORY_FILE} app.jar
|
||||
|
||||
# Run stage
|
||||
FROM eclipse-temurin:17-jre
|
||||
|
||||
# Install necessary packages
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
netcat-traditional \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV USERNAME k8s
|
||||
ENV ARTIFACTORY_HOME /home/${USERNAME}
|
||||
ENV JAVA_OPTS=""
|
||||
|
||||
# Add a non-root user
|
||||
RUN groupadd -r ${USERNAME} && useradd -r -g ${USERNAME} ${USERNAME} && \
|
||||
mkdir -p ${ARTIFACTORY_HOME} && \
|
||||
chown ${USERNAME}:${USERNAME} ${ARTIFACTORY_HOME}
|
||||
|
||||
WORKDIR ${ARTIFACTORY_HOME}
|
||||
|
||||
# Copy JAR from builder stage
|
||||
COPY --from=builder /app/app.jar app.jar
|
||||
RUN chown ${USERNAME}:${USERNAME} app.jar
|
||||
|
||||
# Switch to non-root user
|
||||
USER ${USERNAME}
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8080
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
|
||||
CMD curl -f http://localhost:8080/actuator/health || exit 1
|
||||
|
||||
# Run the application
|
||||
ENTRYPOINT ["sh", "-c"]
|
||||
CMD ["java ${JAVA_OPTS} -jar app.jar"]
|
||||
@@ -0,0 +1,475 @@
|
||||
# ConfigMap
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: common-config
|
||||
namespace: ${namespace}
|
||||
data:
|
||||
ALLOWED_ORIGINS: ${allowed_origins}
|
||||
JPA_DDL_AUTO: update
|
||||
JPA_SHOW_SQL: 'true'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: member-config
|
||||
namespace: ${namespace}
|
||||
data:
|
||||
POSTGRES_DB: member
|
||||
POSTGRES_HOST: member-postgresql
|
||||
POSTGRES_PORT: '5432'
|
||||
SERVER_PORT: '8081'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: store-config
|
||||
namespace: ${namespace}
|
||||
data:
|
||||
POSTGRES_DB: store
|
||||
POSTGRES_HOST: store-postgresql
|
||||
POSTGRES_PORT: '5432'
|
||||
SERVER_PORT: '8082'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: marketing-content-config
|
||||
namespace: ${namespace}
|
||||
data:
|
||||
POSTGRES_DB: marketing_content
|
||||
POSTGRES_HOST: marketing-content-postgresql
|
||||
POSTGRES_PORT: '5432'
|
||||
SERVER_PORT: '8083'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ai-recommend-config
|
||||
namespace: ${namespace}
|
||||
data:
|
||||
POSTGRES_DB: ai_recommend
|
||||
POSTGRES_HOST: ai-recommend-postgresql
|
||||
POSTGRES_PORT: '5432'
|
||||
SERVER_PORT: '8084'
|
||||
|
||||
---
|
||||
# Secrets
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: common-secret
|
||||
namespace: ${namespace}
|
||||
stringData:
|
||||
JWT_SECRET_KEY: ${jwt_secret_key}
|
||||
type: Opaque
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: member-secret
|
||||
namespace: ${namespace}
|
||||
stringData:
|
||||
JWT_ACCESS_TOKEN_VALIDITY: '3600000'
|
||||
JWT_REFRESH_TOKEN_VALIDITY: '86400000'
|
||||
POSTGRES_PASSWORD: ${postgres_password}
|
||||
POSTGRES_USER: ${postgres_user}
|
||||
type: Opaque
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: store-secret
|
||||
namespace: ${namespace}
|
||||
stringData:
|
||||
POSTGRES_PASSWORD: ${postgres_password}
|
||||
POSTGRES_USER: ${postgres_user}
|
||||
type: Opaque
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: marketing-content-secret
|
||||
namespace: ${namespace}
|
||||
stringData:
|
||||
POSTGRES_PASSWORD: ${postgres_password}
|
||||
POSTGRES_USER: ${postgres_user}
|
||||
type: Opaque
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: ai-recommend-secret
|
||||
namespace: ${namespace}
|
||||
stringData:
|
||||
POSTGRES_PASSWORD: ${postgres_password}
|
||||
POSTGRES_USER: ${postgres_user}
|
||||
type: Opaque
|
||||
|
||||
---
|
||||
# Deployments
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: member
|
||||
namespace: ${namespace}
|
||||
labels:
|
||||
app: member
|
||||
spec:
|
||||
replicas: ${replicas}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: member
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: member
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
containers:
|
||||
- name: member
|
||||
image: ${member_image_path}
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8081
|
||||
resources:
|
||||
requests:
|
||||
cpu: ${resources_requests_cpu}
|
||||
memory: ${resources_requests_memory}
|
||||
limits:
|
||||
cpu: ${resources_limits_cpu}
|
||||
memory: ${resources_limits_memory}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: common-config
|
||||
- configMapRef:
|
||||
name: member-config
|
||||
- secretRef:
|
||||
name: common-secret
|
||||
- secretRef:
|
||||
name: member-secret
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- "nc -z member-postgresql 5432"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8081
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8081
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 5
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: store
|
||||
namespace: ${namespace}
|
||||
labels:
|
||||
app: store
|
||||
spec:
|
||||
replicas: ${replicas}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: store
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: store
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
containers:
|
||||
- name: store
|
||||
image: ${store_image_path}
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8082
|
||||
resources:
|
||||
requests:
|
||||
cpu: ${resources_requests_cpu}
|
||||
memory: ${resources_requests_memory}
|
||||
limits:
|
||||
cpu: ${resources_limits_cpu}
|
||||
memory: ${resources_limits_memory}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: common-config
|
||||
- configMapRef:
|
||||
name: store-config
|
||||
- secretRef:
|
||||
name: common-secret
|
||||
- secretRef:
|
||||
name: store-secret
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- "nc -z store-postgresql 5432"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8082
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8082
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 5
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: marketing-content
|
||||
namespace: ${namespace}
|
||||
labels:
|
||||
app: marketing-content
|
||||
spec:
|
||||
replicas: ${replicas}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: marketing-content
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: marketing-content
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
containers:
|
||||
- name: marketing-content
|
||||
image: ${marketing_content_image_path}
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8083
|
||||
resources:
|
||||
requests:
|
||||
cpu: ${resources_requests_cpu}
|
||||
memory: ${resources_requests_memory}
|
||||
limits:
|
||||
cpu: ${resources_limits_cpu}
|
||||
memory: ${resources_limits_memory}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: common-config
|
||||
- configMapRef:
|
||||
name: marketing-content-config
|
||||
- secretRef:
|
||||
name: common-secret
|
||||
- secretRef:
|
||||
name: marketing-content-secret
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- "nc -z marketing-content-postgresql 5432"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8083
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8083
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 5
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ai-recommend
|
||||
namespace: ${namespace}
|
||||
labels:
|
||||
app: ai-recommend
|
||||
spec:
|
||||
replicas: ${replicas}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ai-recommend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ai-recommend
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
containers:
|
||||
- name: ai-recommend
|
||||
image: ${ai_recommend_image_path}
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8084
|
||||
resources:
|
||||
requests:
|
||||
cpu: ${resources_requests_cpu}
|
||||
memory: ${resources_requests_memory}
|
||||
limits:
|
||||
cpu: ${resources_limits_cpu}
|
||||
memory: ${resources_limits_memory}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: common-config
|
||||
- configMapRef:
|
||||
name: ai-recommend-config
|
||||
- secretRef:
|
||||
name: common-secret
|
||||
- secretRef:
|
||||
name: ai-recommend-secret
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- "nc -z ai-recommend-postgresql 5432"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8084
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8084
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 5
|
||||
|
||||
---
|
||||
# Services
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: member
|
||||
namespace: ${namespace}
|
||||
spec:
|
||||
selector:
|
||||
app: member
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8081
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: store
|
||||
namespace: ${namespace}
|
||||
spec:
|
||||
selector:
|
||||
app: store
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8082
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: marketing-content
|
||||
namespace: ${namespace}
|
||||
spec:
|
||||
selector:
|
||||
app: marketing-content
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8083
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ai-recommend
|
||||
namespace: ${namespace}
|
||||
spec:
|
||||
selector:
|
||||
app: ai-recommend
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8084
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: smarketing-backend
|
||||
namespace: ${namespace}
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- path: /api/auth
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: member
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/store
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: store
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/content
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: marketing-content
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/recommend
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ai-recommend
|
||||
port:
|
||||
number: 80
|
||||
@@ -0,0 +1,23 @@
|
||||
# Team Settings
|
||||
teamid=kros235
|
||||
root_project=smarketing-backend
|
||||
namespace=smarketing
|
||||
|
||||
# Container Registry Settings
|
||||
registry=acrdigitalgarage02.azurecr.io
|
||||
image_org=smarketing
|
||||
|
||||
# Application Settings
|
||||
replicas=1
|
||||
allowed_origins=http://20.249.171.38
|
||||
|
||||
# Security Settings
|
||||
jwt_secret_key=8O2HQ13etL2BWZvYOiWsJ5uWFoLi6NBUG8divYVoCgtHVvlk3dqRksMl16toztDUeBTSIuOOPvHIrYq11G2BwQ
|
||||
postgres_user=admin
|
||||
postgres_password=Hi5Jessica!
|
||||
|
||||
# Resource Settings (리소스 요구사항 줄임)
|
||||
resources_requests_cpu=100m
|
||||
resources_requests_memory=128Mi
|
||||
resources_limits_cpu=500m
|
||||
resources_limits_memory=512Mi
|
||||
Reference in New Issue
Block a user