localkube

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EtcdName is the name of the extra-config component for etcd
	EtcdName = "etcd"
)

Variables

View Source
var (
	MasqueradeBit = int32(14)
	OOMScoreAdj   = int32(qos.KubeProxyOOMScoreAdj)
)

Functions

func NewHostPathProvisioner added in v0.17.0

func NewHostPathProvisioner() controller.Provisioner

func StartAPIServer

func StartAPIServer(lk LocalkubeServer) func() error

func StartControllerManagerServer

func StartControllerManagerServer(lk LocalkubeServer) func() error

func StartKubeletServer

func StartKubeletServer(lk LocalkubeServer) func() error

func StartProxyServer

func StartProxyServer(lk LocalkubeServer) func() error

func StartSchedulerServer

func StartSchedulerServer(lk LocalkubeServer) func() error

func StartStorageProvisioner added in v0.17.0

func StartStorageProvisioner(lk LocalkubeServer) func() error

Types

type EtcdServer

type EtcdServer struct {
	Etcd   *embed.Etcd
	Config *embed.Config
}

EtcdServer is a Server which manages an Etcd cluster

func (EtcdServer) Name

func (e EtcdServer) Name() string

Name returns the servers unique name

func (*EtcdServer) Start

func (e *EtcdServer) Start()

Start starts the etcd server and listening for client connections

func (*EtcdServer) Stop

func (e *EtcdServer) Stop()

Stop closes all connections and stops the Etcd server

type HealthCheck added in v0.19.0

type HealthCheck func() bool

type LocalkubeServer

type LocalkubeServer struct {
	// Inherits Servers
	Servers

	// Options
	Containerized            bool
	EnableDNS                bool
	DNSDomain                string
	DNSIP                    net.IP
	LocalkubeDirectory       string
	ServiceClusterIPRange    net.IPNet
	APIServerAddress         net.IP
	APIServerPort            int
	APIServerInsecureAddress net.IP
	APIServerInsecurePort    int
	APIServerName            string
	ShouldGenerateCerts      bool
	ShouldGenerateKubeconfig bool
	ShowVersion              bool
	ShowHostIP               bool
	RuntimeConfig            flag.ConfigurationMap
	NodeIP                   net.IP
	ContainerRuntime         string
	RemoteRuntimeEndpoint    string
	RemoteImageEndpoint      string
	NetworkPlugin            string
	FeatureGates             string
	ExtraConfig              util.ExtraOptionSlice
}

LocalkubeServer provides a fully functional Kubernetes cluster running entirely through goroutines

func (*LocalkubeServer) AddServer

func (lk *LocalkubeServer) AddServer(server Server)

func (LocalkubeServer) GenerateCerts

func (lk LocalkubeServer) GenerateCerts() error

func (LocalkubeServer) GenerateKubeconfig added in v0.22.3

func (lk LocalkubeServer) GenerateKubeconfig() error

func (LocalkubeServer) GetAPIServerInsecureURL

func (lk LocalkubeServer) GetAPIServerInsecureURL() string

func (LocalkubeServer) GetAPIServerProtocol added in v0.22.3

func (lk LocalkubeServer) GetAPIServerProtocol() string

func (LocalkubeServer) GetAPIServerSecureURL

func (lk LocalkubeServer) GetAPIServerSecureURL() string

func (LocalkubeServer) GetCAPrivateKeyCertPath added in v0.6.0

func (lk LocalkubeServer) GetCAPrivateKeyCertPath() string

func (LocalkubeServer) GetCAPublicKeyCertPath added in v0.6.0

func (lk LocalkubeServer) GetCAPublicKeyCertPath() string

func (LocalkubeServer) GetCertificateDirectory

func (lk LocalkubeServer) GetCertificateDirectory() string

func (LocalkubeServer) GetDNSDataDirectory

func (lk LocalkubeServer) GetDNSDataDirectory() string

func (LocalkubeServer) GetEtcdDataDirectory

func (lk LocalkubeServer) GetEtcdDataDirectory() string

func (LocalkubeServer) GetHostIP

func (lk LocalkubeServer) GetHostIP() (net.IP, error)

Get the host's public IP address

