(Optional) Exercise 3: Authorization with Istio
Review the existing deployment
STEP 1: Get the full name of the articles pod from the resulting list:
kubectl get podsNAME READY STATUS RESTARTS AGE
articles-xxxxxxxxxx-yyyyy 2/2 Running 0 3d23h
keycloak-77cffb978-nbmjj 2/2 Running 0 3d23h
web-api-5c9698b875-c8vrt 2/2 Running 0 3d23h
web-app-79499c4b99-dv2hs 2/2 Running 0 3d23hSTEP 2: Now display the details for the pod in YAML format and search for the term serviceAccount:
serviceAccount:Modify deployments to use service accounts
Step 1: First we create 2 service accounts (sa) for our 2 services

Step 2: Then we replace the deployment descriptions to use the service accounts we just created:
Step 3: This will recreate the articles and web-api pods. Check with:
Authorization Policy
Step 1: Verify the authorization policy
Step 2: Apply with rule
Step 3: Check the application in the browser again. It may take a while for the policy to propagate to the Envoy but eventually you will see this error in the browser:

Step 4: Verify AuthorizationPolicy
AuthorizationPolicyStep 5: Apply rule
Step 5: Verify the access

Optional: Setup telemetry to inspect dependencies of the Microservices in Kiali
PreviousExercise 2: Secure microservices using Authentication with mTLSNext(Optional) Exercise 1: Setup the web-application and Microservices locally
Last updated
Was this helpful?

