Monitoring Kubernetes CronJob completion using AWS Container Insights

4/7/2020

Currently, I am not able to monitor any parameter on CronJobs (in Kubernetes) other than memory usage. Is there a way to monitor CronJob completion/failure in AWS CloudWatch? Thanks.

-- Leow Kah Man
amazon-cloudwatch
amazon-eks
aws-eks
kubernetes

1 Answer

4/7/2020

You can check Cronjob completion/failure by pods status only. However if you want to verify you can check by logs also if you have enable logs from EKS dashboard which will push logs to cloud watch and check the logs of cronjobs.

Also you can do something like :

kubectl get jobs <job-name> -o json | jq '.status.conditions'

but please just keep in mind Jobs never Failed (its Pods terminated with error doesn't mean the Jobs has Failed

How to get notification on job failing :

https://medium.com/faun/how-to-get-notifications-when-kubernetes-cronjobs-fail-ed4ca4313e81

-- Harsh Manvar
Source: StackOverflow