func (LocalkubeServer) GetPrivateKeyCertPath

func (lk LocalkubeServer) GetPrivateKeyCertPath() string

func (LocalkubeServer) GetProxyClientCAPrivateKeyCertPath added in v0.22.1

func (lk LocalkubeServer) GetProxyClientCAPrivateKeyCertPath() string

func (LocalkubeServer) GetProxyClientCAPublicKeyCertPath added in v0.22.1

func (lk LocalkubeServer) GetProxyClientCAPublicKeyCertPath() string

func (LocalkubeServer) GetProxyClientPrivateKeyCertPath added in v0.22.1

func (lk LocalkubeServer) GetProxyClientPrivateKeyCertPath() string

func (LocalkubeServer) GetProxyClientPublicKeyCertPath added in v0.22.1

func (lk LocalkubeServer) GetProxyClientPublicKeyCertPath() string

func (LocalkubeServer) GetPublicKeyCertPath

func (lk LocalkubeServer) GetPublicKeyCertPath() string

func (LocalkubeServer) GetTransport added in v0.22.3

func (lk LocalkubeServer) GetTransport() (*http.Transport, error)

func (LocalkubeServer) NewAPIServer

func (lk LocalkubeServer) NewAPIServer() Server

func (LocalkubeServer) NewControllerManagerServer

func (lk LocalkubeServer) NewControllerManagerServer() Server

func (LocalkubeServer) NewEtcd

func (lk LocalkubeServer) NewEtcd(dataDir string) (*EtcdServer, error)

NewEtcd creates a new default etcd Server using 'dataDir' for persistence. Panics if could not be configured.

func (LocalkubeServer) NewKubeletServer

func (lk LocalkubeServer) NewKubeletServer() Server

func (LocalkubeServer) NewProxyServer

func (lk LocalkubeServer) NewProxyServer() Server

func (LocalkubeServer) NewSchedulerServer

func (lk LocalkubeServer) NewSchedulerServer() Server

func (LocalkubeServer) NewStorageProvisionerServer added in v0.17.0

func (lk LocalkubeServer) NewStorageProvisionerServer() Server

func (LocalkubeServer) SetExtraConfigForComponent added in v0.11.0

func (lk LocalkubeServer) SetExtraConfigForComponent(component string, config interface{})

type Server

type Server interface {
	// Start immediately starts the component.
	Start()

	// Stop begins the process of stopping the component.
	Stop()

	// Name returns a unique identifier for the component.
	Name() string

	Ready() (bool, error)
}

Server represents a component that Kubernetes depends on. It allows for the management of the lifecycle of the component.

type Servers

type Servers []Server

Servers allows operations to be performed on many servers at once. Uses slice to preserve ordering.

func (Servers) Get

func (servers Servers) Get(name string) (Server, error)

Get returns a server matching name, returns nil if server doesn't exit.

func (Servers) Start

func (servers Servers) Start(serverName string) error

Start is a helper method to start the Server specified, returns error if server doesn't exist.

func (Servers) StartAll

func (servers Servers) StartAll()

StartAll starts all services, starting from 0th item and ascending.

func (Servers) Stop

func (servers Servers) Stop(serverName string) error

Stop is a helper method to start the Server specified, returns error if server doesn't exist.

func (Servers) StopAll

func (servers Servers) StopAll()

StopAll stops all services, starting with the last item.

type SimpleServer

type SimpleServer struct {
	ComponentName string
	Interval      time.Duration
	// contains filtered or unexported fields
}

SimpleServer provides a minimal implementation of Server.

func NewSimpleServer

func NewSimpleServer(componentName string, msInterval int32, serverRoutine func() error, ready HealthCheck) *SimpleServer

func (SimpleServer) Name

func (s SimpleServer) Name() string

Name returns the name of the service.

func (SimpleServer) Ready added in v0.19.0

func (s SimpleServer) Ready() (bool, error)

func (*SimpleServer) Start

func (s *SimpleServer) Start()

Start calls startup function.

func (*SimpleServer) Stop

func (s *SimpleServer) Stop()

Stop calls shutdown function.

Jump to

Keyboard shortcuts

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