Documentation ¶
Overview ¶
Package util holds utility functions.
Index ¶
- Variables
- func FromApiserverCache(opts *metav1.GetOptions)
- func GetBootTime() (time.Time, error)
- func GetContainerByIndex(containers []v1.Container, statuses []v1.ContainerStatus, idx int) (v1.Container, bool)
- func GetNodenameForKernel(hostname string, hostDomainName string, setHostnameAsFQDN *bool) (string, error)
- func LocalEndpoint(path, file string) (string, error)
- func NormalizePath(path string) string
- func SetNodeOwnerFunc(c clientset.Interface, nodeName string) func(lease *coordinationv1.Lease) error
- type NodeStartupLatencyTracker
- type PodStartupLatencyTracker
Constants ¶
This section is empty.
Variables ¶
var IsUnixDomainSocket = filesystem.IsUnixDomainSocket
Functions ¶
func FromApiserverCache ¶ added in v1.6.0
func FromApiserverCache(opts *metav1.GetOptions)
FromApiserverCache modifies <opts> so that the GET request will be served from apiserver cache instead of from etcd.
func GetBootTime ¶ added in v1.11.9
GetBootTime returns the time at which the machine was started, truncated to the nearest second
func GetContainerByIndex ¶ added in v1.28.0
func GetContainerByIndex(containers []v1.Container, statuses []v1.ContainerStatus, idx int) (v1.Container, bool)
GetContainerByIndex validates and extracts the container at index "idx" from "containers" with respect to "statuses". It returns true if the container is valid, else returns false.
func GetNodenameForKernel ¶ added in v1.19.0
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 LocalEndpoint ¶ added in v1.13.0
LocalEndpoint returns the full path to a unix socket at the given endpoint
func NormalizePath ¶ added in v1.16.0
NormalizePath is a no-op for Linux for now
func SetNodeOwnerFunc ¶ added in v1.20.0
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 NodeStartupLatencyTracker ¶ added in v1.29.0
type NodeStartupLatencyTracker interface { // This function may be called across Kubelet restart. RecordAttemptRegisterNode() // This function should not be called across Kubelet restart. RecordRegisteredNewNode() // This function may be called across Kubelet restart. RecordNodeReady() }
func NewNodeStartupLatencyTracker ¶ added in v1.29.0
func NewNodeStartupLatencyTracker() NodeStartupLatencyTracker
type PodStartupLatencyTracker ¶ added in v1.26.0
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 ¶ added in v1.26.0
func NewPodStartupLatencyTracker() PodStartupLatencyTracker
NewPodStartupLatencyTracker creates an instance of PodStartupLatencyTracker