02 Services & Networking
Goal
Expose the Patient Triage app to the internet using Kubernetes Services and an Ingress controller with path-based routing.
Estimated time
15 minutes.
Official references
Key concepts
| Concept | Purpose |
|---|---|
| ClusterIP | Default Service type. Accessible only inside the cluster. |
| LoadBalancer | Provisions an Azure Load Balancer with a public IP. |
| Ingress | Layer-7 routing (host/path based) via a reverse proxy. |
| Ingress Controller | The actual NGINX (or other) pod that fulfils Ingress rules. |
Exercise
Step 1 — Enable the app-routing add-on
AKS provides a managed NGINX Ingress controller through the app-routing add-on:
Verify the Ingress controller pods are running:
Step 2 — Understand the existing Services
In lesson 01 we created two ClusterIP Services. Review them:
Both are ClusterIP — accessible inside the cluster only.
Step 3 — Apply the Ingress resource
The Ingress routes external traffic to the correct backend:
/api/*→triage-backend:80/*→triage-frontend:80
Step 4 — Get the external IP
Wait for the Ingress to be assigned an external address:
Once the ADDRESS column shows an IP, press Ctrl+C and open it in a browser:
export INGRESS_IP=$(kubectl get ingress triage-ingress -n triage -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "Open http://$INGRESS_IP in your browser"
Step 5 — Test the routes
# Frontend — should return HTML
curl -s http://$INGRESS_IP/ | head -5
# Backend API — should return JSON
curl -s http://$INGRESS_IP/api/health
Step 6 — Test the triage flow
Open http://<INGRESS_IP> in your browser. Submit a patient with symptoms and
confirm you see a triage result with an urgency classification.
What this lab demonstrates
- The difference between ClusterIP, LoadBalancer, and Ingress.
- Enabling the managed AKS app-routing NGINX Ingress controller.
- Path-based routing with a single external IP.
- End-to-end connectivity from browser → Ingress → Service → Pod.
Expected result
A single public IP that routes /api/* to the backend and everything else to
the frontend. The Patient Triage UI loads in the browser and can submit patients.
Verification
- [ ]
kubectl get ingress -n triageshows an external IP. - [ ]
curl http://$INGRESS_IP/api/healthreturns{"status": "healthy"}. - [ ] Opening the IP in a browser shows the Patient Triage UI.
- [ ] Submitting a patient returns an urgency classification.