Skip to main content
In this lesson, we will learn how to manage application logs to diagnose issues in real-time. By reviewing logs from deployed pods, you can quickly identify errors based on user reports, leading to more efficient troubleshooting and improved application stability.

Inspecting Application Logs for Login Issues

We begin with a scenario where a pod hosting an application has been deployed. To ensure the pod is running, use the following command:
The output should resemble:
A user (user five) reported difficulties while attempting to log in. By examining the logs, we discovered that the issue is due to a locked account caused by too many failed login attempts. The log entry confirms:
The output clearly indicates that subsequent failed login attempts have resulted in the account being locked. This information is crucial for troubleshooting user authentication issues.

Diagnosing an Order Failure Issue in a Multi-Container Pod

In this scenario, a new application deployment involves two pods, with one pod (webapp-2) hosting two containers. Start by verifying the status of the pods:
Expected output:
Attempting to view the logs for pod webapp-2 without specifying a container will result in an error:
Output:
Since our focus is on the web application’s logs, specify the container “simple_webapp” to examine the relevant log entries. A user reported an issue while purchasing an item. Investigation of the log entries (focusing on warnings) reveals that, despite several warnings, the critical error associated with the order failure is related to an out-of-stock item. Review the following log sample:
Notice that despite numerous warnings about login issues, the critical error that directly impacts the order process is:
This error indicates that the order failure was not due to authentication issues, but rather an inventory shortage.

Summary

This lesson has demonstrated two key troubleshooting scenarios:
  1. Login Issues: By closely analyzing the logs, we confirmed that a locked account (due to multiple failed login attempts) was the root cause of the user access issue.
  2. Order Failures in a Multi-Container Environment: We learned to navigate the error generated by not specifying a container and identified that the order failure resulted from an out-of-stock item.
For more detailed instructions on Kubernetes and container management, visit the following resources: By following these procedures, you can efficiently diagnose and resolve issues in your application infrastructure, ensuring smoother operations and enhanced user experience.

Watch Video