Skip to content

Commit e31e00b

Browse files
committed
Update Blog “integrating-istio-and-spire”
1 parent 4f0bde4 commit e31e00b

File tree

1 file changed

+59
-17
lines changed

1 file changed

+59
-17
lines changed

content/blog/integrating-istio-and-spire.md

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,14 @@ k8s-spiffe-integ-master-7j7fh-m67q9:~ # istioctl analyze -n bookinfo
362362

363363
**5.3** Execute the following command to determine if your Kubernetes cluster is running in an environment that supports external load balancers:
364364

365-
**`kubectl get svc istio-ingressgateway -n istio-system`**
365+
```shellsession
366+
k8s-spiffe-integ-master-7j7fh-m67q9:~ kubectl get svc istio-ingressgateway -n istio-system
367+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
368+
istio-ingressgateway LoadBalancer 10.105.191.32 172.16.17.5 15021:30189/TCP,80:30392/TCP,443:30566/TCP 32d
369+
370+
```
371+
366372

367-
![](/img/ingress-gateway-svc.png)
368373

369374
If the EXTERNAL-IP value is set, your environment has an external load balancer; if not, then set the external load balancer first then follow further steps.
370375

@@ -376,23 +381,33 @@ For this cluster we are using metallb.
376381

377382
**[Kiali](https://kiali.io/)** is an observability console for Istio with service mesh configuration and validation capabilities. It helps you understand the structure and health of your service mesh by monitoring traffic.
378383

379-
**`kubectl apply -f`[`https://raw.githubusercontent.com/istio/istio/release-1.17/samples/addons/kiali.yaml`](https://raw.githubusercontent.com/istio/istio/release-1.17/samples/addons/kiali.yaml)``**
384+
```shellsession
385+
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.17/samples/addons/kiali.yaml
386+
```
380387

381388
**Install Prometheus:**
382389

383390
**[Prometheus](https://prometheus.io/)** is an open-source monitoring system and time series database. You can use Prometheus with Istio to record metrics that track the health of Istio and of applications within the service mesh.
384391

385-
**`kubectl apply -f`[`https://raw.githubusercontent.com/istio/istio/release-1.17/samples/addons/prometheus.yaml`](https://raw.githubusercontent.com/istio/istio/release-1.17/samples/addons/prometheus.yaml)``**
392+
```shellsession
393+
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.17/samples/addons/prometheus.yaml
394+
```
386395

387396
**5.5** Later after setting up ingress gateway and bookinfo gateway, we will view the dashboard, so for that you need to make these setting changes in your system proxy status.
388397

389398
Go to **Settings > Network > Proxy status >** Turn Use a **proxy server On**. In the exceptions field add your external IP address of kiali and ingressgateway service.
390399

391400
You can get IPs of these services by following command:
392401

393-
**`kubectl get svc -n istio-system`**
402+
```shellsession
403+
k8s-spiffe-integ-master-7j7fh-m67q9:~ kubectl get svc -n istio-system
404+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
405+
istio-ingressgateway LoadBalancer 10.105.191.32 172.16.17.5 15021:30189/TCP,80:30392/TCP,443:30566/TCP 32d
406+
istiod ClusterIP 10.101.27.65 <none> 15010/TCP,15012/TCP,443/TCP,15014/TCP 32d
407+
kiali LoadBalancer 10.103.14.197 172.16.17.6 20001:32116/TCP,9090:31950/TCP 32d
408+
prometheus ClusterIP 10.98.101.102 <none> 9090/TCP 32d
394409

395-
![](/img/istio-system-svcs.png)
410+
```
396411

397412
![](/img/manual_proxy.png)
398413

@@ -402,35 +417,60 @@ You can get IPs of these services by following command:
402417

403418
* Use the following command to edit the service, then edit the service type.
404419

405-
**`kubectl edit svc kiali -n istio-system`**
420+
```shellsession
421+
kubectl edit svc kiali -n istio-system
422+
```
406423

407424
Edit the service type **{spec: {type:LoadBalancer}}** as shown below
408425

409426
![](/img/service_edit.png)
410427

411428
**5.6** Set the ingress IP and ports:
412429

413-
**`export INGRESS_NAME=istio-ingressgateway`**
430+
```shellsession
431+
export INGRESS_NAME=istio-ingressgateway
414432

415-
**`export INGRESS_NS=istio-system`**
433+
export INGRESS_NS=istio-system
416434

417-
**`export INGRESS_HOST=$(kubectl -n "$INGRESS_NS" get service "$INGRESS_NAME" -o jsonpath='{.status.loadBalancer.ingress[0].ip}')`**
435+
export INGRESS_HOST=$(kubectl -n "$INGRESS_NS" get service "$INGRESS_NAME" -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
418436

419-
**`export INGRESS_PORT=$(kubectl -n "$INGRESS_NS" get service "$INGRESS_NAME" -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')`**
437+
export INGRESS_PORT=$(kubectl -n "$INGRESS_NS" get service "$INGRESS_NAME" -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
438+
```
420439

421440
**5.7** Export and Set GATEWAY_URL:
422441

423-
**`export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT`**
442+
```shellsession
443+
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
444+
```
445+
446+
```shellsession
447+
k8s-spiffe-integ-master-7j7fh-m67q9:~ echo "$GATEWAY_URL"
448+
172.16.17.5:80
449+
450+
```
424451

425-
**`echo "$GATEWAY_URL"`**
426452

427-
![](/img/gateway_url.png)
428453

429454
Curl into productpage using gateway URL using following command.
430455

431-
**`curl -v http://$GATEWAY_URL/productpage`**
456+
```shellsession
457+
k8s-spiffe-integ-master-7j7fh-m67q9:~ curl -v http://$GATEWAY_URL/productpage
458+
* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,10.96.0.1,172.16.5.41,172.16.5.42,172.16.5.43,172.16.5.44,172.16.5.45,172.16.5.46,172.16.5.40,glhc-caas.glhc-hpe.local,.glhc-hpe.local,glhc-caas.customer.hpe.net,172.16.17.20,172.16.17.21,172.16.17.22,172.16.5.47,gl-pulpnode.glhc-hpe.local,gl-pulpnode,10.96.0.1,10.192.0.0/12,10.96.0.0/12,.svc,.cluster.local,.default.svc,.customer.hpe.net,172.16.17.23,172.16.17.30,gl-cp-gw-node2.glhc-hpe.local,gl-cp-gw-node1.glhc-hpe.local,172.16.17.50'
459+
* Uses proxy env variable http_proxy == 'http://172.16.0.250:8080'
460+
* Trying 172.16.0.250:8080...
461+
* TCP_NODELAY set
462+
* Connected to 172.16.0.250 (172.16.0.250) port 8080 (#0)
463+
> GET http://172.16.17.5:80/productpage HTTP/1.1
464+
> Host: 172.16.17.5
465+
> User-Agent: curl/7.66.0
466+
> Accept: */*
467+
> Proxy-Connection: Keep-Alive
468+
>
469+
470+
471+
```
472+
432473

433-
![](/img/prfuct_page.png)
434474

435475
You can generate traffic on product page by just reaching out to shown http URL.
436476

@@ -441,7 +481,9 @@ You can generate traffic on product page by just reaching out to shown http URL.
441481
Generate traffic on product page and observe the graphs on Kiali dashboard.
442482
Reach out to kiali dashboard in your browser by just copying external IP from above and http into that IP and port.
443483

444-
**`http://<kiali_external_ip>:<port>`**
484+
```shellsession
485+
http://<kiali_external_ip>:<port>
486+
```
445487

446488
After reaching kiali dashboard, generate traffic on product page and simultaneously, view and analyse traffic on kiali using various graphs and visualising methods.
447489

0 commit comments

Comments
 (0)