본문 바로가기

CKA &. CKAD/Troubleshooting

Application Failure

Check Accessibility

 

 

Remeber to check every object and link in this map until you find the root cause of the issue.

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.

curl http://web-service-ip:node-port

 

[Next . the service.]

 

Has it discovered endpoints for the web pod?

kubectl describe service web-service

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]

 

Make sure it is in a running state.

kubectl get pod

The status of the pod as well as the number of restart can give you an idea of wheter the application on the pod is running or is getting restarted.

Check the events releated to the pod using the described command.

kubectl describe pod web

Check the logs of the application using the logs command.

kubectl logs web

 If the pod is restarting due to a failure then the logs in the current version of the pod. 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.

kubectl logs web -f --previous

[Check Dependent Service (like DB)]

 

Next check the status of the db-service as before.

 

And finally check the DB pod itself. check the logs of the DB pod and look for any errors in the database.

 

There are some more tips documented in the kubernetes documentation page for troubleshooting applications.

 

https://kubernetes.io/docs/tasks/debug-application-cluster/debug-application/ 

 

Troubleshoot Applications

This guide is to help users debug applications that are deployed into Kubernetes and not behaving correctly. This is not a guide for people who want to debug their cluster. For that you should check out this guide. Diagnosing the problem The first step in

kubernetes.io

 

'CKA &. CKAD > Troubleshooting' 카테고리의 다른 글

kubelet 주요 이슈 확인  (0) 2021.04.08
Network Troubleshooting  (0) 2021.04.02
Practice Test - Node Failure (kubelet)  (0) 2021.04.01
Worker Node Failure  (0) 2021.04.01
Control Plane Failure  (0) 2021.04.01