nodeutils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 33

Documentation

Overview

Package nodeutils contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from sigs.k8s.io/kind/pkg/cluster

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIServerEndpointNode

func APIServerEndpointNode(allNodes []nodes.Node) (nodes.Node, error)

APIServerEndpointNode selects the node from allNodes which hosts the API Server endpoint This should be the control plane node if there is one control plane node, or a LoadBalancer otherwise. It returns an error if the node list is invalid (E.G. two control planes and no load balancer)

func BootstrapControlPlaneNode

func BootstrapControlPlaneNode(allNodes []nodes.Node) (nodes.Node, error)

BootstrapControlPlaneNode returns a handle to the bootstrap control plane node TODO(bentheelder): remove this. This node shouldn't be special (fix that first)

func ControlPlaneNodes

func ControlPlaneNodes(allNodes []nodes.Node) ([]nodes.Node, error)

ControlPlaneNodes returns all control plane nodes such that the first entry is the bootstrap control plane node

func CopyNodeToNode

func CopyNodeToNode(a, b nodes.Node, file string) error

CopyNodeToNode copies file from a to b

func ExternalLoadBalancerNode

func ExternalLoadBalancerNode(allNodes []nodes.Node) (nodes.Node, error)

ExternalLoadBalancerNode returns a node handle for the external control plane loadbalancer node or nil if there isn't one

func GetControlPlaneEndpoint

func GetControlPlaneEndpoint(allNodes []nodes.Node) (string, string, error)

GetControlPlaneEndpoint returns the control plane endpoints for IPv4 and IPv6 in case the cluster has an external load balancer in front of the control-plane nodes, otherwise return the bootstrap node IPs

func ImageID

func ImageID(n nodes.Node, image string) (string, error)

ImageID returns ID of image on the node with the given image name if present

func KubeVersion

func KubeVersion(n nodes.Node) (version string, err error)

KubeVersion returns the Kubernetes version installed on the node

func LoadImageArchive

func LoadImageArchive(n nodes.Node, image io.Reader) error

LoadImageArchive loads image onto the node, where image is a Reader over an image archive

func SecondaryControlPlaneNodes

func SecondaryControlPlaneNodes(allNodes []nodes.Node) ([]nodes.Node, error)

SecondaryControlPlaneNodes returns handles to the secondary control plane nodes and NOT the bootstrap control plane node

func SelectNodesByRole

func SelectNodesByRole(allNodes []nodes.Node, role string) ([]nodes.Node, error)

SelectNodesByRole returns a list of nodes with the matching role TODO(bentheelder): remove this in favor of specific role select methods and avoid the unnecessary error handling

func WriteFile

func WriteFile(n nodes.Node, dest, content string) error

WriteFile writes content to dest on the node

Types

This section is empty.

Jump to

Keyboard shortcuts

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