Skip to content

Commit

Permalink
istio control plane post complete
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Mar 12, 2024
1 parent 711ef0a commit c9e9a0d
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Istio์˜ istiod ๊ผผ๊ผผํžˆ ์‚ดํŽด๋ณด๊ธฐ"
title: "Istio์˜ ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ ๊ผผ๊ผผํžˆ ์‚ดํŽด๋ณด๊ธฐ"
toc: true
toc_sticky: true
categories: ["Kubernetes", "Istio"]
excerpt: "Istiod ๋„ˆ๋Š” ๋ญํ•˜๋Š” ๋…€์„์ด๋‚˜... ๋ฌธ์„œ๋„ ๋ณด๊ณ  ์ปค๋ฎค๋‹ˆํ‹ฐ์—๋„ ๋ฌผ์–ด๋ด์„œ ์–ป์€ ๊นจ๋‹ฌ์Œ ๐Ÿ’ก"
last_modified_at: 2024-03-09
excerpt: "Istiod ๋„ˆ๋Š” ๋ญํ•˜๋Š” ๋…€์„์ด๋‚˜... ๋ฌธ์„œ๋„ ๋ณด๊ณ  ์ปค๋ฎค๋‹ˆํ‹ฐ์—๋„ ๋ฌผ์–ด๋ด์„œ ์–ป์€ ๊นจ๋‹ฌ์Œ ๐Ÿ’ก Galley, Citadel, Mixer๊ฐ€ ๋‚œ๋ฌดํ•˜๋˜ ๋ ˆ๊ฑฐ์‹œ ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ ๊ตฌ์กฐ ํŒŒ์•…ํ•˜๊ธฐ ๐Ÿ‘ป"
last_modified_at: 2024-03-13
---

![](/images/meme/nothing-know.png){: .align-center }
Expand Down Expand Up @@ -79,11 +79,128 @@ kubectl get cm istio-ca-root-cert -o json | jq '.data."root-cert.pem"' -r | open

์บก์ณ๋ฅผ ๋ณด๋ฉด, `default`๊ฐ€ Envoy Proxy๊ฐ€ ๊ฐ€์ง€๋Š” ์ธ์ฆ์„œ์ด๊ณ , `ROOTCA`๊ฐ€ istiod์˜ ์ธ์ฆ์„œ์ด๋‹ค.

Envoy Proxy์˜ ์ธ์ฆ์„œ๋Š” ์ˆ˜๋ช…์ด 24์‹œ๊ฐ„ ๋ฟ์ด๊ณ , ์ด๊ฒƒ์€ 12์‹œ๊ฐ„ ๋งˆ๋‹ค ๊ฐฑ์‹ ๋œ๋‹ค.
Envoy Proxy์˜ ์ธ์ฆ์„œ๋Š” ์ˆ˜๋ช…์ด 24์‹œ๊ฐ„ ๋ฟ์ด์ง€๋งŒ, 12์‹œ๊ฐ„ ๋งˆ๋‹ค ๊ฐฑ์‹ ๋œ๋‹ค.

# ๋งŒ์•ฝ istiod๊ฐ€ ์—†์–ด์ง„๋‹ค๋ฉด??

## ์ผ๋‹จ istio ์„ค์น˜๋Š” ์ œ๋Œ€๋กœ ์•ˆ ๋ฉ๋‹ˆ๋‹ค.

"[Istio Operator ๊ผผ๊ผผํžˆ ์‚ดํŽด๋ณด๊ธฐ](https://bluehorn07.github.io/2024/03/05/istio-operator-detail-examine/)" ํฌ์ŠคํŠธ์—์„œ๋„ ํ™•์ธ ํ–ˆ์ง€๋งŒ, `components.pilot.enabled: false`๋กœ ์„ค์ •ํ•˜๊ณ  `istioctl install`์„ ์‹คํ–‰ํ•˜๋ฉด ingress/egress gateway๊ฐ€ ๋œจ์ง€ ์•Š๊ณ  ๋ฉˆ์ถฐ๋ฒ„๋ฆฐ๋‹ค!!

## istiod๊ฐ€ ์žˆ๋˜ ์ƒํƒœ์—์„œ istiod๊ฐ€ ์—†์–ด์ง„๋‹ค๋ฉด?

