Skip to content

Log event before Kubernetes de-dups them #1559

Closed

Description

@PakDLiu

Describe the bug
I am trying to log Kubernetes events as they come in. However, it seems like Kubernetes will correlate the events and if it finds a similar one, it will just increase that event's count

Is there anyway to get events as they come in before Kubernetes de-dupes them?
Here is my code right now, but it will only log if there is a new event and it doesn't log if the event correlates with an existing event.

        var events = client.CoreV1.ListEventForAllNamespacesWithHttpMessagesAsync(watch: true);
        await foreach (var (_, e) in events.WatchAsync<Corev1Event, Corev1EventList>())
        {
           log(e.Message);
        }

Kubernetes C# SDK Client Version
13.0.26

Server Kubernetes Version
1.28.5

Dotnet Runtime Version
N/A

To Reproduce
Have Kubernetes correlate the event

Expected behavior
A separate log message for every event that comes in

KubeConfig
N/A

Where do you run your app with Kubernetes SDK (please complete the following information):

  • OS: Linux
  • Environment: container
  • Cloud: Azure

Additional context
N/A

Activity

  1. tg123 commented on Jun 6, 2024

    @tg123
    Member

    did you try EventsV1 corev1event is deprecated

    see
    https://kubernetes.io/docs/reference/using-api/deprecation-guide/#event-v125

    any change should be captured by watch

  2. PakDLiu commented on Jun 6, 2024

    @PakDLiu
    Author

    That worked, thanks!

  3. locked and limited conversation to collaborators on Jun 7, 2024
  4. converted this issue into a discussion #1560 on Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions