nodeutils

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 11 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 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 ImageTags added in v0.15.0

func ImageTags(n nodes.Node, imageID string) (map[string]bool, error)

ImageTags is used to perform a reverse lookup of the ImageID to list set of available RepoTags corresponding to the ImageID in question

func InternalNodes added in v0.9.0

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

InternalNodes returns the list of container IDs for the "nodes" in the cluster that are ~Kubernetes nodes, as opposed to e.g. the external loadbalancer for HA

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 ReTagImage added in v0.15.0

func ReTagImage(n nodes.Node, imageID, imageName string) error

ReTagImage is used to tag an ImageID with a custom tag specified by imageName parameter

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