-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcb76e5
commit e5dc721
Showing
3 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,16 @@ toc: true | |
toc_sticky: true | ||
categories: ["Kubernetes", "Istio"] | ||
excerpt: "Auth์ Authz๋ฅผ istio ์ธํ๋ผ ๋ ๋ฒจ์์ ๊ตฌํํ๊ธฐ!" | ||
last_modified_at: 2024-03-15 | ||
last_modified_at: 2024-03-23 | ||
--- | ||
|
||
![](/images/meme/dump-head.png){: .align-center style="max-width: 400px" } | ||
|
||
istio๋ฅผ ์ฌ์ฉํ๋ฉด Authentication๊ณผ Authorization์ Envoy Proxy ๋ ๋ฒจ์์ ์ํํ ์ ์๋ค. ์ด๊ฑด Auth & Authz ๋ก์ง์ ์ดํ๋ฆฌ์ผ์ด์ ์์ ๊ตฌํ์ด ์์ด๋ ์ํฌ๋ก๋๋ฅผ ๋ณดํธํ ์ ์๋๋ก ํ๋ ๊ธฐ๋ฅ ๊ฐ๋ค!! | ||
istio๋ฅผ ์ฌ์ฉํ๋ฉด Authentication๊ณผ Authorization์ Envoy Proxy ๋ ๋ฒจ์์ ์ํํ ์ ์๋ค. ์ด๊ฑด AuthN & AuthZ ๋ก์ง์ ์ดํ๋ฆฌ์ผ์ด์ ์์ ๊ตฌํ์ด ์์ด๋ ์ํฌ๋ก๋๋ฅผ ๋ณดํธํ ์ ์๋๋ก ํ๋ ๊ธฐ๋ฅ ๊ฐ๋ค!! | ||
|
||
# ์ฌ์ ์ค๋น: helloworld ์์ | ||
|
||
Istio ์์ ๋ก ์ ๊ณต๋๋ helloworld ์์ ๋ฅผ ํ์ฉํด์ Istio์ Auth&Authz์ ๊ฒ์ฆํด๋ณด์. ์์ธํ ์์ ๋ ์ด์ ์ ์ ์ด๋ [Istio 'helloworld' ๋ฐ๋ชจ](https://bluehorn07.github.io/2024/02/05/istio-helloworld-demo/) ํฌ์คํธ์์ ํ์ธํ ์ ์๋ค. | ||
Istio ์์ ๋ก ์ ๊ณต๋๋ helloworld ์์ ๋ฅผ ํ์ฉํด์ Istio์ AuthN&AuthZ์ ๊ฒ์ฆํด๋ณด์. ์์ธํ ์์ ๋ ์ด์ ์ ์ ์ด๋ [Istio 'helloworld' ๋ฐ๋ชจ](https://bluehorn07.github.io/2024/02/05/istio-helloworld-demo/) ํฌ์คํธ์์ ํ์ธํ ์ ์๋ค. | ||
|
||
์ผ๋จ ์์ ๋ช ๋ น์ด๋ก ์ํฌ๋ก๋๋ฅผ ๋์ฐ๊ณ | ||
|
||
|
@@ -72,10 +72,13 @@ spec: | |
rules: | ||
- from: | ||
- source: | ||
# format: issuer/subject | ||
requestPrincipals: ["[email protected]/[email protected]"] | ||
EOF | ||
``` | ||
|
||
์ด๋ "issuer"๋ ํ ํฐ์ ๋ฐ๊ธํ ์ฃผ์ฒด(์ธ์ฆ์๋ฒ), "subject"๋ ํ ํฐ์ ๋ฐ๊ธ๋ฐ์ ์ฃผ์ฒด(์ฌ์ฉ์, ์๋น์ค๊ณ์ )์ ํํํ๋ค. | ||
|
||
## JWT ์ค์ด์ ์์ฒญ ๋ณด๋ด๊ธฐ | ||
|
||
`RequestAuthentication`๊ณผ `AuthorizationPolicy` ๋ฆฌ์์ค๋ฅผ ์ถ๊ฐํ๊ณ ๋ ๋ค์ ์์ฒญ์ ๋ณด๋ด๋ฉด, ์๋์ ๊ฐ์ด ์์ฒญ์ด ๊ฑฐ๋ถ ๋๋ค. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
_posts/development/istio/2024-03-23-istio-crd-others-memo.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
title: "Istio CRD ์ค์ ์ง์ฝ์ ์ธ ๋๋จธ์ง ๊ฒ๋ค ์ ๋ฆฌ" | ||
toc: true | ||
toc_sticky: true | ||
categories: ["Kubernetes", "Istio"] | ||
excerpt: "์๋ Istio์ ์ด๋ฐ ๋ฆฌ์์ค๋ ์์์ด ์ถ์ ๊ฒ๋ค์ ์์ฃผ ๊ฐ๋จํ ์ ๋ฆฌํด๋ดค๋ค: " | ||
last_modified_at: 2024-03-23 | ||
--- | ||
|
||
```bash | ||
$ kubectl get crd | grep istio | ||
authorizationpolicies.security.istio.io 2024-03-22T07:07:06Z | ||
destinationrules.networking.istio.io 2024-03-22T07:07:07Z | ||
envoyfilters.networking.istio.io 2024-03-22T07:07:07Z | ||
gateways.networking.istio.io 2024-03-22T07:07:07Z | ||
istiooperators.install.istio.io 2024-03-22T07:07:07Z | ||
peerauthentications.security.istio.io 2024-03-22T07:07:07Z | ||
proxyconfigs.networking.istio.io 2024-03-22T07:07:07Z | ||
requestauthentications.security.istio.io 2024-03-22T07:07:07Z | ||
serviceentries.networking.istio.io 2024-03-22T07:07:07Z | ||
sidecars.networking.istio.io 2024-03-22T07:07:07Z | ||
telemetries.telemetry.istio.io 2024-03-22T07:07:07Z | ||
virtualservices.networking.istio.io 2024-03-22T07:07:07Z | ||
wasmplugins.extensions.istio.io 2024-03-22T07:07:07Z | ||
workloadentries.networking.istio.io 2024-03-22T07:07:07Z | ||
workloadgroups.networking.istio.io 2024-03-22T07:07:07Z | ||
``` | ||
|
||
ICA ์ํ ์ค๋นํ ๋, ์์ ๋ช ๋ น์ด๋ฅผ ์ณ์ ๋์จ Istio ๋ฆฌ์์ค๋ค์ ๋ชจ๋ ๊ณต๋ถํ๊ฒ ๋ค๋ ๋ค์ง์ ํ๋ค ใ ใ ใ `VirtualService` `DestinationRule`, `Gateway`์ Istio๋ฅผ ์ฒ์ ๊ณต๋ถํ ๋๋ถํฐ ๋ดค๋ ๊ฒ๋ค์ด๊ณ , `IstioOperator`๋ istio ์ค์น๋ Mesh Config ์ดํด๋ณด๋ฉด์ ๊น๊ฒ ๊ณต๋ถ ํ๊ณ , `ServiceEntry`๋ Egress Gateway ๋ ๊ณต๋ถํ๊ณ , `AuthorizationPolicy`, `PeerAuthentication`, `RequestAuthentication`, `Sidecar`๋ Istio์ Security ๊ด๋ จํด์ ๊ณต๋ถํ ๋ ์ดํด๋ดค๋ค. | ||
|
||
์ด์ ๋๋จธ์ง ๋จ์ ๊ฒ๋ค์ ์ง์ง์ง์ง ์ ํ ๊ธฐํ๋ ๊ฑฐ์ ์์๊ณ , Istio ๊ณต๋ถํ๋ฉด์ ๋ณธ ํ ํฌ ์์์ด๋ ๋ธ๋ก๊ทธ์์ ๊ฑฐ์ ๋ฑ์ฅ ์ ํ๋ ๊ฒ๋ค์ด๋ค. ๊ทธ๋ฐ๋ฐ ์ํ์๋ ๋ญ๊ฐ ๋์ฌ์ง ๋ชจ๋ฅด๋... ์ผ๋จ ๊ณต๋ถ๋ ๋ค ํด๋ดค๋ค... (์ฅํ๋ค ๋ ์์ ...) | ||
|
||
์ด๋ฏธ ์ดํด๋ณธ ๊ฒ๋ค์ | ||
- `VirtualService`, `DestinnationRule`, `Gateway` | ||
- `IstioOperator` | ||
- `ServiceEntry` | ||
- `AuthorizationPolicy`, `PeerAuthentication`, `RequestAuthentication`, `Sidecar` | ||
|
||
์ง์ง ์ฉ๋ฆฌ๋ค๋ก ICA ์ํ์ ์ ๋์ฌ ๊ฒ ๊ฐ์ ๊ฒ๋ค... | ||
|
||
- `WorkloadGroup`, `WorkloadEntry` | ||
- `Telemtry` | ||
- `WasmPlugin` | ||
- `EnvoyFilter` | ||
- `ProxyConfig` | ||
|
||
๊ทธ๋๋ ํ๋ฒ์ฉ ๋ฌธ์๋ ๋ค ์ดํด๋ดค์ผ๋!! ๊ณต๋ถํ๊ฒ ์๊น์์๋ผ๋ ์ฌ๊ธฐ์ ์ ๋ฆฌํด๋๊ฒ ๋ค!! โค๏ธโ๐ฅ | ||
|
||
# WorkloadGroup & WorkloadEntry` | ||
|
||
์๊ฑด Istio์ [Virtual Machine Archtecture](https://bluehorn07.github.io/2024/03/23/istio-virtual-machine-architecture/) ์ดํด๋ณด๋ฉด์ ๊ณต๋ถํ๊ณ ์ ๋ฆฌ ํด๋๋ค ใ ใ | ||
|
||
# Telemtry | ||
|
||
TODO... | ||
|
||
# WasmPlugin | ||
|
||
https://istio.io/latest/docs/reference/config/proxy_extensions/wasm-plugin/ | ||
|
||
WebAssembly ํ๋ฌ๊ทธ์ธ?์ด๋ผ๋๋ฐ, WebAssembly๋ ์์ง ๋ญ์ง๋ ์ ๋ชจ๋ฅด๊ณ ์จ๋ณธ ์ ๋ ์์ด์ WASM์ ๊ณต๋ถํ์ ใ ใ | ||
|
||
[๋์ฝ์ค์ WASM ์ค๋ช ](https://youtu.be/KjgDxBLv0bM?si=9In7rTUrV6FAE3TQ) | ||
|
||
# EnvoyFilter | ||
|
||
https://istio.io/latest/docs/reference/config/networking/envoy-filter/ | ||
|
||
Istio Pilot์ด ๋ง๋ Envoy Configuration์ ์ปค์คํ ํ ์ ์๋ ๋ฆฌ์์ค. ๋จ, ์๋ชป ๊ฑด๋๋ฆฌ๋ฉด ์ฌ์์ด ๋ฒ์ด์ง ์๋ ์์ผ๋ ์ฃผ์ํ ๊ฒ! | ||
|
||
![](https://miro.medium.com/v2/resize:fit:2000/format:webp/0*RM-Rif51UiVlZmYC) | ||
|
||
์ด๋, "filter"๋ Envoy์์ ์ ๋๋ง ์ฉ์ด๋ก Envoy๊ฐ ํธ๋ํฝ์ ์ฒ๋ฆฌํ๋ ํ๋ก์ธ์ค ์ค ํ๋๋ฅผ ์ผ์ปซ๋๋ค. Envoy ์์ filter๋ ์ฌ๋ฌ๊ฐ๊ฐ ์กด์ฌํ ์ ์์ผ๋ฉฐ ์ด๋ค์ ์์๋๋ก ์ฒ๋ฆฌ๋๋ค. ๊ทธ๋์ filter chain๋ผ๊ณ ๋ถ๋ฅธ๋ค. | ||
|
||
# ProxyConfig | ||
|
||
https://istio.io/latest/docs/reference/config/networking/proxy-config/ | ||
|
||
์๊ฑด Envoy Proxy ๊ด๋ จํด ๋ช๊ฐ์ง ์ปค์คํ ์ ํ ์ ์๋๋ฐ, ์ปค์คํ ํ๋ ๊ฒ๋ค์ด ๋จ์ํด์ ์ดํด๋ ์ฝ๋ค ใ ใ | ||
|
||
`concurrency`๋ฅผ ์กฐ์ ํด Envoy Proxy๊ฐ ๋ช๊ฐ์ thread๋ฅผ ์ฌ์ฉํ ์ ์์์ง ์ปค์คํ . ๊ธฐ๋ณธ๊ฐ์ `2`, 2๊ฐ ์ฐ๋ ๋๋ค. | ||
|
||
`environmentVariables`๋ Envoy Porxy์ ์ถ๊ฐ Env Variable๋ฅผ ์ ์ํ ์ ์๋ ํ๋. | ||
|
||
`image`๋ Envoy Proxy์ ์ด๋ฏธ์ง ํ์ ์ ๋ช ์ํ๋ ๋ถ๋ถ์. `default` ๊ฐ์์ `distroless`, `debug` ๋ฑ์ผ๋ก ๋ฐ๊ฟ ์ ์๋ค. ์ฐธ๊ณ ๋ก `distroless`๋ ๋ฆฌ๋ ์ค ๋ฐฐํฌํ(distribution, distro)์ ํฌํจ๋๋ ์ํํธ์จ์ด๊ฐ ํฌํจ๋์ง ์์ ์ด๋ฏธ์ง์. ๊ทธ๋์ ์์ ์ด-๊ฒฝ๋์!! | ||
|