This design implements Istio (Service Mesh) on AKS to manage microservices traffic.
Topology: Runs inside the AKS Cluster (Design 33) in the Spoke VNet.
+--------------+ +--------------------------+
| Ingress | | AKS CLUSTER |
| Gateway |---------->| (Mesh) |
+------+-------+ | |
| | +-------+ +-------+ |
| | | Pod A |<-->| Pod B | |
| | | Proxy | | Proxy | |
| | +-------+ +-------+ |
| | ^ ^ |
| | | (mTLS) | |
| +-------|----------|-------+
| | |
v v v
+--------------+ +--------------------------+
| Cert Manager| | Istio Control |
| (Rotation) | | Plane (Istiod) |
+--------------+ +--------------------------+
+-----------------------------------------------------------------------+
| SPOKE VNet: vnet-aks-spoke |
| +---------------------------------------------------------------+ |
| | Namespace: default | |
| | [Pod: Frontend] | |
| | |-- [Container: App] | |
| | +-- [Container: Envoy Sidecar] <--- Intercepts Traffic | |
| | | |
| | [Pod: Backend] | |
| | |-- [Container: App] | |
| | +-- [Container: Envoy Sidecar] | |
| +---------------------------------------------------------------+ |
+-----------------------------------------------------------------------+
1. Call: Frontend calls http://backend.
2. Intercept: Local Envoy proxy catches request.
3. Route: Envoy checks route table. Finds Backend endpoint.
4. Encrypt: Encrypts with mTLS cert.
5. Send: Sends to Backend Envoy.
6. Decrypt: Backend Envoy decrypts.
7. Deliver: Delivers to Backend App on localhost.
1. Go to your AKS Cluster (aks-prod).
2. Settings -> Service Mesh (Left Menu).
3. Select: Istio.
4. Enable: Check the box.
5. Ingress Gateway: External (Creates a Load Balancer) or Internal. Select External for this lab.
6. Save.
* *Wait 5-10 minutes for the add-on to install.*
1. Click Connect to open Cloud Shell (or use local terminal).
2. Create a namespace (or use default):
* kubectl create ns bookinfo
3. Label it:
* kubectl label namespace bookinfo istio-injection=enabled
* *This tells Istio to automatically inject the Envoy sidecar into any new pod in this namespace.*
1. Download the Istio Bookinfo YAMLs (standard demo).
2. Apply them:
* kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfo
3. Verify Pods:
* kubectl get pods -n bookinfo
* Crucial: Look at the READY column. It should say 2/2 (1 App Container + 1 Envoy Sidecar).
1. Check the authentication policy:
* kubectl get peerauthentication -n bookinfo (Might be empty if default is Permissive).
2. Enforce Strict mTLS:
* Create a file strict-mtls.yaml:
```yaml
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
namespace: bookinfo
spec:
mtls:
mode: STRICT
```
* kubectl apply -f strict-mtls.yaml
3. Now, any traffic NOT using mTLS (e.g., from outside the mesh) will be rejected.
1. If you enabled the monitoring add-ons, you can port-forward Kiali or Grafana to see the traffic map.