Kustomize 구조 정리 및 ArgoCD 파이프라인 개선

- 중복된 namespace.yaml 파일 제거
- Kustomization 파일 정리 및 최적화
- Jenkinsfile_ArgoCD 파일 위치 정리
- GitHub Actions 워크플로우 개선

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hiondal
2025-09-16 01:55:57 +09:00
parent 587af7bbc8
commit 15d8d220e7
6 changed files with 199 additions and 152 deletions
+26 -27
View File
@@ -25,10 +25,10 @@ podTemplate(
''',
containers: [
containerTemplate(
name: 'podman',
image: "mgoltzsche/podman",
ttyEnabled: true,
command: 'cat',
name: 'podman',
image: "mgoltzsche/podman",
ttyEnabled: true,
command: 'cat',
privileged: true,
resourceRequestCpu: '500m',
resourceRequestMemory: '2Gi',
@@ -51,14 +51,24 @@ podTemplate(
]
),
containerTemplate(
name: 'azure-cli',
image: 'hiondal/azure-kubectl:latest',
command: 'cat',
name: 'azure-cli',
image: 'hiondal/azure-kubectl:latest',
command: 'cat',
ttyEnabled: true,
resourceRequestCpu: '200m',
resourceRequestMemory: '512Mi',
resourceLimitCpu: '500m',
resourceLimitMemory: '1Gi'
),
containerTemplate(
name: 'git',
image: 'alpine/git:latest',
command: 'cat',
ttyEnabled: true,
resourceRequestCpu: '100m',
resourceRequestMemory: '256Mi',
resourceLimitCpu: '300m',
resourceLimitMemory: '512Mi'
)
],
volumes: [
@@ -73,25 +83,13 @@ podTemplate(
def environment = params.ENVIRONMENT ?: 'dev'
def skipSonarQube = (params.SKIP_SONARQUBE?.toLowerCase() == 'true')
def services = ['api-gateway', 'user-service', 'bill-service', 'product-service', 'kos-mock']
try {
stage("Get Source") {
checkout scm
props = readProperties file: "deployment/cicd/config/deploy_env_vars_${environment}"
}
stage("Setup AKS") {
container('azure-cli') {
withCredentials([azureServicePrincipal('azure-credentials')]) {
sh """
az login --service-principal -u \$AZURE_CLIENT_ID -p \$AZURE_CLIENT_SECRET -t \$AZURE_TENANT_ID
az aks get-credentials --resource-group ${props.resource_group} --name ${props.cluster_name} --overwrite-existing
kubectl create namespace phonebill-${environment} --dry-run=client -o yaml | kubectl apply -f -
"""
}
}
}
stage('Build') {
container('gradle') {
sh """
@@ -118,7 +116,7 @@ podTemplate(
-Dsonar.exclusions=**/config/**,**/entity/**,**/dto/**,**/*Application.class,**/exception/**
"""
}
// Quality Gate 확인
timeout(time: 10, unit: 'MINUTES') {
def qg = waitForQualityGate()
@@ -142,13 +140,13 @@ podTemplate(
),
usernamePassword(
credentialsId: 'dockerhub-credentials',
usernameVariable: 'DOCKERHUB_USERNAME',
usernameVariable: 'DOCKERHUB_USERNAME',
passwordVariable: 'DOCKERHUB_PASSWORD'
)
]) {
// Docker Hub 로그인 (rate limit 해결)
sh "podman login docker.io --username \$DOCKERHUB_USERNAME --password \$DOCKERHUB_PASSWORD"
// ACR 로그인
sh "podman login acrdigitalgarage01.azurecr.io --username \$ACR_USERNAME --password \$ACR_PASSWORD"
@@ -169,7 +167,7 @@ podTemplate(
}
stage('Update Manifest Repository') {
container('azure-cli') {
container('git') {
withCredentials([usernamePassword(
credentialsId: 'github-credentials-dg0500',
usernameVariable: 'GIT_USERNAME',
@@ -208,19 +206,20 @@ podTemplate(
}
}
}
// 파이프라인 완료 로그 (Scripted Pipeline 방식)
stage('Pipeline Complete') {
echo "🧹 Pipeline completed. Pod cleanup handled by Jenkins Kubernetes Plugin."
// 성공/실패 여부 로깅
if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {
echo "✅ Pipeline completed successfully!"
echo "✅ 매니페스트가 업데이트되었습니다. ArgoCD에서 배포를 확인하세요."
} else {
echo "❌ Pipeline failed with result: ${currentBuild.result}"
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
echo "❌ Pipeline failed with exception: ${e.getMessage()}"
@@ -5,9 +5,7 @@ metadata:
name: phonebill-base
resources:
# Namespace
- namespace.yaml
# Common resources
- common/cm-common.yaml
- common/secret-common.yaml
@@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: placeholder