์•„๋ž˜ ์ปค๋งจ๋“œ๋กœ ์ž˜ ๋– ์žˆ๋Š” `istiod` ๋””ํ”Œ๋กœ์ด๋ฅผ ๋‚ ๋ ค๋ณด์ž.

```bash
$ kubectl delete deploy istiod -n istio-system
```

์ผ๋‹จ Envoy Sidecar๊ฐ€ ๋ถ™์–ด์žˆ๋˜ ๊ธฐ์กด Pod๋“ค์€ ์•„๋ฌด ์˜ํ–ฅ ์—†์ด ์ž˜ ๋– ์žˆ๋‹ค. ๋˜, Envoy Sidecar๊ฐ€ ์žˆ๋˜ Pod๋“ค์— ํ†ต์‹ ๋„ ์ž˜ ๋œ๋‹ค!!

๊ทธ๋Ÿฐ๋ฐ ๋ฌธ์ œ๋Š” istiod๊ฐ€ ์—†์–ด์ง„ ์ดํ›„์— Pod์ด ๋””ํ”Œ๋กœ์ด๊ฐ€ ๋˜๋ฉด ๋ฐœ์ƒํ•œ๋‹ค.

์ผ๋‹จ `istio-injection=enabled` label์ด ๋ถ™์€ ๋„ค์ž„์ŠคํŽ˜์ด์Šค์—๋Š” ์‹ ๊ทœ Pod์ด ๋œจ์ง€ ์•Š๋Š”๋‹ค!! ์ด๊ฒƒ์€ `istio-injection`์„ ์ˆ˜ํ–‰ํ•  istiod๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์— ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ๋‹ค!!

๋˜, Envoy Sidecar๊ฐ€ ๋ถ™์—ˆ๋˜ ์›Œํฌ๋กœ๋“œ๋Š” istiod๊ฐ€ ์—†์–ด์ง€๋ฉด์„œ Service Discovery ๊ธฐ๋Šฅ์„ ์ƒ์‹คํ•˜๊ฒŒ ๋œ๋‹ค. ๊ทธ๋ž˜์„œ ์ƒˆ๋กœ์šด Service๋ฅผ ๋„์›Œ์„œ ์—”๋“œํฌ์ธํŠธ๊ฐ€ ์ถ”๊ฐ€๋˜์–ด ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ์™€ ํ•จ๊ป˜ ํ†ต์‹ ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค.

```
upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: 113
```

๋‹จ, Envoy Sidecar๊ฐ€ ์—†๋Š” non-istio ์›Œํฌ๋กœ๋“œ์—์„œ๋Š” ์ •์ƒ์ ์œผ๋กœ ์ ‘๊ทผํ•œ๋‹ค!

์•”ํŠผ ๊ฒฐ๋ก ์€ istiod๊ฐ€ ์—†์–ด์ง€๋ฉด ๋Œ€์žฌ์•™์ด๋ผ๋Š”๊ฑฐ...

# Legacy ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ์˜ ์•„ํ‚คํ…์ฒ˜ (istio 1.5 ์ด์ „)

https://istio.io/latest/blog/2020/istiod/
![](/images/development/istio/istio-old-architecture.png)

istio๊ฐ€ ์ฒ˜์Œ ์ถœ์‹œ ๋˜์—ˆ์„ ๋•Œ๋งŒ ํ•ด๋„ istio์˜ ๊ตฌ์กฐ๋Š” ์ง€๊ธˆ๊ณผ๋Š” ๋งŽ์ด ๋‹ฌ๋ž๋‹ค. ํŠนํžˆ ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ์ด ๋งŽ์ด ๋‹ค๋ฅธ๋ฐ, ์ง€๊ธˆ์€ `istiod` ํ•˜๋‚˜๋งŒ ์žˆ๋Š” ๋ชจ๋…ธ๋ฆฌํ‹ฑ ์ปดํฌ๋„ŒํŠธ์ง€๋งŒ, 1.5 ์ด์ „ ๋ฒ„์ „์—์„œ๋Š” "pilot", "galley", "citadel", "mixer"๋กœ ๊ตฌ์„ฑ๋œ MSA ๊ตฌ์กฐ ์˜€๋‹ค. (์ฐธ๊ณ ๋กœ istio 1.5 ๋ฒ„์ „์€ 2020๋…„ 3์›”์— ๋ฐœํ‘œ ๋˜์—ˆ๋‹ค.)

