Kevent
Simple library for creating Kubernetes events
Install / Use
/learn @TwiN/KeventREADME
kevent
Very simple library for creating Kubernetes events.
eventManager := kevent.NewEventManager(kubernetesClient, applicationName)
eventManager.Create(resourceNamespace, resourceKind, resourceName, reason, message, isWarning)
Where:
applicationNameis the name of the application that creates the event.kubernetesClientis a Kubernetes client (e.g.kubernetes.Clientset). Note that for testing purposes, the actual parameter type is kubernetes.Interface, whichkubernetes.Clientsetimplements.resourceNamespaceis the namespace of the resource that the event is related to.resourceKindis the kind of the resource that the event is related to.resourceNameis the name of the resource that the event is related to.reasonis the reason for the event (e.g.FailedToCreate,Scheduled,FailedToSchedule, etc.).messageis the message for the event.isWarningis a boolean indicating whether the event is of typeWarningorNormal.
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
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
