cluster

package
v0.0.0-...-f0dd218 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package cluster provides abstraction from kubernetes API.

Package cluster [TODO:description]

Package cluster provides abstraction from kubernetes API.

Package cluster provides abstraction from kubernetes API. util.go contains type utility functions for the cluster package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientSet

func CreateClientSet(kubeconfigPath string) *kubernetes.Clientset

CreateClientSet to interact with kubernetes api server.

func ProcessContainer

func ProcessContainer(pod *corev1.Pod, bunDB *bun.DB, timestamp time.Time)

Process all contenders from one Pod.

func ProcessNode

func ProcessNode(event Event, bunDB *bun.DB)

func ProcessPersistentVolume

func ProcessPersistentVolume(event Event, bunDB *bun.DB)

ProcessPersistentVolume Handling event of PersistentVolumeClaim and insert the PV into the database with all available information.

func ProcessPersistentVolumeClaim

func ProcessPersistentVolumeClaim(event Event, bunDB *bun.DB)

ProcessPersistentVolumeClaim Handling event of PersistentVolumeClaim and insert the PVC into the database with all available information.

func ProcessPod

func ProcessPod(event Event, bunDB *bun.DB)

func ProcessService

func ProcessService(event Event, bunDB *bun.DB)

func ProcessWorkqueue

func ProcessWorkqueue(bunDB *bun.DB, workqueue workqueue.RateLimitingInterface)

ProcessWorkqueue is the logic for one workqueue handler.

func RegisterEventHandlers

func RegisterEventHandlers(resourceTypes []string, informerFactory informers.SharedInformerFactory,
	funcs cache.ResourceEventHandlerFuncs,
)

RegisterEventHandlers for configured resource types in case they are implemented.

func SetupEventHandlerFuncs

func SetupEventHandlerFuncs(workqueue workqueue.RateLimitingInterface) cache.ResourceEventHandlerFuncs

SetupEventHandlerFuncs setups and returns a new event handler funcs.

Types

type Allocatable

type Allocatable struct {
	CPU    resource.Quantity
	Memory resource.Quantity
	Pods   resource.Quantity
}

type Capacity

type Capacity struct {
	CPU    resource.Quantity
	Memory resource.Quantity
	Pods   resource.Quantity
}

type Event

type Event struct {
	Type   EventType
	OldObj interface{}
	Object interface{}
	// contains filtered or unexported fields
}

type EventType

type EventType int
const (
	Add EventType = iota
	Update
	Delete
)

type NodeConditions

type NodeConditions struct {
	Ready              string
	DiskPressure       string
	MemoryPressure     string
	PIDPressure        string
	NetworkUnavailable string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL