how to trace restart of MySQL container?

7/1/2019

I have mysql running in k8s with one replicaset, it keeps crashing at random times with exit code 137. Memory consumption is 82% while crashing.

I couldn't find anything in syslog, mysql error log and kubelet log other than restart message.

Instance is already having 64gb and once after the restart it is able to handle the application requests. So increasing memory should not be an actual solution.

Also monitoring tools says only 82% of the memory is being used at the time of crash.

  1. How kubernetes calculates the memory consumption of a pod?
  2. How to find why it is crashing?
-- karthikeayan
kubernetes
mysql

1 Answer

7/1/2019

You can use kubectl logs your-pod -c container-name -n your-namespaces to see your log, use kubectl describe pod your-pod -n your-namespaces to see pod events.

-- Ray
Source: StackOverflow