From 5e7b3b637e78095258dcf9b3b8173e64d76a6b3f Mon Sep 17 00:00:00 2001 From: kappa Date: Wed, 18 Mar 2026 12:34:34 +0900 Subject: [PATCH] =?UTF-8?q?infra:=20K3s=20=EC=9B=8C=ED=81=AC=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=EC=83=81=EC=84=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - APISIX 서울: incus 컨테이너 → K3s apisix ns (hostNetwork 3노드) 이전 반영 - 트래픽 흐름: HAProxy → hostNetwork :9080/:9443 (NodePort 아님) 정정 - 서비스 테이블 전면 갱신: 실제 K3s 파드/서비스 기반 - anvil/ironclad 컴포넌트 상세 (nginx, php-fpm, redis, proxysql 등) - gitea: postgresql + valkey 구성 - vault: HA 3노드 + agent-injector + mcp-server - openmemory: mcp, ui, qdrant - tools ns: n8n, pgcat, bunnycdn-mcp, cfb-manager, cloud-api-emulator 추가 Co-Authored-By: Claude Opus 4.6 (1M context) --- infra/apisix.md | 13 +++++++----- infra/infra-hosts.md | 47 ++++++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/infra/apisix.md b/infra/apisix.md index 55e8a7e..85f4eec 100644 --- a/infra/apisix.md +++ b/infra/apisix.md @@ -5,7 +5,7 @@ updated: 2026-03-18 ## 아키텍처 -서울 K3s 클러스터 구성: 고객 도메인 → [[cloudflare]](DNS) → OpenWrt HAProxy (80/443) → K3s NodePort (32020/30675) → APISIX Gateway → 서비스 +서울 K3s 클러스터 구성: 고객 도메인 → [[cloudflare]](DNS) → OpenWrt HAProxy (80/443) → APISIX hostNetwork (9080/9443, 3노드) → K3s 서비스 → pods 오사카 구성: 고객 도메인 → [[cloudflare]](DNS) → [[crowdsec-safeline|SafeLine WAF]] → APISIX(라우팅) → 고객 오리진 @@ -37,15 +37,18 @@ BunnyCDN(inouter, ID 5316471) → apisix-osaka(172.233.93.180) → 백엔드 - 보안: SafeLine WAF + CrowdSec 연동 - upstream: incus-jp1 내부(10.253.x), K3s Traefik -### 서울 (kr2, incus 컨테이너) +### 서울 (K3s, apisix 네임스페이스) ``` -인터넷 → OpenWrt(:80/:443) → hp2(:9080/:9443, incus proxy device) → APISIX(10.179.99.126) → 백엔드 +인터넷 → OpenWrt HAProxy(:80/:443) → 3노드 hostNetwork(:9080/:9443) → APISIX → K3s 서비스 → pods ``` - 용도: KR존 리버스 프록시 +- 배포: K3s apisix 네임스페이스, hostNetwork 모드로 3노드(hp2/kr1/kr2)에 배포 - upstream: K3s Traefik (192.168.9.134/214/135:443), LAN 서비스(192.168.9.x) - SSL: cert-manager wildcard `*.inouter.com` 인증서 -- Admin API: `curl http://10.179.99.126:9180/apisix/admin` (incus proxy device, 192.168.9.0/24에서 접근 가능) -- etcd: apisix-etcd (10.179.99.101) +- Admin API: `apisix-admin` ClusterIP 서비스 (10.43.70.216:9180) +- etcd: apisix-etcd StatefulSet (K3s 내부, ClusterIP 10.43.20.100:2379) +- NodePort: apisix-gateway 80:32020/TCP, 443:30675/TCP (HAProxy는 hostNetwork :9080/:9443 직접 사용) +- 이전: kr2 incus 컨테이너(10.179.99.126)에서 K3s로 이전 #### global_rules - `real-ip` — source: http_x_real_ip, trusted: 0.0.0.0/0 diff --git a/infra/infra-hosts.md b/infra/infra-hosts.md index 72bc1dd..db23fc0 100644 --- a/infra/infra-hosts.md +++ b/infra/infra-hosts.md @@ -17,7 +17,7 @@ tags: [infra, network, kr-zone, openwrt] | incus-kr1 | 100.84.111.28 | Incus+K3s 호스트 (서울) | default, inbest 프로젝트, K3s control-plane (LAN 192.168.9.214) | | incus-kr2 | 100.119.109.41 | Incus+K3s 호스트 (서울) | default, inbest 프로젝트, K3s control-plane (LAN 192.168.9.135) | | incus-hp2 | 100.100.52.34 | Incus+K3s 호스트 (서울) | Xeon E5-2670 32코어, 188GB RAM, K3s control-plane (LAN 192.168.9.134), default, inbest 프로젝트 | -| openwrt-gw | 100.66.60.66 | OpenWrt 라우터 (서울) | HAProxy: 80/443 → K3s NodePort → APISIX | +| openwrt-gw | 100.66.60.66 | OpenWrt 라우터 (서울) | HAProxy: 80/443 → APISIX hostNetwork 9080/9443 (3노드 roundrobin) | | sandbox-tokyo | 100.79.87.48 | 테스트 서버 (도쿄, Linode) | vault-prod, wg-easy, nginx-tcp-proxy (Docker) | | relay4wd | 100.103.161.4 | APISIX Gateway (서울, AWS Lightsail) | inbest 전용, Docker APISIX 3.15.0, Debian 12, nano $5/월, SSH: admin + lightsail.pem | | synology | 100.126.100.82 | NAS (시놀로지) | | @@ -34,32 +34,37 @@ tags: [infra, network, kr-zone, openwrt] 주요 네임스페이스: anvil, apisix, argocd, cert-manager, db, gitea, ironclad, kroki, longhorn-system, openmemory, registry, system-upgrade, tools, vault -트래픽 흐름: 외부 → OpenWrt HAProxy (80/443) → K3s NodePort (32020/30675) → APISIX Gateway → 서비스 +트래픽 흐름: 외부 → OpenWrt HAProxy (80/443) → APISIX hostNetwork (9080/9443, 3노드) → K3s 서비스 → pods ## 서비스 위치 | 서비스 | 위치 | 접근 방법 | |--------|------|-----------| -| [[apisix]] (오사카) | apisix-osaka (Linode) | SSH 직접 접속 / Admin API | -| [[apisix]] (서울) | hp2 incus 컨테이너 (10.179.99.126) | incus exec apisix / Admin API(:9180) | -| Anvil | K3s 클러스터 (서울, anvil ns) | kubectl | -| ArgoCD | K3s 클러스터 (서울, argocd ns) | kubectl / NodePort 30080 | -| cert-manager | K3s 클러스터 (서울) | kubectl | -| NocoDB | K3s 클러스터 (kr2), namespace tools | kubectl, nocodb.inouter.com | -| ProxySQL | K3s 클러스터 (서울, db ns) | kubectl | -| Prometheus, Grafana | jp1 (monitoring) | incus exec --project monitoring | -| DB 서버 | jp1 (db) | incus exec --project db | +| [[apisix]] (오사카) | apisix-osaka (Linode, Docker) | SSH / Admin API | +| [[apisix]] (서울) | K3s 클러스터 (apisix ns, hostNetwork 3노드) | kubectl / Admin API (ClusterIP 10.43.70.216:9180) | +| Anvil | K3s 클러스터 (anvil ns): nginx(x2), php-fpm(x5), redis, ssh-server, proxysql | kubectl | +| ArgoCD | K3s 클러스터 (argocd ns) | kubectl / NodePort 30080 | +| cert-manager | K3s 클러스터 (cert-manager ns) | kubectl | +| [[gitea]] | K3s 클러스터 (gitea ns): gitea, postgresql, valkey | kubectl, gitea.anvil.it.com | +| Ironclad | K3s 클러스터 (ironclad ns): nginx, php-fpm, redis, ssh-server, proxysql | kubectl / NodePort 30297 | +| Kroki | K3s 클러스터 (kroki ns) | kubectl | +| Longhorn | K3s 클러스터 (longhorn-system ns): 분산 스토리지 | kubectl | +| n8n | K3s 클러스터 (tools ns) | kubectl | +| NocoDB | K3s 클러스터 (tools ns) | kubectl, nocodb.inouter.com | +| OpenMemory | K3s 클러스터 (openmemory ns): mcp, ui, qdrant | kubectl | +| PgCat | K3s 클러스터 (tools ns): PostgreSQL pooler | kubectl | +| ProxySQL | K3s 클러스터 (db ns) | kubectl | +| Registry | K3s 클러스터 (registry ns) | kubectl | +| [[vault]] | K3s 클러스터 (vault ns): HA 3노드(vault-0/1/2), agent-injector, mcp-server | kubectl / vault CLI / MCP | +| Vault (legacy) | sandbox-tokyo (Docker, vault-prod) | vault CLI | +| WireGuard | sandbox-tokyo (wg-easy Docker) | | +| BunnyCDN MCP | K3s 클러스터 (tools ns) | kubectl | +| cfb-manager | K3s 클러스터 (tools ns): CrowdSec-Firewall-Bouncer 관리 | kubectl | +| cloud-api-emulator | K3s 클러스터 (tools ns): Linode/Vultr/Namecheap API | kubectl | +| Prometheus, Grafana | jp1 (monitoring 프로젝트) | incus exec --project monitoring | +| DB 서버 | jp1 (db 프로젝트) | incus exec --project db | | DB (분산) | etcd+mariadb+postgres 각 서울 노드 Incus 컨테이너 | incus exec | | etcd (relay4wd용) | jp1 (db), etcd-1 (10.253.102.11) | etcd 2379 | -| Ironclad | K3s 클러스터 (서울, ironclad ns) | kubectl | -| [[gitea]] | K3s 클러스터 (서울, gitea ns) | kubectl, gitea.anvil.it.com | -| Kroki | K3s 클러스터 (서울, kroki ns) | kubectl | -| Longhorn | K3s 클러스터 (서울, longhorn-system ns) | kubectl | -| OpenMemory | K3s 클러스터 (서울, openmemory ns) | kubectl | -| Registry | K3s 클러스터 (서울, registry ns) | kubectl | -| [[vault]] | K3s 클러스터 (서울, vault ns) + sandbox-tokyo (vault-prod Docker) | kubectl / vault CLI / MCP | -| Vault (prod) | sandbox-tokyo (Docker) | vault CLI | -| WireGuard | sandbox-tokyo (wg-easy Docker) | | | BunnyCDN | 외부 SaaS | BunnyCDN MCP 서버 / API | | [[backup]] | kr2 → NAS → R2 | systemd timer, rclone | @@ -106,7 +111,7 @@ tags: [infra, network, kr-zone, openwrt] └── incus-hp2 (192.168.9.134) ← K3s control-plane 외부 트래픽 흐름: - 인터넷 → OpenWrt HAProxy(:80/:443) → 3노드 roundrobin(:9080/:9443) → APISIX → K3s → pods + 인터넷 → OpenWrt HAProxy(:80/:443) → APISIX hostNetwork(:9080/:9443, 3노드 roundrobin) → K3s svc → pods 내부 트래픽 흐름: LAN → K3s/Traefik(192.168.9.x:80/443) → pods 직접