{"id":17145148,"url":"https://github.com/apexcaptain/apexcaptain.iac","last_synced_at":"2025-10-12T11:31:29.117Z","repository":{"id":257826400,"uuid":"866421087","full_name":"ApexCaptain/ApexCaptain.IaC","owner":"ApexCaptain","description":"CDK for Terraform project","archived":false,"fork":false,"pushed_at":"2025-01-27T05:26:03.000Z","size":338,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T06:26:37.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ApexCaptain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-02T08:22:28.000Z","updated_at":"2025-01-01T04:49:15.000Z","dependencies_parsed_at":"2024-12-16T04:23:56.040Z","dependency_job_id":"acf0e53b-dac6-45f7-b402-bfe7087b6d93","html_url":"https://github.com/ApexCaptain/ApexCaptain.IaC","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"68c3899c76c8b9b3344cae6761799b9504f6fb16"},"previous_names":["apexcaptain/apexcaptain.iac"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApexCaptain%2FApexCaptain.IaC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApexCaptain%2FApexCaptain.IaC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApexCaptain%2FApexCaptain.IaC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApexCaptain%2FApexCaptain.IaC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApexCaptain","download_url":"https://codeload.github.com/ApexCaptain/ApexCaptain.IaC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236210481,"owners_count":19112871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T21:04:43.488Z","updated_at":"2025-10-12T11:31:29.111Z","avatar_url":"https://github.com/ApexCaptain.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ApexCaptain.IaC - Infrastructure as Code\n\n## 📋 프로젝트 개요\n\nOCI 기반의 멀티 클러스터 Kubernetes 환경을 CDK for Terraform(CDKTF)을 사용하여 관리하는 IaC 프로젝트입니다.\n\n### 🎯 주요 목표\n\n- **멀티 클러스터 Kubernetes 환경** 구축 및 관리\n  - Oracle Cloud OKE 클러스터 (클라우드)\n  - On-premise Workstation 클러스터\n- **GitOps 기반 배포 파이프라인** 구현\n- **개인 미디어 서버 \u0026 게임 서버 인프라**\n- **보안 및 모니터링** 체계 구축\n- **클라우드 네이티브 개발 환경** 제공\n\n---\n\n## 🏗️ 기술 스택\n\n### 핵심 기술\n\n- **CDK for Terraform (CDKTF)** - TypeScript 기반 인프라 정의\n- **Oracle Cloud Infrastructure (OCI)** - 클라우드 플랫폼\n- **Kubernetes** - 컨테이너 오케스트레이션\n- **Istio** - 서비스 메시\n- **ArgoCD** - GitOps 배포 관리 (구현 완료)\n- **Longhorn** - 분산 스토리지 시스템\n- **MetalLB** - 로드 밸런서\n\n### 개발 도구\n\n- **TypeScript** - 메인 개발 언어\n- **NestJS** - 애플리케이션 프레임워크\n- **Projen** - 프로젝트 자동화 도구\n- **ESLint + Prettier** - 코드 품질 관리\n- **Yarn** - 패키지 관리\n- **Context7** - MCP 서버 통합\n\n---\n\n## 📁 프로젝트 구조\n\n```\nApexCaptain.IaC/\n├── 📁 src/                          # 소스 코드\n│   ├── 📁 terraform/               # CDKTF 인프라 정의\n│   │   ├── 📁 stacks/              # 인프라 스택들\n│   │   │   ├── 📁 k8s/            # Kubernetes 관련 스택\n│   │   │   │   ├── 📁 oke/        # Oracle Kubernetes Engine (클라우드)\n│   │   │   │   │   ├── 📁 apps/   # 애플리케이션\n│   │   │   │   │   │   ├── argo-cd.stack.ts\n│   │   │   │   │   │   ├── cert-manager.stack.ts\n│   │   │   │   │   │   ├── cloudbeaver.stack.ts\n│   │   │   │   │   │   ├── dashboard.stack.ts\n│   │   │   │   │   │   ├── git-ops.stack.ts\n│   │   │   │   │   │   ├── home-l2tp-vpn-proxy.stack.ts\n│   │   │   │   │   │   ├── ingress-controller.stack.ts\n│   │   │   │   │   │   ├── istio.stack.ts\n│   │   │   │   │   │   ├── monitoring.stack.ts\n│   │   │   │   │   │   ├── nfs.stack.ts\n│   │   │   │   │   │   ├── oauth2-proxy.stack.ts\n│   │   │   │   │   │   ├── redis-ui.stack.ts\n│   │   │   │   │   │   └── vault.stack.ts\n│   │   │   │   │   ├── cluster.stack.ts\n│   │   │   │   │   ├── network.stack.ts\n│   │   │   │   │   ├── bastion.stack.ts\n│   │   │   │   │   ├── compartment.stack.ts\n│   │   │   │   │   ├── endpoint.stack.ts\n│   │   │   │   │   ├── policy.stack.ts\n│   │   │   │   │   └── system.stack.ts\n│   │   │   │   └── 📁 workstation/ # On-premise Workstation\n│   │   │   │       ├── 📁 apps/   # 개인/미디어/게임 서비스\n│   │   │   │       │   ├── cert-manager.stack.ts\n│   │   │   │       │   ├── dashboard.stack.ts\n│   │   │   │       │   ├── game.7dtd.stack.ts\n│   │   │   │       │   ├── game.sftp.stack.ts\n│   │   │   │       │   ├── git-ops.stack.ts\n│   │   │   │       │   ├── ingress-controller.stack.ts\n│   │   │   │       │   ├── istio.stack.ts\n│   │   │   │       │   ├── longhorn.stack.ts\n│   │   │   │       │   ├── metallb.stack.ts\n│   │   │   │       │   ├── monitoring.stack.ts\n│   │   │   │       │   ├── nas.jellyfin.stack.ts\n│   │   │   │       │   ├── nas.qbittorrent.stack.ts\n│   │   │   │       │   ├── nas.sftp.stack.ts\n│   │   │   │       │   └── windows.stack.ts\n│   │   │   │       ├── 📁 dev-pods/ # 개발 환경 Pod\n│   │   │   │       │   └── apex-captain.stack.ts\n│   │   │   │       ├── system.stack.ts\n│   │   │   │       └── node-meta.stack.ts\n│   │   │   ├── 📁 cloudflare/      # DNS 및 CDN 설정\n│   │   │   │   ├── firewall.stack.ts\n│   │   │   │   ├── record.stack.ts\n│   │   │   │   └── zone.stack.ts\n│   │   │   ├── 📁 project/         # 프로젝트 공통 설정\n│   │   │   │   ├── 📁 apps/       # 애플리케이션\n│   │   │   │   │   └── number-planet.stack.ts\n│   │   │   │   ├── github-io.stack.ts\n│   │   │   │   └── profile.stack.ts\n│   │   │   ├── ocir.stack.ts      # Oracle Container Image Registry\n│   │   │   ├── git-ops.stack.ts   # GitOps 관리 스택\n│   │   │   └── project.stack.ts   # 프로젝트 메인 스택\n│   │   ├── terraform.module.ts\n│   │   └── terraform.config.service.ts\n│   ├── 📁 common/                  # 공통 유틸리티\n│   ├── 📁 global/                  # 글로벌 설정\n│   └── main.ts                     # 진입점\n├── 📁 scripts/                     # 자동화 스크립트\n│   ├── backup-tfstate.script.ts    # Terraform 상태 백업\n│   ├── tf-deploy-selection.script.ts # 선택적 배포\n│   ├── terminal-v2.script.ts       # 대화형 터미널 도구 v2\n│   ├── create-random-string.script.ts\n│   ├── 📁 terminal/               # 터미널 도구\n│   ├── 📁 external/               # 외부 스크립트\n│   ├── 📁 generated/              # 생성된 스크립트\n│   └── 📁 stage/                  # 단계별 스크립트\n├── 📁 assets/                      # 정적 자산\n│   ├── 📁 static/                 # 정적 파일\n│   │   ├── 7dtd.install-additional-mods.js\n│   │   ├── home-l2tp-vpn-proxy.startup.sh\n│   │   └── 📁 windows/           # Windows 관련 스크립트\n│   └── 📁 templates/              # 템플릿 파일\n├── 📁 .projen/                     # Projen 생성 파일\n├── 📁 .github/                     # GitHub Actions\n├── 📁 .devcontainer/              # 개발 컨테이너 설정\n├── 📁 .cursor/                     # Cursor MCP 설정\n├── 📁 keys/                        # 인증 키 파일\n├── 📁 env/                         # 환경 변수\n├── 📁 .secrets/                    # 시크릿 파일 (gitignore)\n└── 📁 tmp/                         # 임시 파일\n```\n\n---\n\n## 🚀 주요 기능\n\n### 1. 하이브리드 멀티 클러스터 Kubernetes 환경\n\n- **Oracle Kubernetes Engine (OKE)** 클러스터 자동 프로비저닝 (클라우드)\n- **On-premise Workstation 클러스터** On-Premise로 구축 (로컬 환경)\n- **Istio 서비스 메시** 구축으로 서비스 간 통신 관리\n- **하이브리드 멀티 클러스터 통신** 설정 (진행 중)\n\n### 2. 보안 및 인증\n\n- **Vault** - 시크릿 관리 시스템 (개발 중)\n- **OAuth2 Proxy** - 인증 프록시 (구현 완료)\n- **Cert-Manager** - SSL 인증서 자동 관리 (구현 완료)\n- **Bastion 호스트** - 보안 접근 제어\n\n### 3. 모니터링 및 관찰성\n\n- **Prometheus + Grafana** - 메트릭 수집 및 시각화 (개발 중)\n\n### 4. DevOps 도구\n\n- **ArgoCD** - GitOps 기반 배포 관리 (구현 완료)\n- **OCIR** - Oracle Container Image Registry 통합 (구현 완료)\n- **GitOps 파이프라인** - 자동화된 CI/CD 워크플로우 (구현 완료)\n- **CloudBeaver** - 데이터베이스 관리 도구 (구현 완료)\n- **Redis UI** - Redis 관리 인터페이스 (구현 완료)\n- **Home L2TP VPN Proxy** - 원격 네트워크 접근 프록시 (구현 완료)\n\n### 5. 개인 미디어 서버 인프라 (On-premise)\n\n- **Jellyfin** - 미디어 스트리밍 서버 (구현 완료)\n- **qBittorrent** - 토렌트 다운로드 관리 (구현 완료)\n- **7 Days to Die** - 게임 서버 (구현 완료)\n- **SFTP 서버** - 파일 전송 서비스 (구현 완료)\n- **Longhorn Storage** - 분산 스토리지 시스템 (구현 완료)\n\n---\n\n## 🎮 배포된 애플리케이션 목록\n\n### Oracle Cloud OKE 클러스터 (클라우드)\n\n#### 시스템 애플리케이션\n\n- **Istio Service Mesh** - 서비스 간 통신 관리 (개발 중)\n- **ArgoCD** - GitOps 배포 관리 (구현 완료)\n- **Vault** - 시크릿 관리 시스템 (개발 중)\n- **Prometheus + Grafana** - 모니터링 및 메트릭 수집 (구현 완료)\n- **Cert-Manager** - SSL 인증서 자동 관리 (구현 완료)\n- **Ingress Controller** - 트래픽 라우팅 (구현 완료)\n\n#### 일반 애플리케이션\n\n- **Number Planet** - 웹 애플리케이션 (구현 완료)\n- **CloudBeaver** - 데이터베이스 관리 도구\n- **Redis UI** - Redis 관리 인터페이스\n- **OAuth2 Proxy** - 인증 프록시\n- **Home L2TP VPN Proxy** - 원격 네트워크 접근 프록시\n- **NFS Server** - 네트워크 파일 시스템\n- **Kubernetes Dashboard** - 클러스터 관리 UI\n\n### On-premise Workstation 클러스터\n\n#### 시스템 애플리케이션\n\n- **Istio Service Mesh** - 서비스 간 통신 관리 (개발 중)\n- **Longhorn Storage** - 분산 스토리지 시스템 (구현 완료)\n- **MetalLB Load Balancer** - 로드 밸런싱 (구현 완료)\n- **Prometheus + Grafana** - 모니터링 및 메트릭 수집 (개발 중)\n- **Cert-Manager** - SSL 인증서 자동 관리 (구현 완료)\n- **Ingress Controller** - 트래픽 라우팅 (구현 완료)\n\n#### 미디어 및 게임 서버\n\n- **Jellyfin** - 미디어 스트리밍 서버 (구현 완료)\n- **qBittorrent** - 토렌트 다운로드 관리 (구현 완료)\n- **7 Days to Die** - 게임 서버 (구현 완료)\n- **Game SFTP Server** - 게임 파일 전송 서비스 (구현 완료)\n- **NAS SFTP Server** - NAS 파일 전송 서비스 (구현 완료)\n\n#### 개발 도구 \u0026 기타\n\n- **Kubernetes Dashboard** - 클러스터 관리 UI (구현 완료)\n- **Development Pods** - 개발 환경 컨테이너 (ApexCaptain) (구현 완료)\n- **Windows Desktop** - 원격 Windows 데스크톱 환경 (구현 완료)\n\n---\n\n## 🔧 인프라 아키텍처\n\n### 네트워크 구성\n\n```\nOCI VCN\n├── Public Subnet (Bastion, Load Balancer)\n├── Private Subnet (Kubernetes Nodes)\n└── Database Subnet (RDS, Redis)\n```\n\n### 하이브리드 Kubernetes 클러스터 구성\n\n```\nOracle Cloud OKE Cluster (클라우드)\n├── Infrastructure Layer\n│   ├── Compartment (구현 완료)\n│   ├── Network (VCN, Subnets, Security Lists) (구현 완료)\n│   ├── Bastion Host (구현 완료)\n│   ├── Policy \u0026 IAM (구현 완료)\n│   └── Cluster Endpoint (구현 완료)\n├── System Namespace\n│   ├── Istio Control Plane (개발 중)\n│   ├── ArgoCD (구현 완료)\n│   ├── Vault (개발 중)\n│   ├── Monitoring Stack (Prometheus/Grafana) (개발 중)\n│   ├── Cert-Manager (구현 완료)\n│   └── Ingress Controller (구현 완료)\n├── Application Namespace\n│   ├── Number Planet (구현 완료)\n│   ├── CloudBeaver (구현 완료)\n│   ├── Redis UI (구현 완료)\n│   ├── OAuth2 Proxy (구현 완료)\n│   ├── Home L2TP VPN Proxy (구현 완료)\n│   ├── NFS Server (구현 완료)\n│   └── Kubernetes Dashboard (구현 완료)\n└── GitOps Layer\n    └── ArgoCD Applications (구현 완료)\n\nOn-premise Workstation Cluster\n├── Infrastructure Layer\n│   ├── Node Metadata (구현 완료)\n│   ├── Longhorn Storage (HDD + SSD) (구현 완료)\n│   └── MetalLB Load Balancer (구현 완료)\n├── System Namespace\n│   ├── Istio Control Plane (개발 중)\n│   ├── Monitoring Stack (Prometheus/Grafana) (개발 중)\n│   ├── Cert-Manager (구현 완료)\n│   └── Ingress Controller (구현 완료)\n├── Application Namespace\n│   ├── Media Services\n│   │   ├── Jellyfin (구현 완료)\n│   │   └── qBittorrent (구현 완료)\n│   ├── Game Services\n│   │   ├── 7 Days to Die (구현 완료)\n│   │   └── Game SFTP (구현 완료)\n│   ├── File Services\n│   │   └── NAS SFTP (구현 완료)\n│   └── Kubernetes Dashboard (구현 완료)\n├── Development Namespace\n│   ├── Windows Desktop (구현 완료)\n│   └── Dev Pods (ApexCaptain) (구현 완료)\n└── GitOps Layer\n    └── ArgoCD Applications (구현 완료)\n```\n\n## 🎯 핵심 성과\n\n### 1. 인프라 자동화\n\n- **100% 코드 기반 인프라** 관리 (TypeScript + CDKTF)\n- **GitOps 워크플로우** 구현으로 배포 자동화 (ArgoCD 기반)\n- **멀티 클러스터** 환경 구축 (OKE + Workstation)\n- **선택적 배포 시스템** 구현 (대화형 터미널 도구)\n- **Terraform 상태 자동 백업** 시스템\n\n### 2. 보안 강화\n\n- **Zero Trust 네트워크** 아키텍처 구현\n- **OAuth2 기반 인증** 프록시 (GitHub OAuth)\n- **SSL/TLS 인증서** 자동 관리 및 갱신 (Cert-Manager)\n- **시크릿 관리** 자동화 (Vault 개발 중)\n- **VPN 프록시** 구현 (L2TP/IPsec)\n\n### 3. 운영 효율성\n\n- **분산 스토리지** 시스템 (Longhorn - HDD/SSD 하이브리드)\n- **로드 밸런싱** (MetalLB)\n- **모니터링 대시보드** 구축 (Prometheus/Grafana 개발 중)\n- **백업 및 복구** 자동화\n- **미디어 \u0026 게임 서버** 통합 관리\n\n### 4. 개발자 경험\n\n- **클라우드 네이티브 개발 환경** (Dev Pods)\n- **Windows 원격 데스크톱** 환경\n- **데이터베이스 관리 도구** (CloudBeaver)\n- **대화형 배포 도구** (터미널 v2)\n- **MCP 서버 통합** (Context7)\n\n---\n\n## 🛠️ 주요 스크립트\n\n| 스크립트                   | 설명                          |\n| -------------------------- | ----------------------------- |\n| `yarn projen`              | Projen 설정 재생성            |\n| `yarn build`               | 프로젝트 빌드                 |\n| `yarn compile`             | TypeScript 컴파일             |\n| `yarn tf@build`            | CDKTF 코드 신시사이즈 (synth) |\n| `yarn tf@deploy`           | 전체 인프라 배포 (병렬 20)    |\n| `yarn tf@deploy:selection` | 선택적 스택 배포 (대화형)     |\n| `yarn tf@deploy:single`    | 단일 스택 배포                |\n| `yarn tf@plan`             | 배포 계획 확인 (diff)         |\n| `yarn tf@install`          | Terraform provider 초기화     |\n| `yarn tf@backup`           | tfstate 파일 백업             |\n| `yarn tf@clean`            | CDKTF 출력 디렉토리 정리      |\n| `yarn terminal`            | 대화형 터미널 도구 v2         |\n\n---\n\n## 🏆 기술적 도전과 해결\n\n### 1. 하이브리드 멀티 클러스터 통신\n\n**도전**: 클라우드(OKE)와 On-premise(Workstation) Kubernetes 클러스터 간 안전한 통신 구축\n\n**해결**:\n\n- Istio 서비스 메시 구현 (개발 중)\n- L2TP VPN 프록시를 통한 안전한 네트워크 터널링 (구현 완료)\n- ArgoCD를 통한 멀티 클러스터 배포 관리 (구현 완료)\n\n### 2. 스토리지 전략\n\n**도전**: On-premise 환경에서의 효율적인 스토리지 관리\n\n**해결**:\n\n- Longhorn 분산 스토리지 시스템 도입\n- HDD/SSD 하이브리드 구성으로 성능과 용량 최적화\n- 자동 백업 및 복제 기능 구현\n\n### 3. GitOps 파이프라인\n\n**도전**: 복잡한 멀티 클러스터 환경에서의 일관된 배포 관리\n\n**해결**:\n\n- ArgoCD 기반 GitOps 워크플로우 구축\n- 선택적 스택 배포 도구 개발 (대화형 CLI)\n- 자동화된 배포 검증 및 롤백 메커니즘\n\n### 4. 상태 관리 및 백업\n\n**도전**: Terraform 상태 파일의 안전한 관리와 버전 관리\n\n**해결**:\n\n- 로컬 백엔드와 자동 백업 스크립트 구현\n- 스택별 독립적인 상태 관리\n- Git 기반 버전 관리 시스템\n\n### 5. 보안 강화\n\n**도전**: 클라우드 네이티브 환경에서의 종합적 보안 체계 구축\n\n**해결**:\n\n- OAuth2 Proxy를 통한 인증 레이어 (구현 완료)\n- Cert-Manager를 통한 자동 SSL/TLS 관리 (구현 완료)\n- Bastion 호스트를 통한 안전한 클러스터 접근 (구현 완료)\n- Vault 시크릿 관리 시스템 (개발 중)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapexcaptain%2Fapexcaptain.iac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapexcaptain%2Fapexcaptain.iac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapexcaptain%2Fapexcaptain.iac/lists"}