Getting Notification for AKS Events

Jacob Solomon 0 Reputation points
2025-01-20T03:56:53.8866667+00:00

I am trying to get notifications for Kubernetes events as seen in the screenshot attached.

Screenshot 2025-01-20 at 1.50.52 pm

Is there a simple way to get notified if a certain event occurs? Specifically I'm looking to be notified on when a SPOT VM has a preemption and is scheduled for deletion.

Surely I don't have to send these event logs which already exist to azure monitor just to get a notification?

Appreciate any assistance.

Thanks

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,236 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Krishna Katakam 1,700 Reputation points Microsoft Vendor
    2025-01-20T05:05:47.45+00:00

    Hi Jacob Solomon,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    To get notifications for AKS events like SPOT VM preemption, Azure Monitor is required. You need to enable Diagnostic Settings to send the kube-events logs to a Log Analytics workspace. Once the logs are available, you can set up Log Alerts in Azure Monitor to trigger notifications based on specific conditions, such as SPOT VM preemption.

    Go to your AKS cluster in the Azure portal, enable Diagnostic Settings, and send the kube-events logs to a Log Analytics workspace. Use the following query to filter preemption events:

    KubeEvents
    | where Reason == "Preempted" and Message contains "spot"
    

    Create an alert rule in Azure Monitor based on this query to receive notifications.

    For more details, please refer to the below documentation:
    Monitor Azure Kubernetes Service (AKS)
    Create or edit a log search alert rule

    If an answer has been helpful, please consider accept the "Answer" and "Upvote" to help increase visibility of this question for other members of the Microsoft Q&A community. 

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.