https://istio.io/latest/about/service-mesh/
๊ฐ๊ฐ ์ปจํ ์ด๋์ ํธ๋ํฝ์ ๊ด์ฐฐํ ์ ์๋๋ก ํ๋ก์๋ฅผ ๊ตฌ์ฑํ๋ ์ ํ๋ฆฌ์ผ์ด์
https://istio.io/latest/docs/setup/getting-started/#download
curl -L https://istio.io/downloadIstio | sh -
cd istio-1.19.3
export PATH=$PWD/bin:$PATH
istioctl
: istio๋ kubectl ์ ๋ด๋ถ์ ์ผ๋ก ์ฌ์ฉํจ
https://istio.io/latest/docs/setup/getting-started/#install
istioctl install --set profile=demo -y
kubectl label namespace default istio-injection=enabled
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl get services
kubectl get pods
kubectl exec "$(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"
istioctl install ์ํ๊ณ ์ฑ ๋ํ๋ก์ด ์ ์๋ฌ ๋ฐ์
Warning FailedCreate 2s (x13 over 23s) replicaset-controller Error creating: Internal error occurred: failed calling webhook "namespace.sidecar-injector.istio.io": failed to call webhook: Post "https://istiod.istio-system.svc:443/inject?timeout=10s": service "istiod" not found
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
istioctl analyze
๊ฒ์ดํธ์จ์ด ์์ฑ ์ 3. ์ฑ ๋ํ๋ก์ด ์์ฑ๋์ด์ผํจ
$ kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml Error from server (InternalError): error when creating "samples/bookinfo/networking/bookinfo-gateway.yaml": Internal error occurred: failed calling webhook "validation.istio.io": failed to call webhook: Post "https://istiod.istio-system.svc:443/validate?timeout=10s": service "istiod" not found
https://istio.io/latest/docs/setup/getting-started/#determining-the-ingress-ip-and-ports
kubectl get svc istio-ingressgateway -n istio-system
๋ฅผ ํตํด External Ip๋ฅผ ํ ๋น๋ ๊ฑธ ๋ณด๊ณ ๋ก๋๋ฐธ๋ฐ์ฑ์ด ์๋ํ๋์ง ํ์ธ.export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')
ํน์ ํ๊ฒฝ์์ Ingress๊ฐ External IP๊ฐ ์๋ hostname์ ํตํด์ expose ๋๋ค๋ฉด,
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
๋ฅผ ํตํด์ INGRESS_HOST๋ณ์๋ฅผ ์ค์ ํ ๊ฒ.
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')
export INGRESS_HOST=worker-node-address
GKE ํ๊ฒฝ์์ ๋ฐฉํ๋ฒฝ ์ ๊ฑฐ ํ ๊ฒ
gcloud compute firewall-rules create allow-gateway-http --allow "tcp:$INGRESS_PORT"
gcloud compute firewall-rules create allow-gateway-https --allow "tcp:$SECURE_INGRESS_PORT"
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
echo "$GATEWAY_URL"
echo "http://$GATEWAY_URL/productpage"
: ๊ฒฐ๊ณผ๋ฅผ ์น ๋ธ๋ผ์ฐ์ ์ ๋ถ์ฌ๋ฃ๊ธฐ ํด์ ํ์ด์ง๊ฐ ๋จ๋์ง ํ์ธ
kubectl apply -f samples/addons
kubectl rollout status deployment/kiali -n istio-system
istioctl dashboard kiali
To see trace data, you must send requests to your service. The number of requests depends on Istioโs sampling rate and can be configured using the Telemetry API. With the default sampling rate of 1%, you need to send at least 100 requests before the first trace is visible. To send a 100 requests to the productpage service, use the following command:
$ for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done