istio๊ฐ€ ์ปจํŠธ๋กค ํ”Œ๋ ˆ์ธ์„ MSA ๊ตฌ์กฐ์—์„œ `istiod` ๋‹จ์ผ ๊ตฌ์กฐ๋กœ ์ „ํ™˜ํ•œ ๊ฒƒ์— ๋Œ€ํ•œ ์ด์•ผ๊ธฐ๋Š” istio์˜ ๊ณต์‹ ๋ธ”๋กœ๊ทธ์— ์ž์„ธํžˆ ๋‹ด๊ฒจ ์žˆ๋‹ค.

โžก๏ธ [Introducing istiod: simplifying the control plane](https://istio.io/latest/blog/2020/istiod/)

istio์˜ ์—ฃ๋‚  ๊ตฌ์กฐ๋ฅผ ์•Œ์•„๋ณด๋Š”๊ฒŒ ๋ฌด์Šจ ํ•„์š”๊ฐ€ ์žˆ์„๊นŒ ์‹ถ๊ธด ํ•˜์ง€๋งŒ istio๋ฅผ ๊ณต๋ถ€ํ•˜๋‹ค๋ณด๋ฉด ์˜›๋‚  ๊ตฌ์กฐ์— ๋Œ€ํ•œ ์šฉ์–ด๋„ ๊ฝค ๋‚˜์˜ค๊ธฐ์— ์ด ๋ฌธ๋‹จ์— ์ •๋ง ๊ฐ„๋‹จํ•˜๊ฒŒ ํ›‘๊ณ  ๊ฐ€๋ณด๊ณ ์ž ํ•œ๋‹ค.

## Pilot

> Traffic Management, and Service Discovery
์ง€๊ธˆ๋„ ๊ทธ๋ ‡๊ณ  ์˜ˆ์ „์—๋„ ๊ทธ๋ ‡๊ณ  istio์—์„œ ๊ฐ€์žฅ ํ•ต์‹ฌ์ด ๋˜๋Š” ์ปดํฌ๋„ŒํŠธ๋‹ค.

์ผ๋‹จ istio์˜ ๊ฐ์ข… Traffic Managemenet API(`VirtualService`, `DestinationRule`, `Gateways`, `ServiceEntry`, `Sidecar`)๊ฐ€ ๋™์ž‘ ํ•  ์ˆ˜ ์žˆ๋„๋ก Envoy์— ์ฃผ์ž…ํ•˜๋Š” ์—ญํ• ์„ pilot์ด ํ•œ๋‹ค!!

๊ฒŒ๋‹ค๊ฐ€ Service Discovery ์—ญํ• ๋„ ์ˆ˜ํ–‰ํ•˜๋Š”๋ฐ, K8s ํด๋Ÿฌ์Šคํ„ฐ์™€ istio ์„œ๋น„์Šค ๋ฉ”์‰ฌ์— ์ƒˆ๋กœ์šด ์ธ์Šคํ„ด์Šค๊ฐ€ ๋””ํ”Œ๋กœ์ด ๋˜๋ฉด, ํ•ด๋‹น ์ •๋ณด๋ฅผ ๋ฐ˜์˜ํ•œ ์ƒˆ๋กœ์šด Envoy ๊ทœ์น™์„ ๊ฐ Envoy Poroxy์— ์ „ํŒŒํ•œ๋‹ค.

## Galley

> Configuration Management
`VirtualService`, `DestinationRule` ๊ฐ™์ด K8s ๋ฆฌ์†Œ์Šค๋กœ ์ •์˜ํ•œ ๊ฒƒ๋“ค์„ ์ฝ์–ด์„œ ๊ฒ€์ฆํ•˜๊ณ , Envoy Proxy๊ฐ€ ์ดํ•ด ๊ฐ€๋Šฅํ•œ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค.

Pilot์ด๋ž‘ ๋‹ค๋ฃจ๋Š” ๋ฆฌ์†Œ์Šค๊ฐ€ ๊ฒน์ณ์„œ ์ข€ ํ—ท๊ฐˆ๋ฆฌ๊ธด ํ•˜๋Š”๋ฐ, ์ผ๋‹จ Pilot์€ ๋ผ์šฐํŒ…๊ณผ ํŠธ๋ž˜ํ”ฝ ์ •์ฑ…์„ Envoy์— ์ „ํŒŒํ•˜๊ณ  ์ ์šฉํ•˜๋Š” ์—ญํ• ์„ ๋‹ด๋‹นํ•œ๋‹ค. ๋ฐ˜๋ฉด, Galley๋Š” ๊ตฌ์„ฑ์„ ๊ฒ€์ฆํ•˜๊ณ  ์ค‘์•™์—์„œ ๊ด€๋ฆฌํ•˜๋Š” ์—ญํ• ์— ์ง‘์ค‘ํ•œ๋‹ค.

์ฐธ๊ณ ๋กœ Galley๋Š” "๋น„ํ–‰๊ธฐ๋‚˜ ์„ ๋ฐ•์— ์Šน๊ฐ์—๊ฒŒ ์‹์‚ฌ๋‚˜ ์Œ๋ฃŒ ์„œ๋น„์Šค๋ฅผ ์œ„ํ•œ ๊ธฐ๋‚ด ๊ณต๊ฐ„"์„ ๋งํ•œ๋‹ค.

## Citadel

> Certificate Generation
์ด ๋…€์„์ด ํ•˜๋˜ ์ผ์€ ๋ช…ํ™•ํ•˜๋‹ค. istio ์›Œํฌ๋กœ๋“œ ์‚ฌ์ด์— mTLS ํ†ต์‹ ์„ ์„ธํŒ… ํ•˜๊ธฐ ์œ„ํ•ด์„œ Certificate๋ฅผ ์‹ธ์ธ ํ•˜๊ณ  ์ฃผ์ž…ํ•˜๋Š” ๊ฒƒ์ด๋‹ค.

์ฐธ๊ณ ๋กœ Citadel์€ "์„ฑ์ฑ„"๋ผ๋Š” ๋œป์ด๋‹ค.

## Mixer

![](https://istio.io/v1.4/docs/reference/config/policy-and-telemetry/mixer-overview/topology-without-cache.svg){: .align-center style="max-width: 520px"}
[istio 1.4: Mixer Configuration Model](https://istio.io/v1.4/docs/reference/config/policy-and-telemetry/mixer-overview/#configuration-model)
{: .small .text-center .gray }

> Collect Telemetry, and Access Control
์ด ๋…€์„๋„ ์ดํ•ด ํ•˜๋Š”๊ฒŒ ๋งŒ๋งŒ์น˜ ์•Š์•˜๋‹ค. ์ผ๋‹จ Mixer๋Š” ๋‘๊ฐ€์ง€ ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•œ๋‹ค: "Telemtry"์™€ "Policy Check"๋‹ค.

Telemtry ์—ญํ• ์€ Envoy๊ฐ€ ๋ณด๊ณ ํ•˜๋Š” metric๊ณผ log ์ •๋ณด๋ฅผ ๋ชจ์•„์„œ ์ฒ˜๋ฆฌํ•œ๋‹ค. ์ด๋Š” Istio์˜ Tracing & Audit๊ณผ ๊ด€๋ จ ์žˆ๋‹ค. ๋˜ํ•œ, Mixer๊ฐ€ ๋ชจ์€ ์ง€ํ‘œ๋Š” Prometheus๋‚˜ Datadog๊ณผ ๊ฐ™์€ ์™ธ๋ถ€ ๋ฐฑ์—”๋“œ๋กœ ๋ณด๋‚ผ ์ˆ˜๋„ ์žˆ๋‹ค. ๋˜, ๋‹ค์ˆ˜์˜ ์™ธ๋ถ€ ๋ฐฑ์—”๋“œ๋ฅผ ๋‘๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค. (์—ฌ๋Ÿฌ ์™ธ๋ถ€ ๋ฐฑ์—”๋“œ๋ฅผ ์ง€์›ํ•˜๊ธฐ ์œ„ํ•ด "Adaptor Pattern"์„ ์ฑ„ํƒ ํ•œ ๊ฒƒ!)

Access Control ์—ญํ• ์€ `AuthorizationPolicy`๋ฅผ ํ‰๊ฐ€ํ•ด ๋‘ ์›Œํฌ๋กœ๋“œ๊ฐ€ ํ†ต์‹  ๊ฐ€๋Šฅํ•œ์ง€ ์—ฌ๋ถ€๋ฅผ Envoy์— ๋ฆฌํ„ด ํ•ด์ฃผ๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค.

๊ทธ์™ธ์—๋„ ์„œ๋น„์Šค์˜ ์ด ์ฒ˜๋ฆฌ๋Ÿ‰์„ ์ •์ฑ…์œผ๋กœ ์ง€์ •ํ•ด ๊ทธ ์ฒ˜๋ฆฌ๋Ÿ‰ ์ด์ƒ์œผ๋กœ ์š”์ฒญ์„ ๋ชป๋ฐ›๊ฒŒ ํ•˜๊ฑฐ๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค.

### Adaptor Pattern

![](https://refactoring.guru/images/patterns/diagrams/adapter/solution-en-2x.png?id=5846ed9b88cad0220993f79bdfe817a8){: .align-center style="max-width: 400px"}
[Design Guru: Adapter](https://refactoring.guru/design-patterns/adapter)
{: .small .text-center .gray }

๋””์ž์ธ ํŒจํ„ด ์ค‘์— ํ•˜๋‚˜์ธ ์–ด๋Œ‘ํ„ฐ ํŒจํ„ด์€ ์ œ๊ณต ๋˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค๋ฅธ ๋ฐฑ์—”๋“œ์—์„œ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ทธ์ชฝ ๋ฐฑ์—”๋“œ์˜ ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•ด์ฃผ๋Š” ํŒจํ„ด์„ ๋งํ•œ๋‹ค. Prometheus์˜ "[Exporter](https://prometheus.io/docs/instrumenting/exporters/)"๋„ Prometheus ์ง€ํ‘œ ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•ด์ฃผ๋Š” ์–ด๋Œ‘ํ„ฐ์˜ ์˜ˆ์‹œ์ธ ๊ฒƒ ๊ฐ™๋‹ค.

Mixer๋Š” ์–ด๋Œ‘ํ„ฐ ํŒจํ„ด์„ ์ฑ„์šฉํ•ด ์ •๋ง ๋‹ค์–‘ํ•œ ์™ธ๋ถ€ ๋ฐฑ์—”๋“œ์— ๋ฐ์ดํ„ฐ๋ฅผ ์  ์ˆ˜ ์žˆ์—ˆ๋‹ค.

- Metric
- Datadog
- CloudWatch
- Prometheus
- StatsD
- Stackdriver
- Logging
- Fluentd
- Stackdriver
- Trace Span
- Zipkin
- Stackdriver
- Authorization
- Any OIDC identity providers
- Quota
- Redis Quota
- Memory Quota

์–ดํ›„ ์ด๋ ‡๊ฒŒ ๋ณด๋‹ˆ๊นŒ istiod ๋‹จ์ผ ๊ตฌ์กฐ๋กœ ๊ฐ„๊ฒŒ ์ง„์งœ ๋‹คํ–‰์ผ ์ •๋„... ํŠนํžˆ Mixer๋Š” ์ง„์งœ ๐Ÿถ๊ฐ™๋‹ค

# ์ฐธ๊ณ ์ž๋ฃŒ

- [istio 1.4: Architecture](https://istio.io/v1.4/docs/ops/deployment/architecture/)
- istio 1.5 ์ง์ „์˜ ๊ตฌ์กฐ์— ๋Œ€ํ•œ ๋ฌธ์„œ๋ผ ๊ทธ๋Ÿฐ์ง€ ๊ฐ ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ์„ค๋ช…์ด ์ •๋ง ์ž์„ธํ•˜๋‹ค. ์ •๋ง ๋งŽ์€ ๋„์›€์ด ๋˜์—ˆ๋‹ค!! ๐Ÿ‘
- [Introducing istiod: simplifying the control plane](https://istio.io/latest/blog/2020/istiod/)
- istio๊ฐ€ ์™œ MSA ๊ตฌ์กฐ์—์„œ ๋‹จ์ผ ๊ตฌ์กฐ๋กœ ์ „ํ™˜ ํ–ˆ๋Š”์ง€, ๋Š˜ ๊ถ๊ธˆํ–ˆ๋Š”๋ฐ ์š” ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŠธ์— ์ž˜ ์ •๋ฆฌ ๋˜์–ด ์žˆ๋‹ค ใ…Žใ…Ž
- [Istio Service Mesh Workshop](https://www.istioworkshop.io/03-servicemesh-overview/istio-architecture/)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c9e9a0d

Please sign in to comment.