Skip to content

Commit 4f0bde4

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

File tree

1 file changed

+61
-10
lines changed

1 file changed

+61
-10
lines changed

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

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -265,33 +265,77 @@ You can get the sample bookinfo application manifest from **[this link](https://
265265

266266
After editing the manifest, apply it in a newly created namespace.
267267

268-
**`kubectl apply -f bookinfo.yaml -n <namespace_name>`**
268+
```shellsession
269+
kubectl apply -f bookinfo.yaml -n <namespace_name>
270+
```
269271

270272
Verify all workloads and services you just deployed are running and up.
271273

272-
**`kubectl get all -n <namespace_name>`**
274+
```shellsession
275+
kubectl get all -n <namespace_name>
276+
```
273277

274278
You will get output as shown below if everything is working fine.
275279

276-
![](/img/bookinfo-all-pods.png)
280+
```shellsession
281+
k8s-spiffe-integ-master-7j7fh-m67q9:~ kubectl get all -n bookinfo
282+
NAME READY STATUS RESTARTS AGE
283+
pod/details-v1-f8957ccb4-7vdgw 2/2 Running 0 37d
284+
pod/productpage-v1-cfb4bc854-5km2l 2/2 Running 0 37d
285+
pod/ratings-v1-65cd6fbcd8-s9jnc 2/2 Running 0 37d
286+
pod/reviews-v1-55f769fb78-czh7j 2/2 Running 0 37d
287+
pod/reviews-v2-6b7c798cc8-wkpxg 2/2 Running 0 37d
288+
pod/reviews-v3-695c7f59db-nzwwk 2/2 Running 2 (34d ago) 37d
289+
290+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
291+
service/details ClusterIP 10.111.38.161 <none> 9080/TCP 37d
292+
service/productpage ClusterIP 10.102.189.161 <none> 9080/TCP 37d
293+
service/ratings ClusterIP 10.105.7.153 <none> 9080/TCP 37d
294+
service/reviews ClusterIP 10.106.49.246 <none> 9080/TCP 37d
295+
296+
NAME READY UP-TO-DATE AVAILABLE AGE
297+
deployment.apps/details-v1 1/1 1 1 37d
298+
deployment.apps/productpage-v1 1/1 1 1 37d
299+
deployment.apps/ratings-v1 1/1 1 1 37d
300+
deployment.apps/reviews-v1 1/1 1 1 37d
301+
deployment.apps/reviews-v2 1/1 1 1 37d
302+
deployment.apps/reviews-v3 1/1 1 1 37d
303+
304+
NAME DESIRED CURRENT READY AGE
305+
replicaset.apps/details-v1-f8957ccb4 1 1 1 37d
306+
replicaset.apps/productpage-v1-cfb4bc854 1 1 1 37d
307+
replicaset.apps/ratings-v1-65cd6fbcd8 1 1 1 37d
308+
replicaset.apps/reviews-v1-55f769fb78 1 1 1 37d
309+
replicaset.apps/reviews-v2-6b7c798cc8 1 1 1 37d
310+
replicaset.apps/reviews-v3-695c7f59db 1 1 1 37d
311+
312+
```
277313

278314
Once everything is up, all workloads would get registered under SPIRE server.
279315

280316
**4.6** You can verify the registration of workloads using the following command:
281317

282-
**`kubectl exec <spire-server_pod_name> -n spire -c spire-server -- ./bin/spire-server entry show`**
318+
```shellsession
319+
kubectl exec <spire-server_pod_name> -n spire -c spire-server -- ./bin/spire-server entry show
320+
```
283321

284322
Verify that every workload with same label as clusterSPIFFEID CRD’s match label is registered in the server.
285323

286324
![](/img/server-entries.png)
287325

288326
**4.7** Verify that the certificate issuer of workloads is SPIRE using following commands for each workload.
289327

290-
**`istioctl proxy-config secret <pod_name> -n <namespace_name> -o json | jq -r '.dynamicActiveSecrets[0].secret.tlsCertificate.certificateChain.inlineBytes' | base64 --decode > chain.pem`**
328+
```shellsession
329+
istioctl proxy-config secret <pod_name> -n <namespace_name> -o json | jq -r '.dynamicActiveSecrets[0].secret.tlsCertificate.certificateChain.inlineBytes' | base64 --decode > chain.pem
330+
```
331+
332+
```shellsession
333+
k8s-spiffe-integ-master-7j7fh-m67q9:~ openssl x509 -in chain.pem -text | grep SPIRE
334+
Subject: C = US, O = SPIRE, x500UniqueIdentifier = e2f9c35b9198e1824373e874b13287d0
335+
336+
```
291337

292-
**`openssl x509 -in chain.pem -text | grep SPIRE`**
293338

294-
![](/img/spire-verify.png)
295339

296340
You should also check the same for ingress-gateway pod in Istio-system namespace and verify that your deployed workloads and ingress-gateway has the same issuer.
297341

@@ -301,13 +345,20 @@ The Bookinfo application is deployed but not accessible from the outside. To mak
301345

302346
**5.1** Associate this application with the Istio gateway:
303347

304-
**`kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml -n bookinfo`**
348+
```shellsession
349+
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml -n bookinfo
350+
```
305351

306352
**5.2** Ensure that there are no issues with the configuration:
307353

308-
**`istioctl analyze -n bookinfo`**
354+
```
355+
k8s-spiffe-integ-master-7j7fh-m67q9:~ # istioctl analyze -n bookinfo
356+
357+
✔ No validation issues found when analyzing namespace: bookinfo.
358+
359+
```
360+
309361

310-
![](/img/bookinfo-analyze.png)
311362

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

0 commit comments

Comments
 (0)