Search code examples
azureazure-aksazure-monitoringazure-monitor

Aks ImagePullbackoff not getting alerted in Pending Pods Alert


I had set an alert in azure monitor for pending pods with kube pod phase set to pending in azure monitor. It only get alerted for pending pods and not ImagePullBack and CrashloopbackOFF . is there a way to get alerts for these too.


Solution

  • You can create a custom Alert for CrashLoopBackOff & ImagePullBackOff based on this Kusto Query:

    KubePodInventory 
      | where PodStatus == 'Pending'
      | where ContainerStatusReason in ('ErrImagePull','ImagePullBackOff')