utils

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultAddressTypePriority is the default node address type
	// priority list, as taken from the Kubernetes API metrics-server options.
	// In general, we prefer overrides to others, internal to external,
	// and DNS to IPs.
	DefaultAddressTypePriority = []corev1.NodeAddressType{

		corev1.NodeHostName,

		corev1.NodeInternalDNS,
		corev1.NodeInternalIP,

		corev1.NodeExternalDNS,
		corev1.NodeExternalIP,
	}
)

Functions

func BucketsForScrapeDuration

func BucketsForScrapeDuration(scrapeTimeout time.Duration) []float64

BucketsForScrapeDuration calculates a variant of the prometheus default histogram buckets that includes relevant buckets around our scrape timeout.

Types

type NodeAddressResolver

type NodeAddressResolver interface {
	// NodeAddress finds the preferred address to use to connect to
	// the given node.
	NodeAddress(node *corev1.Node) (address string, err error)
}

NodeAddressResolver knows how to find the preferred connection address for a given node.

func NewPriorityNodeAddressResolver

func NewPriorityNodeAddressResolver(typePriority []corev1.NodeAddressType) NodeAddressResolver

NewPriorityNodeAddressResolver creates a new NodeAddressResolver that resolves addresses first based on a list of prioritized address types, then based on address order (first to last) within a particular address type.

Jump to

Keyboard shortcuts

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