refactor: 구조 변경

This commit is contained in:
donghyeon-ka
2026-08-28 17:24:26 +09:00
parent a6f6c663e0
commit b8626946b1
192 changed files with 2251 additions and 206 deletions
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: auth-db-migration
automountServiceAccountToken: false
imagePullSecrets:
- name: ghcr-regcred
@@ -0,0 +1,70 @@
apiVersion: batch/v1
kind: Job
metadata:
name: auth-db-migration
annotations:
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation,HookSucceeded
argocd.argoproj.io/sync-wave: "5"
spec:
activeDeadlineSeconds: 600
backoffLimit: 1
template:
metadata:
labels:
app: auth-db-migration
spec:
serviceAccountName: auth-db-migration
automountServiceAccountToken: false
restartPolicy: Never
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: auth-db-migration
image: ghcr.io/donghyeonka/project-auth-server
imagePullPolicy: IfNotPresent
command:
- java
- -jar
- /app/migration.jar
env:
- name: SPRING_MAIN_WEB_APPLICATION_TYPE
value: none
- name: APP_PERSISTENCE_MIGRATION_RUN_ON_STARTUP
value: "true"
- name: APP_PERSISTENCE_MIGRATION_LOCATION
value: classpath:db/migration
- name: APP_DATASOURCE_URL
valueFrom:
configMapKeyRef:
name: auth-server-config
key: APP_DATASOURCE_URL
- name: APP_DATASOURCE_USERNAME
valueFrom:
secretKeyRef:
name: postgres-auth-server-credentials
key: APP_DATASOURCE_USERNAME
- name: APP_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-auth-server-credentials
key: APP_DATASOURCE_PASSWORD
- name: APP_DATASOURCE_DRIVER_CLASS_NAME
value: org.postgresql.Driver
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-server
annotations:
argocd.argoproj.io/sync-wave: "10"
spec:
replicas: 1
selector:
matchLabels:
app: auth-server
template:
metadata:
labels:
app: auth-server
spec:
serviceAccountName: auth-server
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
- name: auth-server
image: ghcr.io/donghyeonka/project-auth-server
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: http
envFrom:
- configMapRef:
name: auth-server-config
- secretRef:
name: postgres-auth-server-credentials
- secretRef:
name: keycloak-client-auth-server
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 20
timeoutSeconds: 3
failureThreshold: 3
periodSeconds: 10
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 30
timeoutSeconds: 3
failureThreshold: 5
periodSeconds: 15
startupProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 10
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 12
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- serviceaccount.yaml
- auth-db-migration-serviceaccount.yaml
- service.yaml
- db-migration-job.yaml
- deployment.yaml
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: auth-server
spec:
selector:
app: auth-server
ports:
- name: http
port: 80
targetPort: 8080
type: ClusterIP
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: auth-server
automountServiceAccountToken: false
imagePullSecrets:
- name: ghcr-regcred