mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2026-06-13 12:09:10 +00:00
Jenkins CI/CD 파이프라인 구축 완료
- Kustomize 기반 환경별 매니페스트 구성 (dev/staging/prod) - Base 및 Overlay 구조로 환경별 설정 분리 - 각 환경별 Deployment, Service, ConfigMap, Secret 패치 적용 - Jenkinsfile 작성 (Gradle JDK21, SonarQube, Quality Gate 포함) - 환경별 설정 파일 및 수동 배포 스크립트 생성 - Jenkins CI/CD 가이드 문서 및 검증 스크립트 작성 - DEV 환경 Ingress Host를 base와 동일하게 수정 (체크리스트 준수) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,28 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: cm-common
|
||||
name: common-config
|
||||
data:
|
||||
CORS_ALLOWED_ORIGINS: "https://phonebill-prod.example.com"
|
||||
JWT_ACCESS_TOKEN_VALIDITY: "3600000"
|
||||
JWT_REFRESH_TOKEN_VALIDITY: "43200000"
|
||||
REDIS_PORT: "6379"
|
||||
# Production Spring profiles
|
||||
SPRING_PROFILES_ACTIVE: "prod"
|
||||
DDL_AUTO: "validate"
|
||||
|
||||
# Production database settings
|
||||
DDL_AUTO: "validate"
|
||||
|
||||
# Production logging level
|
||||
LOGGING_LEVEL_ROOT: "INFO"
|
||||
LOGGING_LEVEL_COM_PHONEBILL: "INFO"
|
||||
|
||||
# Production security settings
|
||||
SECURITY_CORS_ALLOWED_ORIGINS: "https://phonebill.production-domain.com"
|
||||
|
||||
# JWT Token settings for production (shorter expiry for security)
|
||||
JWT_EXPIRATION: "1800000" # 30 minutes
|
||||
|
||||
# Redis settings for production
|
||||
REDIS_HOST: "redis-service.phonebill-prod.svc.cluster.local"
|
||||
REDIS_PORT: "6379"
|
||||
|
||||
# Production specific configurations
|
||||
MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE: "health,info,prometheus"
|
||||
MANAGEMENT_ENDPOINT_HEALTH_SHOW_DETAILS: "when-authorized"
|
||||
@@ -3,15 +3,22 @@ kind: Deployment
|
||||
metadata:
|
||||
name: api-gateway
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 3
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: api-gateway
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "256m"
|
||||
limits:
|
||||
memory: "1024Mi"
|
||||
cpu: "1024m"
|
||||
- name: api-gateway
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
limits:
|
||||
cpu: "4096m"
|
||||
memory: "4096Mi"
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "prod"
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
- name: MANAGEMENT_SERVER_PORT
|
||||
value: "8081"
|
||||
@@ -3,15 +3,24 @@ kind: Deployment
|
||||
metadata:
|
||||
name: bill-service
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 3
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: bill-service
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "256m"
|
||||
limits:
|
||||
memory: "1024Mi"
|
||||
cpu: "1024m"
|
||||
- name: bill-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
limits:
|
||||
cpu: "4096m"
|
||||
memory: "4096Mi"
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "prod"
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
- name: MANAGEMENT_SERVER_PORT
|
||||
value: "8081"
|
||||
- name: SPRING_JPA_HIBERNATE_DDL_AUTO
|
||||
value: "validate"
|
||||
@@ -3,15 +3,22 @@ kind: Deployment
|
||||
metadata:
|
||||
name: kos-mock
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 3
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kos-mock
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "256m"
|
||||
limits:
|
||||
memory: "1024Mi"
|
||||
cpu: "1024m"
|
||||
- name: kos-mock
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
limits:
|
||||
cpu: "4096m"
|
||||
memory: "4096Mi"
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "prod"
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
- name: MANAGEMENT_SERVER_PORT
|
||||
value: "8081"
|
||||
@@ -3,15 +3,24 @@ kind: Deployment
|
||||
metadata:
|
||||
name: product-service
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 3
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: product-service
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "256m"
|
||||
limits:
|
||||
memory: "1024Mi"
|
||||
cpu: "1024m"
|
||||
- name: product-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
limits:
|
||||
cpu: "4096m"
|
||||
memory: "4096Mi"
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "prod"
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
- name: MANAGEMENT_SERVER_PORT
|
||||
value: "8081"
|
||||
- name: SPRING_JPA_HIBERNATE_DDL_AUTO
|
||||
value: "validate"
|
||||
@@ -3,15 +3,24 @@ kind: Deployment
|
||||
metadata:
|
||||
name: user-service
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 3
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: user-service
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "256m"
|
||||
limits:
|
||||
memory: "1024Mi"
|
||||
cpu: "1024m"
|
||||
- name: user-service
|
||||
resources:
|
||||
requests:
|
||||
cpu: "1024m"
|
||||
memory: "1024Mi"
|
||||
limits:
|
||||
cpu: "4096m"
|
||||
memory: "4096Mi"
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "prod"
|
||||
- name: SERVER_PORT
|
||||
value: "8080"
|
||||
- name: MANAGEMENT_SERVER_PORT
|
||||
value: "8081"
|
||||
- name: SPRING_JPA_HIBERNATE_DDL_AUTO
|
||||
value: "validate"
|
||||
@@ -1,54 +1,57 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: phonebill
|
||||
name: phonebill-ingress
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: "10m"
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
|
||||
nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
tls:
|
||||
- hosts:
|
||||
- phonebill-prod.example.com
|
||||
secretName: phonebill-prod-tls
|
||||
- hosts:
|
||||
- phonebill.production-domain.com
|
||||
secretName: phonebill-prod-tls
|
||||
rules:
|
||||
- host: phonebill-prod.example.com
|
||||
http:
|
||||
paths:
|
||||
- path: /api/v1/auth
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: user-service
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/v1/users
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: user-service
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/v1/bills
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: bill-service
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/v1/products
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: product-service
|
||||
port:
|
||||
number: 80
|
||||
- path: /api/v1/kos
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: kos-mock
|
||||
port:
|
||||
number: 80
|
||||
- host: phonebill.production-domain.com
|
||||
http:
|
||||
paths:
|
||||
- path: /api/auth
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: user-service
|
||||
port:
|
||||
number: 8080
|
||||
- path: /api/bills
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: bill-service
|
||||
port:
|
||||
number: 8080
|
||||
- path: /api/products
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: product-service
|
||||
port:
|
||||
number: 8080
|
||||
- path: /api/kos
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: kos-mock
|
||||
port:
|
||||
number: 8080
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: api-gateway
|
||||
port:
|
||||
number: 8080
|
||||
@@ -1,16 +1,61 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
metadata:
|
||||
name: phonebill-prod
|
||||
|
||||
namespace: phonebill-prod
|
||||
|
||||
resources:
|
||||
- ../../base
|
||||
|
||||
commonLabels:
|
||||
environment: prod
|
||||
|
||||
images:
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/api-gateway
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/user-service
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/bill-service
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/product-service
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/kos-mock
|
||||
newTag: prod-latest
|
||||
|
||||
patches:
|
||||
# ConfigMap patches
|
||||
- path: configmap-common-patch.yaml
|
||||
target:
|
||||
kind: ConfigMap
|
||||
name: cm-common
|
||||
name: common-config
|
||||
|
||||
# Secret patches
|
||||
- path: secret-common-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: common-secret
|
||||
- path: secret-user-service-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: user-service-secret
|
||||
- path: secret-bill-service-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: bill-service-secret
|
||||
- path: secret-product-service-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: product-service-secret
|
||||
|
||||
# Ingress patches
|
||||
- path: ingress-patch.yaml
|
||||
target:
|
||||
kind: Ingress
|
||||
name: phonebill-ingress
|
||||
|
||||
# Deployment patches
|
||||
- path: deployment-api-gateway-patch.yaml
|
||||
target:
|
||||
kind: Deployment
|
||||
@@ -30,41 +75,4 @@ patches:
|
||||
- path: deployment-kos-mock-patch.yaml
|
||||
target:
|
||||
kind: Deployment
|
||||
name: kos-mock
|
||||
- path: ingress-patch.yaml
|
||||
target:
|
||||
kind: Ingress
|
||||
name: phonebill-ingress
|
||||
- path: secret-common-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: secret-common
|
||||
- path: secret-user-service-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: secret-user-service
|
||||
- path: secret-bill-service-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: secret-bill-service
|
||||
- path: secret-product-service-patch.yaml
|
||||
target:
|
||||
kind: Secret
|
||||
name: secret-product-service
|
||||
|
||||
images:
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/api-gateway
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/user-service
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/bill-service
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/product-service
|
||||
newTag: prod-latest
|
||||
- name: acrdigitalgarage01.azurecr.io/phonebill/kos-mock
|
||||
newTag: prod-latest
|
||||
|
||||
namePrefix: prod-
|
||||
|
||||
commonLabels:
|
||||
environment: prod
|
||||
name: kos-mock
|
||||
@@ -1,10 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-bill-service
|
||||
name: bill-service-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_HOST: "bill-inquiry-postgres-prod-postgresql"
|
||||
DB_NAME: "bill_inquiry_db"
|
||||
DB_USERNAME: "bill_inquiry_user"
|
||||
DB_PASSWORD: "BillUser2025Prod!SecurePassword"
|
||||
# Database connection for bill service in production
|
||||
DB_URL: "jdbc:postgresql://bill-service-postgres-prod.phonebill-prod.svc.cluster.local:5432/bill_inquiry_db"
|
||||
DB_USERNAME: "postgres"
|
||||
DB_PASSWORD: "prod-bill-service-db-password-change-in-production"
|
||||
|
||||
# Service-specific secrets for production
|
||||
SERVICE_SECRET: "prod-bill-service-secret-change-in-production"
|
||||
@@ -1,9 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-common
|
||||
name: common-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
JWT_SECRET: "nwe5Yo9qaJ6FBD/Thl2/j6/SFAfNwUorAY1ZcWO2KI7uA4bmVLOCPxE9hYuUpRCOkgV2UF2DdHXtqHi3+BU/ecbz2zpHyf/720h48UbA3XOMYOX1sdM+dQ=="
|
||||
REDIS_HOST: "redis-cache-prod-master"
|
||||
REDIS_PASSWORD: "Redis2025Prod!SecurePassword"
|
||||
# JWT Secret Key for production (should be changed in real deployment)
|
||||
JWT_SECRET: "prod-phonebill-jwt-secret-key-change-in-production-2024"
|
||||
|
||||
# Redis password for production
|
||||
REDIS_PASSWORD: "prod-redis-password-change-in-production"
|
||||
|
||||
# Database passwords for production
|
||||
DB_PASSWORD: "prod-db-password-change-in-production"
|
||||
|
||||
# External API keys for production
|
||||
EXTERNAL_API_KEY: "prod-external-api-key-change-in-production"
|
||||
|
||||
# Additional production secrets
|
||||
ENCRYPTION_KEY: "prod-encryption-key-change-in-production-32chars"
|
||||
@@ -1,10 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-product-service
|
||||
name: product-service-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_HOST: "product-change-postgres-prod-postgresql"
|
||||
DB_NAME: "product_change_db"
|
||||
DB_USERNAME: "product_change_user"
|
||||
DB_PASSWORD: "ProductUser2025Prod!SecurePassword"
|
||||
# Database connection for product service in production
|
||||
DB_URL: "jdbc:postgresql://product-service-postgres-prod.phonebill-prod.svc.cluster.local:5432/product_change_db"
|
||||
DB_USERNAME: "postgres"
|
||||
DB_PASSWORD: "prod-product-service-db-password-change-in-production"
|
||||
|
||||
# Service-specific secrets for production
|
||||
SERVICE_SECRET: "prod-product-service-secret-change-in-production"
|
||||
@@ -1,10 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: secret-user-service
|
||||
name: user-service-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_HOST: "auth-postgres-prod-postgresql"
|
||||
DB_NAME: "phonebill_auth"
|
||||
DB_USERNAME: "auth_user"
|
||||
DB_PASSWORD: "AuthUser2025Prod!SecurePassword"
|
||||
# Database connection for user service in production
|
||||
DB_URL: "jdbc:postgresql://user-service-postgres-prod.phonebill-prod.svc.cluster.local:5432/auth_db"
|
||||
DB_USERNAME: "postgres"
|
||||
DB_PASSWORD: "prod-user-service-db-password-change-in-production"
|
||||
|
||||
# Service-specific secrets for production
|
||||
SERVICE_SECRET: "prod-user-service-secret-change-in-production"
|
||||
Reference in New Issue
Block a user