relation between kubernetes and cron

2/12/2019

I am operating kubernetes. There are many terminating pods. And So many crond daemons are in place in VM. both /var/log/messages and /var/log/crond are empty.

I don't know why crond daemon is occurred so many?

500 Crond daemons are excecuting.

ps -ef | grep crond | wc -l

648

and load average is 16

I want to know relations between crond and pod terminating on kubernetes.

How Could I dertermine ? I checked /etc/rsyslog.conf - it's normal.

-- canerbis
cron
kubernetes
linux

1 Answer

2/12/2019

By default cron emails the program output to the user who owns a particular crontab, therefore you can check whether any of the emails have been delivered within default path /var/spool/mail.

When you have a long-running or continuous script that could never be finished in cron, it can produce a multiple cron processes appearing in the process list, therefore it might be useful to get a list with a tree view on `crontab specific parent/child processes:

pstree -ap| grep crond

I assume that you have a large CPU utilization on your VM, which can potentially degrade the overall performance and affect Kubernetes engine. Although, Kubernetes provides a comprehensive mechanism for managing Compute resources, it distributes resources allocated on a specific Node within Pods which are consuming CPU and RAM on that Node.

To check general resource utilization on a particular Node, you can use this command:

kubectl describe node <node-name>

To check a Pod terminating reason, you can use similar command as in the above example:

kubectl describe pod <pod_name>

However, when you require to dig deeper into the troubleshooting action on your Kubernetes cluster, I would recommend to look at the official Guide.

-- mk_sta
Source: StackOverflow