docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거

Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
Antigravity Agent
2026-07-05 00:33:48 +09:00
parent 1cfd3bbb56
commit 9148c358d0
6455 changed files with 1 additions and 86875 deletions
@@ -0,0 +1,195 @@
---
id: devops-service-mesh-deep
title: Service Mesh — Istio / Linkerd / 트래픽 관리
category: Coding
status: draft
source_trust_level: B
verification_status: conceptual
created_at: 2026-05-09
updated_at: 2026-05-09
tags: [devops, service-mesh, istio, linkerd, vibe-coding]
tech_stack: { language: "YAML / Istio / Linkerd", applicable_to: ["DevOps"] }
applied_in: []
aliases: [Istio, Linkerd, service mesh, sidecar, mTLS, traffic split, virtual service]
---
# Service Mesh
> Pod 옆 sidecar proxy (Envoy / linkerd2-proxy) 가 통신 가로챔. **mTLS 자동 / traffic split / retry / circuit breaker 코드 외부화**. **Linkerd = 가벼움, Istio = 풀 기능**.
## 📖 핵심 개념
- Sidecar: 매 pod 옆 proxy.
- Data plane: 실제 트래픽 처리.
- Control plane: 정책 배포 (Istiod, linkerd-controller).
- mTLS: 자동 - 모든 service 간 암호화 + 인증.
## 💻 코드 패턴
### Linkerd 설치
```bash
linkerd check --pre
linkerd install --crds | kubectl apply -f -
linkerd install | kubectl apply -f -
linkerd check
```
### Inject sidecar
```bash
kubectl get deploy api -o yaml | linkerd inject - | kubectl apply -f -
# 또는 namespace 자동
kubectl annotate ns prod linkerd.io/inject=enabled
```
### mTLS (자동)
```bash
linkerd viz edges deployment
# 모든 service 간 → mTLS
```
### Istio VirtualService (traffic split)
```yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata: { name: api }
spec:
hosts: [api]
http:
- match: [{ headers: { x-canary: { exact: "true" } } }]
route: [{ destination: { host: api, subset: v2 } }]
- route:
- { destination: { host: api, subset: v1 }, weight: 90 }
- { destination: { host: api, subset: v2 }, weight: 10 }
```
```yaml
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata: { name: api }
spec:
host: api
subsets:
- name: v1
labels: { version: v1 }
- name: v2
labels: { version: v2 }
```
→ 90/10 canary, header 가 있으면 100% v2.
### Retry / timeout
```yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata: { name: api }
spec:
http:
- route: [{ destination: { host: api } }]
timeout: 5s
retries:
attempts: 3
perTryTimeout: 2s
retryOn: 5xx,reset,connect-failure
```
### Circuit breaker
```yaml
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata: { name: api }
spec:
host: api
trafficPolicy:
connectionPool:
tcp: { maxConnections: 100 }
http: { http2MaxRequests: 1000, maxRequestsPerConnection: 10 }
outlierDetection:
consecutive5xxErrors: 5
interval: 30s
baseEjectionTime: 30s
```
### AuthorizationPolicy
```yaml
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata: { name: api-allow }
spec:
selector: { matchLabels: { app: api } }
rules:
- from:
- source: { principals: ["cluster.local/ns/prod/sa/web"] }
to:
- operation: { methods: [GET, POST] }
```
### Linkerd traffic split (SMI)
```yaml
apiVersion: split.smi-spec.io/v1alpha1
kind: TrafficSplit
metadata: { name: api-split }
spec:
service: api
backends:
- { service: api-v1, weight: 90 }
- { service: api-v2, weight: 10 }
```
### 관찰 (Linkerd viz)
```bash
linkerd viz dashboard
# 자동: success rate, RPS, p95/p99, mTLS 표시
```
### Istio observability
- Kiali: service graph.
- Jaeger: tracing.
- Grafana: metrics.
### Ambient mode (Istio sidecar 없는)
- ztunnel (per-node) + waypoint proxy.
- 자원 효율 더 좋음.
- 새 (2024+).
### Trade-offs
```
장점:
- 코드 변경 X
- 통일 정책 (mTLS, retry, CB)
- Observability 자동
단점:
- 자원 (각 pod + sidecar)
- 복잡도 (특히 Istio)
- Latency (~1-3ms per hop)
- Debug 어려움
```
## 🤔 의사결정 기준
| 규모 | 추천 |
|---|---|
| <10 service | mesh 불필요 — 직접 |
| 10-100 service | Linkerd (가볍고 단순) |
| 큰 / 복잡 정책 | Istio |
| 자원 절약 | Linkerd 또는 Istio Ambient |
| GKE | Istio (기본 통합) |
| 자체 호스트 작은 팀 | Linkerd |
## ❌ 안티패턴
- **Mesh 도입 + 단순 정책**: overkill. ingress + library 충분.
- **모든 retry 같은 정책**: 어떤 endpoint 는 idempotent X.
- **CB 없이 cascading failure**: 한 service 죽으면 모두.
- **mTLS 가정 + 외부 통신**: gateway 만 mTLS — 외부 API 는 공개.
- **Sidecar resource 안 잡음**: pod scheduling 깨짐.
- **Istio 1.0 부터 풀 기능 도입**: 점진. STRICT mTLS 부터.
- **Egress 무제어**: 외부 호출 무제한.
## 🤖 LLM 활용 힌트
- Linkerd 시작 → 단순.
- Istio = 풀 기능, 학습 곡선.
- mTLS / retry / CB / observability 가 ROI 높음.
## 🔗 관련 문서
- [[Security_mTLS_Patterns]]
- [[DevOps_Kubernetes_Basics]]
- [[Backend_Circuit_Breaker]]