Documentation ¶
Overview ¶
Package nodes contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from sigs.k8s.io/kind/pkg/cluster
Index ¶
- func Delete(nodes ...Node) error
- func GetControlPlaneEndpoint(allNodes []Node) (string, string, error)
- func ListByCluster(filters ...string) (map[string][]Node, error)
- func WaitForReady(node *Node, until time.Time) bool
- type Node
- func BootstrapControlPlaneNode(allNodes []Node) (*Node, error)
- func ControlPlaneNodes(allNodes []Node) ([]Node, error)
- func CreateControlPlaneNode(name, image, clusterLabel, listenAddress string, port int32, ...) (node *Node, err error)
- func CreateExternalLoadBalancerNode(name, image, clusterLabel, listenAddress string, port int32) (node *Node, err error)
- func CreateWorkerNode(name, image, clusterLabel string, mounts []cri.Mount, ...) (node *Node, err error)
- func ExternalLoadBalancerNode(allNodes []Node) (*Node, error)
- func FromName(name string) *Node
- func List(filters ...string) ([]Node, error)
- func SecondaryControlPlaneNodes(allNodes []Node) ([]Node, error)
- func SelectNodesByRole(allNodes []Node, role string) ([]Node, error)
- func (n *Node) Cmder() exec.Cmder
- func (n *Node) Command(command string, args ...string) exec.Cmd
- func (n *Node) CopyFrom(source, dest string) error
- func (n *Node) CopyTo(source, dest string) error
- func (n *Node) EnableIPv6() error
- func (n *Node) IP() (ipv4 string, ipv6 string, err error)
- func (n *Node) ImageID(image string) (string, error)
- func (n *Node) KubeVersion() (version string, err error)
- func (n *Node) LoadImageArchive(image io.Reader) error
- func (n *Node) Name() string
- func (n *Node) Ports(containerPort int32) (hostPort int32, err error)
- func (n *Node) Role() (role string, err error)
- func (n *Node) String() string
- func (n *Node) WriteFile(dest, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetControlPlaneEndpoint ¶ added in v0.2.0
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 ListByCluster ¶
ListByCluster returns a list of nodes by the kind cluster name
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a handle to a kind node This struct must be created by one of: CreateControlPlane It should not be manually instantiated Node impleemnts exec.Cmder
func BootstrapControlPlaneNode ¶ added in v0.2.0
BootstrapControlPlaneNode returns a handle to the bootstrap control plane node
func ControlPlaneNodes ¶ added in v0.2.0
ControlPlaneNodes returns all control plane nodes such that the first entry is the bootstrap control plane node
func CreateControlPlaneNode ¶
func CreateControlPlaneNode(name, image, clusterLabel, listenAddress string, port int32, mounts []cri.Mount, portMappings []cri.PortMapping) (node *Node, err error)
CreateControlPlaneNode creates a control-plane node and gets ready for exposing the the API server
func CreateExternalLoadBalancerNode ¶ added in v0.2.0
func CreateExternalLoadBalancerNode(name, image, clusterLabel, listenAddress string, port int32) (node *Node, err error)
CreateExternalLoadBalancerNode creates an external load balancer node and gets ready for exposing the the API server and the load balancer admin console
func CreateWorkerNode ¶ added in v0.1.0
func CreateWorkerNode(name, image, clusterLabel string, mounts []cri.Mount, portMappings []cri.PortMapping) (node *Node, err error)
CreateWorkerNode creates a worker node
func ExternalLoadBalancerNode ¶ added in v0.2.0
ExternalLoadBalancerNode returns a node handle for the external control plane loadbalancer node or nil if there isn't one
func List ¶
List returns the list of container IDs for the kind "nodes", optionally filtered by docker ps filters https://docs.docker.com/engine/reference/commandline/ps/#filtering
func SecondaryControlPlaneNodes ¶ added in v0.2.0
SecondaryControlPlaneNodes returns handles to the secondary control plane nodes and NOT the bootstrap control plane node
func SelectNodesByRole ¶ added in v0.2.0
SelectNodesByRole returns a list of nodes with the matching role
func (*Node) CopyFrom ¶ added in v0.2.0
CopyFrom copies the source file on the node to dest on the host TODO(fabrizio pandini): note that this does have limitations around symlinks
but this should go away when kubeadm automatic copy certs lands, otherwise it should be refactored in something more robust in the long term
func (*Node) EnableIPv6 ¶ added in v0.4.0
EnableIPv6 enables IPv6 inside the node container and in the inner docker daemon
func (*Node) ImageID ¶ added in v0.5.0
ImageID returns the ID for a given image if it is present on the node
func (*Node) KubeVersion ¶
KubeVersion returns the Kubernetes version installed on the node
func (*Node) LoadImageArchive ¶ added in v0.3.0
LoadImageArchive will load the image contents in the image reader to the k8s.io namespace on the node such that the image can be used from a Kubernetes pod
func (*Node) Ports ¶ added in v0.1.0
Ports returns a specific port mapping for the node Node by convention use well known ports internally, while random port are used for making the `kind` cluster accessible from the host machine