Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Monitor and troubleshoot solutions on AKS and Container Apps by inspecting logs, events, and end-to-end connectivity

A worked example

Single answer

You roll out a new version of the api-deployment Deployment in the aks-troubleshoot namespace of an Azure Kubernetes Service (AKS) cluster. The Deployment uses a rolling update strategy, and the api-service Service fronts its pods. Requests to api-service still succeed. The exhibit shows the current pod status.

You need to find out why the new pod never becomes ready. The command output must contain only probe failure events, without scheduling or image pull events.

$ kubectl get pods -n aks-troubleshoot
NAME                              READY   STATUS    RESTARTS   AGE
api-deployment-5f8d7c9b6d-k2xvq   1/1     Running   0          2h
api-deployment-7c4b9f8d5-p8mzt    0/1     Running   0          6m

Which command should you run?

Choose one answer
Why

During the rolling update, the old ready pod continues serving requests while the new pod remains unready. Probe failure events use the reason Unhealthy. Applying that reason filter in the workload's namespace excludes scheduling and image pull events, allowing you to inspect probe failure messages for the new pod. The other commands either omit the required filter or provide metrics, endpoint information, or application access instead of probe failure events.

  • Correct: kubectl get events -n aks-troubleshoot --field-selector reason=Unhealthy. Filtering on reason=Unhealthy selects probe failure events, including readiness and liveness failures, while excluding scheduling and image pull events. Inspect the messages associated with the new pod to investigate its readiness failure.
  • Not correct: kubectl top pods -n aks-troubleshoot. kubectl top pods shows per-pod CPU and memory usage. It returns no events at all, so it cannot show probe failures.
  • Not correct: kubectl port-forward service/api-service 8080:80 -n aks-troubleshoot. Port-forwarding provides local access for testing application endpoints. It does not retrieve probe failure events or explain why the new pod remains unready.
  • Not correct: kubectl get events -n aks-troubleshoot. Without a field selector, the command returns recent events of every kind in the namespace. This includes scheduling and image pull events, so the output-only-probe-failures requirement is not met.
  • Not correct: kubectl get endpointslices -l kubernetes.io/service-name=api-service -n aks-troubleshoot. EndpointSlices describe the Service's backing pod addresses. This command does not retrieve the probe failure event messages needed to diagnose the new pod.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free