# 🐾 Spring Petclinic Multi-Cloud GitOps (AWS EKS / GCP GKE) [![Build Status](https://github.com/costRider/spring-petclinic/actions/workflows/ci-petclinic-eks.yaml/badge.svg)](https://github.com/costRider/spring-petclinic/actions/workflows/ci-petclinic-eks.yaml) [![Build Status](https://github.com/costRider/spring-petclinic/actions/workflows/ci-petclinic-gke.yaml/badge.svg)](https://github.com/costRider/spring-petclinic/actions/workflows/ci-petclinic-gke.yaml) --- λ³Έ ν”„λ‘œμ νŠΈλŠ” **Spring Petclinic μ• ν”Œλ¦¬μΌ€μ΄μ…˜**을 λŒ€μƒμœΌλ‘œ **AWS(EKS)** 와 **GCP(GKE)** 두 CSP ν™˜κ²½μ— λ™μΌν•œ μ„œλΉ„μŠ€λ₯Ό λ°°ν¬ν•˜κ³ , **GitHub Actions + ArgoCD 기반 GitOps 방식**으둜 CI/CDλ₯Ό κ΅¬μ„±ν•œ λ©€ν‹°ν΄λΌμš°λ“œ μ˜ˆμ œμž…λ‹ˆλ‹€. 각 CSPλ³„λ‘œ: - μ»¨ν…Œμ΄λ„ˆ λ ˆμ§€μŠ€νŠΈλ¦¬ - Kubernetes λ§€λ‹ˆνŽ˜μŠ€νŠΈ - Secret / 인증 방식 - CI νŒŒμ΄ν”„λΌμΈ 을 λͺ…ν™•νžˆ λΆ„λ¦¬ν•˜μ—¬ μš΄μ˜ν•˜λ©°, μ‹€μ œ μ„œλΉ„μŠ€ 접속 및 **DB write λ™μž‘κΉŒμ§€ 검증 μ™„λ£Œ**된 μƒνƒœμž…λ‹ˆλ‹€. --- ## 1. 전체 μ•„ν‚€ν…μ²˜ κ°œμš” ``` GitHub Repository (spring-petclinic) β”œβ”€ GitHub Actions (CI) β”‚ β”œβ”€ 곡톡: Maven Build & Test β”‚ β”œβ”€ AWS CI: ECR 이미지 Push β”‚ └─ GCP CI: GAR 이미지 Push β”‚ β”œβ”€ Container Registry β”‚ β”œβ”€ AWS: Amazon ECR β”‚ └─ GCP: Artifact Registry β”‚ β”œβ”€ ArgoCD (CD) β”‚ β”œβ”€ AWS EKS Cluster β”‚ └─ GCP GKE Cluster β”‚ └─ Kubernetes β”œβ”€ k8s/aws (EKS μ „μš© λ§€λ‹ˆνŽ˜μŠ€νŠΈ) └─ k8s/gcp (GKE μ „μš© λ§€λ‹ˆνŽ˜μŠ€νŠΈ) ``` --- ## 2. Repository ꡬ쑰 ``` .github/workflows β”œβ”€ ci-petclinic-eks.yaml └─ ci-petclinic-gke.yaml k8s/ β”œβ”€ aws/ └─ gcp/ ``` --- ## 3. GitHub Actions (CI) ### 곡톡 - Maven Build & Test - Docker Image Build - Commit SHA 기반 이미지 νƒœκ·Έ ### AWS (EKS) - 인증: GitHub OIDC β†’ AWS IAM Role - Registry: Amazon ECR ### GCP (GKE) - 인증: GitHub OIDC β†’ GCP Workload Identity Federation - Registry: Artifact Registry --- ## 4. Kubernetes λ§€λ‹ˆνŽ˜μŠ€νŠΈ - AWS: `k8s/aws` - GCP: `k8s/gcp` CSP별 Ingress, Registry, Secret 차이둜 λ§€λ‹ˆνŽ˜μŠ€νŠΈ 뢄리 --- ## 5. Secret / DB - AWS: Secrets Manager + RDS (PostgreSQL) - GCP: Secret Manager + Cloud SQL (PostgreSQL) - External Secrets Operator μ‚¬μš© --- ## 6. ArgoCD - AWS / GCP 각각 독립 ArgoCD - GitHub Repoλ₯Ό Source of Truth둜 μ‚¬μš© - Git λ³€κ²½ μ‹œ μžλ™ 배포 --- ## 7. 검증 μ™„λ£Œ ν•­λͺ© - CI 이미지 λΉŒλ“œ 및 Push - ArgoCD Sync - μ„œλΉ„μŠ€ 접속 - DB Read / Write 정상 λ™μž‘ --- ## 8. 정리 λ³Έ ν”„λ‘œμ νŠΈλŠ” λ©€ν‹°ν΄λΌμš°λ“œ ν™˜κ²½μ—μ„œ GitOps 기반 CI/CD와 운영 뢄리λ₯Ό μ–΄λ–»κ²Œ 섀계할 수 μžˆλŠ”μ§€λ₯Ό λ³΄μ—¬μ£ΌλŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.