2
1

はじめに

Sock Shopのサービス間の応答時間を取得するためにIstioをインストールしました.
↓前回↓

Istioのインストール

公式を参考にインストールしていきました.
https://istio.io/latest/docs/setup/getting-started/

最新のIstioをダウンロード

curl -L https://istio.io/downloadIstio | sh -
cd istio-x.xx.x
export PATH=$PWD/bin:$PATH

Istioをインストール
ここでistioctlが使えない場合はパスの指定が上手くいっていない可能性があります.

istioctl install --set profile=demo -y
kubectl label namespace default istio-injection=enabled
touch ~/.kuberc
echo source ~/.kuberc >> ~/.bashrc

イングレスとポートの設定

echo export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}') >>~/.kuberc
echo export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}') >>~/.kuberc
echo export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}') >>~/.kuberc
echo export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT >>~/.kuberc
source ~/.bashrc

以上でIstioの設定は完了です.

アドオンのapply

Istioのアドオンはprometheusから値を取得しているようなのでprometheusのapplyを忘れずに

kubectl apply -f samples/addons/prometheus.yaml
kubectl apply -f samples/addons/jaeger.yaml

Sock Shopのインストール

続いてSock Shopをインストールしていきます.
Sock Shopにlabel付するためにcomplete-demo.yamlに追記をします.

complete-demo.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: sock-shop
  labels:
    istio-injection: enabled

apply

kubectl apply -f microservices-demo/deploy/kubernetes/complete-demo.yaml

以上で導入ができました.

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1