Which statement best describes the main difference between a service mesh and a library-based approach for managing microservice communication?
Think about where the communication logic lives: inside the app or outside it.
A service mesh runs as a separate layer (usually sidecar proxies) managing communication without changing app code. A library-based approach requires adding code to each service to handle communication.
You want to add observability and traffic control to your microservices without changing their code. Which approach is best?
Consider which approach allows adding features without touching service code.
Service meshes add features like observability and traffic control externally, so services do not need code changes. Library-based approaches require modifying each service.
What is the expected output of the following command in a Kubernetes cluster using Istio service mesh?
kubectl get pods -n default -l app=myservice -o jsonpath='{.items[0].spec.containers[*].name}'Assuming Istio sidecar injection is enabled.
Think about what containers run in a pod with Istio sidecar injection.
When Istio sidecar injection is enabled, each pod has the original service container plus an 'istio-proxy' sidecar container. The command lists both container names.
You deployed a library-based communication approach in your microservices. Suddenly, services cannot communicate. Which is the most likely cause?
Focus on what is unique to library-based approaches compared to service mesh.
Library-based approaches depend on the communication library inside the service. If the library version is incompatible, communication fails. Sidecar crashes or network policies are more common in service mesh or network issues.
Arrange the steps in the correct order to enable a service mesh (e.g., Istio) on existing Kubernetes services.
Think about installing first, then enabling injection, then redeploying.
First, install the control plane. Then enable sidecar injection in the namespace. Next, redeploy services to get sidecars injected. Finally, verify pods have both containers.