Package nodes contains functionality for Kubernetes-in-Docker nodes It mostly exists to break up functionality from



    This section is empty.


    This section is empty.


    func Delete

    func Delete(nodes ...Node) error

      Delete deletes nodes by name / ID (see Node.String())

      func ListByCluster

      func ListByCluster(filters ...string) (map[string][]Node, error)

        ListByCluster returns a list of nodes by the kind cluster name

        func WaitForReady

        func WaitForReady(node *Node, until time.Time) bool

          WaitForReady uses kubectl inside the "node" container to check if the control plane nodes are "Ready".


          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 CreateControlPlaneNode

            func CreateControlPlaneNode(name, image, clusterLabel string) (node *Node, err error)

              CreateControlPlaneNode creates a contol-plane node and gets ready for exposing the the API server

              func CreateWorkerNode

              func CreateWorkerNode(name, image, clusterLabel string) (node *Node, err error)

                CreateWorkerNode creates a worker node

                func FromID

                func FromID(id string) *Node

                  FromID creates a node handle from the node (container's) ID

                  func List

                  func List(filters ...string) ([]Node, error)

                    List returns the list of container IDs for the kind "nodes", optionally filtered by docker ps filters

                    func (*Node) Cmder

                    func (n *Node) Cmder() exec.Cmder

                      Cmder returns an exec.Cmder that runs on the node via docker exec

                      func (*Node) Command

                      func (n *Node) Command(command string, args ...string) exec.Cmd

                        Command returns a new exec.Cmd that will run on the node

                        func (*Node) CopyTo

                        func (n *Node) CopyTo(source, dest string) error

                          CopyTo copies the source file on the host to dest on the node

                          func (*Node) FixMounts

                          func (n *Node) FixMounts() error

                            FixMounts will correct mounts in the node container to meet the right sharing and permissions for systemd and Docker / Kubernetes

                            func (*Node) IP

                            func (n *Node) IP() (ip string, err error)

                              IP returns the IP address of the node

                              func (*Node) KubeVersion

                              func (n *Node) KubeVersion() (version string, err error)

                                KubeVersion returns the Kubernetes version installed on the node

                                func (*Node) LoadImages

                                func (n *Node) LoadImages()

                                  LoadImages loads image tarballs stored on the node into docker on the node

                                  func (*Node) Ports

                                  func (n *Node) Ports(containerPort int) (hostPort int, err error)

                                    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

                                    func (*Node) SignalStart

                                    func (n *Node) SignalStart() error

                                      SignalStart sends SIGUSR1 to the node, which signals our entrypoint to boot see images/node/entrypoint

                                      func (*Node) String

                                      func (n *Node) String() string

                                      func (*Node) WaitForDocker

                                      func (n *Node) WaitForDocker(until time.Time) bool

                                        WaitForDocker waits for Docker to be ready on the node it returns true on success, and false on a timeout

                                        func (*Node) WriteKubeConfig

                                        func (n *Node) WriteKubeConfig(dest string, hostPort int) error

                                          WriteKubeConfig writes a fixed KUBECONFIG to dest this should only be called on a control plane node While copyng to the host machine the control plane address is replaced with local host and the control plane port with a randomly generated port reserved during node creation.