0
0
Kubernetesdevops~10 mins

Observability with service mesh in Kubernetes - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Observability with service mesh
Service Mesh Installed
Sidecar Proxy Injected
Traffic Routed Through Proxy
Telemetry Data Collected
Data Sent to Observability Tools
Metrics, Logs, Traces Visualized
Issues Detected and Debugged
This flow shows how a service mesh adds proxies to services, collects telemetry data, and sends it to tools for monitoring and debugging.
Execution Sample
Kubernetes
kubectl apply -f istio.yaml
kubectl get pods --namespace istio-system
kubectl label namespace default istio-injection=enabled
kubectl apply -f sample-app.yaml
kubectl get svc
kubectl logs -l app=sample-app -c istio-proxy
These commands install a service mesh, enable sidecar injection, deploy an app, and show proxy logs for observability.
Process Table
StepCommandActionResult/Output
1kubectl apply -f istio.yamlInstall Istio service mesh componentsistio-system namespace created, pods starting
2kubectl get pods --namespace istio-systemCheck Istio pods statusPods: istiod, ingressgateway running
3kubectl label namespace default istio-injection=enabledEnable automatic sidecar injectionNamespace 'default' labeled
4kubectl apply -f sample-app.yamlDeploy sample app with sidecar proxiesPods created with istio-proxy containers
5kubectl get svcList services including mesh-enabled onesServices: sample-app listed
6kubectl logs -l app=sample-app -c istio-proxyView proxy logs for telemetry dataLogs show traffic routing and telemetry events
7ExitAll components running and telemetry collectedObservability data ready for analysis
💡 All pods are running with sidecar proxies; telemetry data is collected and visible in logs.
Status Tracker
VariableStartAfter Step 1After Step 3After Step 4Final
istio-system pods0StartingRunningRunningRunning
default namespace labelnonenoneistio-injection=enabledistio-injection=enabledistio-injection=enabled
sample-app pods000Created with sidecarRunning with sidecar
telemetry logsemptyemptyemptypopulatedpopulated
Key Moments - 3 Insights
Why do we label the namespace with 'istio-injection=enabled'?
Labeling the namespace triggers automatic injection of sidecar proxies into pods created in that namespace, as shown in execution_table step 3 and 4.
What is the role of the 'istio-proxy' container in the sample app pods?
The 'istio-proxy' container acts as a sidecar proxy that intercepts traffic and collects telemetry data, visible in logs at step 6.
How do we know telemetry data is being collected?
Telemetry data appears in the logs of the istio-proxy container, as shown in execution_table step 6.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step is the sidecar proxy injected into the sample app pods?
AStep 2
BStep 3
CStep 4
DStep 1
💡 Hint
Check the action and result columns for pod creation with sidecar proxies in step 4.
According to the variable tracker, what is the state of telemetry logs after step 4?
Apopulated
Bempty
Cstarting
Dunknown
💡 Hint
Look at the 'telemetry logs' row under 'After Step 4' column.
If the namespace label 'istio-injection=enabled' was missing, what would change in the execution table?
AIstio pods would not start in step 1
BSidecar proxies would not be injected in step 4
CSample app pods would fail to create in step 4
DTelemetry logs would be populated earlier
💡 Hint
Refer to step 3 and 4 where labeling triggers sidecar injection.
Concept Snapshot
Observability with Service Mesh:
- Install service mesh (e.g., Istio) in cluster
- Label namespaces to enable sidecar proxy injection
- Deploy apps; proxies collect telemetry
- Use logs, metrics, traces for monitoring
- Helps detect and debug service issues easily
Full Transcript
Observability with a service mesh means adding a layer that automatically inserts small proxy containers next to your app containers. These proxies watch all the network traffic going in and out. First, you install the service mesh components in your Kubernetes cluster. Then, you label the namespace where your apps run to enable automatic sidecar proxy injection. When you deploy your app, each pod gets a proxy container. This proxy collects telemetry data like logs, metrics, and traces. You can view this data by checking the proxy logs or using observability tools. This setup helps you see how your services communicate and quickly find problems.