Hello and welcome to this lecture.
Throughout this course we have actually worked on a number of troubleshooting exercises with respect
to the topic we were going through at that point in time.
So a lot of troubleshooting is already covered.
We will go through an overview of troubleshooting techniques and procedures and work on some more practice
tests in this section.
We start with application failures.
Let's take a look at a two tier application that has a web and a database server.
The database pod hosting a database and serving the web servers through a database service.
The web server is hosted on a Web pod and serves users through the web service.
It's good to write down or draw a map or chart of how your application is configured
before you start. Depending on how much you know about the failure you may choose to start from either
end of this map.
But remember to check every object and link in this map until you find the root cause of the issue. Say
in our case,
users report some issue with accessing the application. First.
we start with the application front-end. Use standard ways of testing
if your application is accessible. If it’s a web application, check if the web server is accessible on
the IP of the node-port using curl. Next, check
the service. Has it discovered endpoints for the web pod?
In this case it did.
But if it did not then you might want to check the service to pod discovery. Compare the selectors configured
on the service to the ones on the pod.
Make sure they match. Next,
Check the pod itself and make sure it is in a running state.
The status of the pod as well as the number of restarts can give you an idea of whether the application
on the pod is running or is getting restarted.
Check the events related to the pod using the described command.
Check the logs of the application using the logs command. If the pod is restarting due to a failure
Then the logs in the current version of the pod that that's running the current version of the container
may not reflect why it failed the last time.
So you either have to watch these logs using the –f option and wait for the application to fail
again or use the previous option to view the logs of a previous pod.
Next check the status of the db-service as before. And finally check the DB pod itself.
Check the logs of the D.B. pod and look for any errors in the database.
There are some more tips documented in the Kubernetes documentation page for Troubleshooting applications.
This will help in upcoming practice test as well as in the exam.