package util

import "k8s.io/kubernetes/pkg/kubelet/util"

Package util holds utility functions.

Index

Functions

func CreateListener

func CreateListener(endpoint string) (net.Listener, error)

CreateListener creates a listener on the specified endpoint.

func FromApiserverCache

func FromApiserverCache(opts *metav1.GetOptions)

FromApiserverCache modifies <opts> so that the GET request will be served from apiserver cache instead of from etcd.

func GetAddressAndDialer

func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)

GetAddressAndDialer returns the address parsed from the given endpoint and a context dialer.

func GetBootTime

func GetBootTime() (time.Time, error)

GetBootTime returns the time at which the machine was started, truncated to the nearest second

func GetNodenameForKernel

func GetNodenameForKernel(hostname string, hostDomainName string, setHostnameAsFQDN *bool) (string, error)

GetNodenameForKernel gets hostname value to set in the hostname field (the nodename field of struct utsname) of the pod.

func IsUnixDomainSocket

func IsUnixDomainSocket(filePath string) (bool, error)

IsUnixDomainSocket returns whether a given file is a AF_UNIX socket file Note that due to the retry logic inside, it could take up to 4 seconds to determine whether or not the file path supplied is a Unix domain socket

func LocalEndpoint

func LocalEndpoint(path, file string) (string, error)

LocalEndpoint empty implementation

func NormalizePath

func NormalizePath(path string) string

NormalizePath converts FS paths returned by certain go frameworks (like fsnotify) to native Windows paths that can be passed to Windows specific code

func SetNodeOwnerFunc

func SetNodeOwnerFunc(c clientset.Interface, nodeName string) func(lease *coordinationv1.Lease) error

SetNodeOwnerFunc helps construct a newLeasePostProcessFunc which sets a node OwnerReference to the given lease object

Types

type PodStartupLatencyTracker

type PodStartupLatencyTracker interface {
	ObservedPodOnWatch(pod *v1.Pod, when time.Time)
	RecordImageStartedPulling(podUID types.UID)
	RecordImageFinishedPulling(podUID types.UID)
	RecordStatusUpdated(pod *v1.Pod)
	DeletePodStartupState(podUID types.UID)
}

PodStartupLatencyTracker records key moments for startup latency calculation, e.g. image pulling or pod observed running on watch.

func NewPodStartupLatencyTracker

func NewPodStartupLatencyTracker() PodStartupLatencyTracker

NewPodStartupLatencyTracker creates an instance of PodStartupLatencyTracker

Source Files

doc.go nodelease.go pod_startup_latency_tracker.go util.go util_windows.go

Directories

PathSynopsis
pkg/kubelet/util/cache
pkg/kubelet/util/format
pkg/kubelet/util/ioutils
pkg/kubelet/util/manager
pkg/kubelet/util/queue
pkg/kubelet/util/sliceutils
pkg/kubelet/util/storePackage store hosts a Store interface and its implementations.
Version
v1.26.8
Published
Aug 24, 2023
Platform
windows/amd64
Imports
18 packages
Last checked
23 seconds ago

Tools for package owners.