Documentation

Index

Constants

View Source
const ControlPlanePort = 6443
View Source
const KubeadmContainerPort = 6443

Variables

This section is empty.

Functions

func List

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

    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

    Types

    type ContainerNotRunningError

    type ContainerNotRunningError struct {
    	Name string
    }

      ContainerNotRunningError is returned when trying to patch a container that is not running

      func (ContainerNotRunningError) Error

      func (cse ContainerNotRunningError) Error() string

        Error returns the error string

        type LoadBalancer

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

          LoadBalancer manages the load balancer for a specific docker cluster.

          func NewLoadBalancer

          func NewLoadBalancer(name string) (*LoadBalancer, error)

            NewLoadBalancer returns a new helper for managing a docker loadbalancer with a given name.

            func (*LoadBalancer) Create

            func (s *LoadBalancer) Create(ctx context.Context) error

              Create creates a docker container hosting a load balancer for the cluster.

              func (*LoadBalancer) Delete

              func (s *LoadBalancer) Delete(ctx context.Context) error

                Delete the docker container hosting the cluster load balancer.

                func (*LoadBalancer) IP

                func (s *LoadBalancer) IP(ctx context.Context) (string, error)

                  IP returns the load balancer IP address

                  func (*LoadBalancer) UpdateConfiguration

                  func (s *LoadBalancer) UpdateConfiguration(ctx context.Context) error

                    UpdateConfiguration updates the external load balancer configuration with new control plane nodes.

                    type Machine

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

                      Machine implement a service for managing the docker containers hosting a kubernetes nodes.

                      func ListMachinesByCluster

                      func ListMachinesByCluster(cluster string, labels map[string]string) ([]*Machine, error)

                      func NewMachine

                      func NewMachine(cluster, machine, image string, labels map[string]string) (*Machine, error)

                        NewMachine returns a new Machine service for the given Cluster/DockerCluster pair.

                        func (*Machine) Address

                        func (m *Machine) Address(ctx context.Context) (string, error)

                        func (*Machine) CheckForBootstrapSuccess

                        func (m *Machine) CheckForBootstrapSuccess(ctx context.Context) error

                          CheckForBootstrapSuccess checks if bootstrap was successful by checking for existence of the sentinel file.

                          func (*Machine) ContainerName

                          func (m *Machine) ContainerName() string

                            ContainerName return the name of the container for this machine

                            func (*Machine) Create

                            func (m *Machine) Create(ctx context.Context, role string, version *string, mounts []infrav1.Mount) error

                              Create creates a docker container hosting a Kubernetes node.

                              func (*Machine) Delete

                              func (m *Machine) Delete(ctx context.Context) error

                                Delete deletes a docker container hosting a Kubernetes node.

                                func (*Machine) ExecBootstrap

                                func (m *Machine) ExecBootstrap(ctx context.Context, data string) error

                                  ExecBootstrap runs bootstrap on a node, this is generally `kubeadm <init|join>`

                                  func (*Machine) Exists

                                  func (m *Machine) Exists() bool

                                    Exists returns true if the container for this machine exists.

                                    func (*Machine) ImageVersion

                                    func (m *Machine) ImageVersion() string

                                      ImageVersion returns the version of the image used or nil if not specified NOTE: Image version might be different from the Kubernetes version, because some characters allowed by semver (e.g. +) can't be used for image tags, so they are replaced with "_".

                                      func (*Machine) IsControlPlane

                                      func (m *Machine) IsControlPlane() bool

                                        IsControlPlane returns true if the container for this machine is a control plane node

                                        func (*Machine) Name

                                        func (m *Machine) Name() string

                                          Name returns the name of the machine

                                          func (*Machine) PreloadLoadImages

                                          func (m *Machine) PreloadLoadImages(ctx context.Context, images []string) error

                                          func (*Machine) ProviderID

                                          func (m *Machine) ProviderID() string

                                            ProviderID return the provider identifier for this machine

                                            func (*Machine) SetNodeProviderID

                                            func (m *Machine) SetNodeProviderID(ctx context.Context) error

                                              SetNodeProviderID sets the docker provider ID for the kubernetes node

                                              type Manager

                                              type Manager struct{}

                                              func (*Manager) CreateControlPlaneNode

                                              func (m *Manager) CreateControlPlaneNode(name, image, clusterLabel, listenAddress string, port int32, mounts []v1alpha4.Mount, portMappings []v1alpha4.PortMapping, labels map[string]string) (*types.Node, error)

                                              func (*Manager) CreateExternalLoadBalancerNode

                                              func (m *Manager) CreateExternalLoadBalancerNode(name, image, clusterLabel, listenAddress string, port int32) (*types.Node, error)

                                              func (*Manager) CreateWorkerNode

                                              func (m *Manager) CreateWorkerNode(name, image, clusterLabel string, mounts []v1alpha4.Mount, portMappings []v1alpha4.PortMapping, labels map[string]string) (*types.Node, error)

                                              type RunOpt

                                              type RunOpt func(*runOpts) *runOpts

                                                RunOpt is an option for run

                                                Directories

                                                Path Synopsis