

At a high level, the Istio agent acts as an intermediate proxy between Istiod and Envoy. This is done at two levels. For distributing workload certificates, Envoy will send SDS requests to the agent, causing the agent to submit a CSR to the configured CA (generally Istiod). For other configuration, Envoy will send ADS requests to the agent, which will be forwarded to the configured discovery server (general Istiod).
Envoy는 API를 통한 설정이 가능하다.
istio 사용할 때는 실제 설정을 istio Control Plane에서 받아와 사용한다.
즉 Listener, Route, Cluster, Endpoint 등을 동적으로 로드할 수 있다.
이를 위한 API를 Discovery Servicd API 라고 하는데
이 집합들을 xDS 라고 부른다.
그래서.. Service Mesh를 다시 분류하면 이렇게 된다.
즉 Control Plane은 envoy에서 필요한 xDS API를 적절히 제공하는 역할이다.
(gRPC가 REST보다 더 일반적이라고 한다.)
configMap으로 마운트하는게 아니다. (저장되는 위치는 /var/lib/istio/data/###.wasm)
2022-08-07T13:36:25.950592Z info ads Push debounce stable[96] 1 for config WasmPlugin/default/sample-rate-limiting: 100.323515ms since last change, 100.323194ms since last push, full=true
2022-08-07T13:36:25.950766Z info ads XDS: Pushing:2022-08-07T13:36:25Z/61 Services:21 ConnectedEndpoints:4 Version:2022-08-07T13:36:25Z/61
2022-08-07T13:36:25.951050Z info ads LDS: PUSH for node:istio-egressgateway-7767fbfc44-qkrsp.istio-system resources:0 size:0B
2022-08-07T13:36:25.951212Z info ads LDS: PUSH for node:istio-ingressgateway-76df49f94d-gbvjk.istio-system resources:1 size:3.5kB
2022-08-07T13:36:25.952871Z info ads LDS: PUSH for node:sample2-web-pod-69975749b4-r6bjn.default resources:31 size:139.3kB
2022-08-07T13:36:25.952871Z info ads LDS: PUSH for node:sample-web-pod-6f6fd4656b-qx7mx.default resources:31 size:139.3kB
2022-08-07T13:36:25.953033Z info ads ECDS: PUSH for node:sample2-web-pod-69975749b4-r6bjn.default resources:1 size:220B
2022-08-07T13:36:25.953100Z info ads ECDS: PUSH for node:sample-web-pod-6f6fd4656b-qx7mx.default resources:1 size:220B
다만 에러도 있다.재현 순서는
캐싱이 원인인 듯 하다.
warn
ads
ADS:ECDS:
ACK ERROR sample2-web-pod-69975749b4-bnf6r.default-15
Internal:Invalid path:
/var/lib/istio/data/2cf37b4603a3d87c7771cd0a33f01bbe9ae07ed0e86dc30fe7e8e7b982dd725f.wasm
나랑 비슷한걸 궁금해 한 사람이 있다.
wasmPlugin은 적용됐는데 envoy 설정 파일에서 찾아볼 수 없다?
It requests it over XDS from the istio-agent component which pulls from the registry
Envoy has the name, it requests the name over XDS. The istio-agent knows
the mapping of name->hash (since it creates the hash)