SkillAgentSearch skills...

Kevent

Simple library for creating Kubernetes events

Install / Use

/learn @TwiN/Kevent
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

kevent

test Go Reference

Very simple library for creating Kubernetes events.

eventManager := kevent.NewEventManager(kubernetesClient, applicationName)
eventManager.Create(resourceNamespace, resourceKind, resourceName, reason, message, isWarning)

Where:

  • applicationName is the name of the application that creates the event.
  • kubernetesClient is a Kubernetes client (e.g. kubernetes.Clientset). Note that for testing purposes, the actual parameter type is kubernetes.Interface, which kubernetes.Clientset implements.
  • resourceNamespace is the namespace of the resource that the event is related to.
  • resourceKind is the kind of the resource that the event is related to.
  • resourceName is the name of the resource that the event is related to.
  • reason is the reason for the event (e.g. FailedToCreate, Scheduled, FailedToSchedule, etc.).
  • message is the message for the event.
  • isWarning is a boolean indicating whether the event is of type Warning or Normal.

Example:

package main

import (
    "github.com/TwiN/kevent"
    "k8s.io/client-go/kubernetes"
    "k8s.io/client-go/rest"
)

func main() {
    clientConfig, _ := rest.InClusterConfig()
    kubernetesClient, _ := kubernetes.NewForConfig(clientConfig)
    eventManager := kevent.NewEventManager(kubernetesClient, "your-application-name")
    eventManager.Create("kube-system", "pod", "nginx", "Deleted", "Application was unstable", true)
}

Related Skills

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated3mo ago
Forks2

Languages

Go

Security Score

87/100

Audited on Dec 15, 2025

No findings