kubelet

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPreferredNodeAddress

func GetPreferredNodeAddress(node *v1.Node, preferredAddressTypes []v1.NodeAddressType) (string, error)

GetPreferredNodeAddress returns the address of the provided node, using the provided preference order. If none of the preferred address types are found, an error is returned.

func MakeTransport

func MakeTransport(config *KubeletClientConfig) (http.RoundTripper, error)

MakeTransport creates a RoundTripper for HTTP Transport.

Types

type ConnectionInfo

type ConnectionInfo struct {
	Scheme    string
	Hostname  string
	Port      string
	Transport http.RoundTripper
}

ConnectionInfo provides the information needed to connect to a kubelet

type ConnectionInfoGetter

type ConnectionInfoGetter interface {
	GetConnectionInfo(ctx context.Context, nodeName types.NodeName) (*ConnectionInfo, error)
}

ConnectionInfoGetter provides ConnectionInfo for the kubelet running on a named node

func NewNodeConnectionInfoGetter

func NewNodeConnectionInfoGetter(nodes NodeGetter, config KubeletClientConfig) (ConnectionInfoGetter, error)

NewNodeConnectionInfoGetter creates a new NodeConnectionInfoGetter.

type KubeletClientConfig

type KubeletClientConfig struct {
	// Port specifies the default port - used if no information about Kubelet port can be found in Node.NodeStatus.DaemonEndpoints.
	Port uint

	// ReadOnlyPort specifies the Port for ReadOnly communications.
	ReadOnlyPort uint

	// EnableHTTPs specifies if traffic should be encrypted.
	EnableHTTPS bool

	// PreferredAddressTypes - used to select an address from Node.NodeStatus.Addresses
	PreferredAddressTypes []string

	// TLSClientConfig contains settings to enable transport layer security
	restclient.TLSClientConfig

	// Server requires Bearer authentication
	BearerToken string

	// HTTPTimeout is used by the client to timeout http requests to Kubelet.
	HTTPTimeout time.Duration

	// Dial is a custom dialer used for the client
	Dial utilnet.DialFunc
}

KubeletClientConfig defines config parameters for the kubelet client

type NodeConnectionInfoGetter

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

NodeConnectionInfoGetter obtains connection info from the status of a Node API object

func (*NodeConnectionInfoGetter) GetConnectionInfo

func (k *NodeConnectionInfoGetter) GetConnectionInfo(ctx context.Context, nodeName types.NodeName) (*ConnectionInfo, error)

GetConnectionInfo retrieves connection info from the status of a Node API object.

type NodeGetter

type NodeGetter func(name string) (*v1.Node, error)

Jump to

Keyboard shortcuts

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