internal

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNodeInformer

func CreateNodeInformer(ctx context.Context,
	client *kubernetes.Clientset, metric *prometheus.GaugeVec,
	logger *zap.SugaredLogger, runtimeConfig *RunConfiguration)

func GetLogEncoder

func GetLogEncoder(usePlain bool, config zapcore.EncoderConfig) zapcore.Encoder

func MetricsProcessing

func MetricsProcessing(ctx context.Context, clientset *kubernetes.Clientset, metric *prometheus.GaugeVec, nodeName string, logger *zap.SugaredLogger, runtimeConfig *RunConfiguration)

func ProcessSingleNodeMetrics

func ProcessSingleNodeMetrics(ctx context.Context, clientset *kubernetes.Clientset, logger *zap.SugaredLogger, metric *prometheus.GaugeVec, nodeName string) (*[]Pod, error)

Gets Node statistics from API, parsing it and register prometheus metric for each pod on the node

func RegisterPrometheusMetrics

func RegisterPrometheusMetrics(ctx context.Context) *prometheus.GaugeVec

func UpEndpointHandler

func UpEndpointHandler(w http.ResponseWriter, r *http.Request)

Types

type Node

type Node struct {
	Node struct {
		NodeName string `json:"nodeName"`
	} `json:"node"`
	Pods []PodRef `json:"pods"`
}

type Pod

type Pod struct {
	PodName string
}

type PodRef

type PodRef struct {
	PodRef struct {
		Name      string `json:"name"`
		Namespace string `json:"namespace"`
	} `json:"podRef"`
	EphemeralStorage struct {
		Usedbytes any `json:"usedBytes"`
	} `json:"ephemeral-storage"`
}

type RunConfiguration

type RunConfiguration struct {
	KubeConfig      string
	Port            int
	RefreshInterval int
	PlainLogs       bool
}

func ParseInputArguments

func ParseInputArguments() (*RunConfiguration, error)

Jump to

Keyboard shortcuts

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