Skip to main contentIBM Garage Cloud Native Bootcamp

Kubernetes Troubleshooting

Debugging Applications

Kubernetes provides tools to help troubleshoot and debug problems with applications.

Usually is getting familiar with how primitives objects interact with each other, checking the status of objects, and finally checking logs for any last resource clues.

Resources

OpenShift

IKS

References

Broken setup to debug

MacOS/Linux/Windows command:

oc apply -f https://gist.githubusercontent.com/csantanapr/e823b1bfab24186a26ae4f9ec1ff6091/raw/1e2a0cca964c7b54ce3df2fc3fbf33a232511877/debugk8s-bad.yaml

Expose the service using port-forward

oc port-forward service/my-service 8080:80 -n debug

Try to access the service

curl http://localhost:8080

Try Out these Commands to Debug

oc get pods --all-namespaces
oc project debug
oc get deployments
oc describe pod
oc explain Pod.spec.containers.resources.requests
oc explain Pod.spec.containers.livenessProbe
oc edit deployment
oc logs
oc get service
oc get ep
oc describe service
oc get pods --show-labels
oc get deployment --show-labels

Solution

Activities

The continuous integration activities focus around Tekton the integration platform. These labs will show you how to build pipelines and test your code before deployment.

TaskDescriptionLink
Try It Yourself
DebuggingFind which service is breaking in your cluster and find out why.Debugging