summary

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 20 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 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 IsNotFoundError

func IsNotFoundError(err error) bool

func NewSummaryMetricsSource

func NewSummaryMetricsSource(node NodeInfo, client KubeletInterface) sources.MetricSource

func NewSummaryProvider

func NewSummaryProvider(nodeLister v1listers.NodeLister, kubeletClient KubeletInterface, addrResolver NodeAddressResolver) sources.MetricSourceProvider

Types

type ErrNotFound

type ErrNotFound struct {
	// contains filtered or unexported fields
}

func (*ErrNotFound) Error

func (err *ErrNotFound) Error() string

type KubeletClientConfig

type KubeletClientConfig struct {
	Port                         int
	RESTConfig                   *rest.Config
	DeprecatedCompletelyInsecure bool
}

KubeletClientConfig represents configuration for connecting to Kubelets.

func GetKubeletConfig

func GetKubeletConfig(cfg *rest.Config, port int, insecureTLS bool, completelyInsecure bool) *KubeletClientConfig

GetKubeletConfig fetches connection config for connecting to the Kubelet.

type KubeletInterface

type KubeletInterface interface {
	// GetSummary fetches summary metrics from the given Kubelet
	GetSummary(ctx context.Context, host string) (*stats.Summary, error)
}

KubeletInterface knows how to fetch metrics from the Kubelet

func KubeletClientFor

func KubeletClientFor(config *KubeletClientConfig) (KubeletInterface, error)

KubeletClientFor constructs a new KubeletInterface for the given configuration.

func NewKubeletClient

func NewKubeletClient(transport http.RoundTripper, port int, deprecatedNoTLS bool) (KubeletInterface, error)

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.

type NodeInfo

type NodeInfo struct {
	Name           string
	ConnectAddress string
}

NodeInfo contains the information needed to identify and connect to a particular node (node name and preferred address).

Jump to

Keyboard shortcuts

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