Service Mesh - heshed/aPaaS GitHub Wiki
Servie Mesh
๊ฐ๋ ์ค๋ช
data plane
๋คํธ์ํฌ ํธ๋ํฝ flow ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ sidecar proxy. envoy, haproxy, nginx, linkerd, Traefik
- Service discovery
- Health checking
- Routing
- Load balancing
- Authentication & authorization
- Observability : statistics, logging, distributed tracing
control plane
data plane ์ ์ค์ ํ๊ณ ๊ด๋ฆฌํ๋ ์์คํ
Istio Pilot, Nelson, SmartStack, go-control-plane
- The human...
- Control plane UI
- Workload scheduler
- Service discovery
- Sidecar proxy configuration APIs
control plane product
Envoy
control-plane api ๋ ์ง์ ๊ฐ๋ฐ์ด ํ์ํ๋ค. istio pilot ์ k8s ์ ์ฉ์ผ๋ก ๊ตฌํ๋ ๊ฒ์ด๊ณ , ๋ฐ๋ก ๋ผ์ด ์ฐ๊ธฐ์๋ ๋ฌด๋ฆฌ๊ฐ ์๋ค. go-control-plane ๋ ๊ธฐ๋ณธ stub ์ฝ๋๋ง ๋์ด ์๊ณ ์ค์ ๊ตฌํ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ํฌํธํ์ฌ ์ง์ ๊ตฌํํด์ผ ํ๋ค.
Envoy XDS
Discovery Services ๋ฅผ XDS๋ก ๋ถ๋ฅด๋ ๋ฏํ๋ค.
Cluster Discovery Service (CDS).
Endpoint Discovery Service (EDS).
Health Discovery Service (HDS).
Listener Discovery Service (LDS).
Metric Service (MS).
Rate Limit Service (RLS)
Route Discovery Service (RDS).
Secret Discovery Service (SDS).
XDS์ ์ ๋ฐ์ดํธ ์์๋ฅผ ์ธ๋ฐํ๊ฒ ์ ํ ํ๊ธฐ ์ํด์ ADS(Aggregated Discovery Service) ์คํ์ด ์ ๊ณต๋๋ค.
Writing a control plane for Envoy is not an easy task
Envoy ์ฉ์ด
- Cluster
- Cluster๋ Envoy๊ฐ ์ฐ๊ฒฐํ๋ ๋ ผ๋ฆฌ์ ์ผ๋ก ์ ์ฌํ ์๋ํฌ์ธํธ์ ๊ทธ๋ฃน์ ๋๋ค.v2์์ RDS๋ Cluster๋ฅผ ๊ฐ๋ฆฌํค๋ฉฐ CDS๋ Cluster ๊ตฌ์ฑ์ ์ ๊ณตํ๊ณ Envoy๋ EDS๋ฅผ ํตํด Cluster ๊ตฌ์ฑ์์ ๋ฐ๊ฒฌํฉ๋๋ค.
- Downstream
- Downstream ํธ์คํธ๊ฐ Envoy์ ์ฐ๊ฒฐํ๊ณ , ์์ฒญ์ ๋ณด๋ด๊ณ , ์๋ต์ ์์ ํฉ๋๋ค.
- Endpoint
- Endpoint์ ํ๋ ์ด์์ Cluster์ ๊ตฌ์ฑ์์ธ Upstream ํธ์คํธ์ ๋๋ค. Endpoint๋ EDS๋ฅผ ํตํด ๋ฐ๊ฒฌ๋ฉ๋๋ค.
- Listener
- Listener๋ ๋ช ๋ช ๋ ๋คํธ์ํฌ ์์น (์ : ํฌํธ, ์ ๋์ค ๋๋ฉ์ธ ์์ผ ๋ฑ)์ ๋๋ค. downstream ํด๋ผ์ด์ธํธ์ ์ํด ์ฐ๊ฒฐ๋ ์ ์๋ ๋คํธ์ํฌ ์์น์ ๋๋ค. Envoy๋ downstream ํธ์คํธ๊ฐ ์ฐ๊ฒฐํ๋ ํ๋ ์ด์์ Listener๋ฅผ ๋ ธ์ถํฉ๋๋ค.
- Locality
- Envoy ์ธ์คํด์ค ๋๋ Endpoint์ด ์คํ๋๋ ์์น. ์ฌ๊ธฐ์๋ zone, zone ๋ฐ sub-zone ์๋ณ์ด ํฌํจ๋ฉ๋๋ค.
- Management server
- v2 Envoy API๋ฅผ ๊ตฌํํ๋ ๋ ผ๋ฆฌ ์๋ฒ. ์ด๊ฒ์ ๋ณต์ / ์ ๋จ ๋ ์ ์๊ณ ๋ค๋ฅธ xDS API์ ์ฌ์ฉ๋๋ API๊ฐ ๋ค๋ฅธ ๋ฌผ๋ฆฌ์ ์์คํ ์์ ๊ตฌํ ๋ ์ ์๊ธฐ ๋๋ฌธ์ ๋ฐ๋์ ๋จ์ผ ๋ฌผ๋ฆฌ์ ๊ธฐ๊ณ๋ ์๋๋๋ค.
- Region
- Zone์ด ์์นํ ์ง๋ฆฌ์ zone.
- Sub-zone
- Envoy ์ธ์คํด์ค ๋๋ Endpoint์ด ์คํ๋๋ zone ๋ด์ ์์น์ ๋๋ค. ์ด๋ฅผ ํตํด Zone ๋ด์์ ์ฌ๋ฌ ๊ฐ์ ๋ก๋ ๋ฐธ๋ฐ์ฑ ๋์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
- Upstream
- Upstream ํธ์คํธ๋ Envoy์ ์ฐ๊ฒฐ๊ณผ ์์ฒญ์ ์์ ํ๊ณ ์๋ต์ ๋ฐํํ๋ค.
- xDS
- CDS / EDS / HDS / LDS / RLS / RDS / SDS API.
- Zone
- AWS์ ๊ฐ์ฉ์ฑ Zone (AZ), GCP์ Zone.
Gloo ์์คํ ๊ตฌ์ฑ๋
Istio
k8s ๋ก์ปฌ ๊ฐ๋ฐ
- https://github.com/GoogleContainerTools/skaffold (์๋์ )
- https://github.com/windmilleng/tilt
- https://github.com/garden-io/garden
- https://github.com/kubernetes-sigs/kind
ref
- https://cloud.google.com/istio/
- https://dzone.com/articles/istio-service-mesh-the-step-by-step-guide-part-2-t
- https://medium.com/@jwlee98/gcp-gke-%EC%B0%A8%EA%B7%BC-%EC%B0%A8%EA%B7%BC-%EC%95%8C%EC%95%84%EB%B3%B4%EA%B8%B0-7%ED%83%84-istio-%EB%A1%9C-%ED%95%98%EB%8A%94-service-mesh-9e9363945cbb
- https://www.infoq.com/articles/ambassador-api-gateway-kubernetes/
- https://medium.com/solo-io/building-a-control-plane-for-envoy-7524ceb09876