master

package
v0.0.0-...-6eef5cf Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2014 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package master contains code for setting up and running a kubenetes cluster master.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Client             *client.Client
	Cloud              cloudprovider.Interface
	EtcdServers        []string
	HealthCheckMinions bool
	Minions            []string
	MinionCacheTTL     time.Duration
	MinionRegexp       string
	PodInfoGetter      client.PodInfoGetter
}

Config is a structure used to configure a Master.

type Master

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

Master contains state for a Kubernetes cluster master/api server.

func New

func New(c *Config) *Master

New returns a new instance of Master connected to the given etcdServer.

func NewMemoryServer

func NewMemoryServer(c *Config) *Master

NewMemoryServer returns a new instance of Master backed with memory (not etcd).

func (*Master) ConstructHandler

func (m *Master) ConstructHandler(apiPrefix string) http.Handler

ConstructHandler returns an http.Handler which serves the Kubernetes API. Instead of calling Run, you can call this function to get a handler for your own server. It is intended for testing. Only call once.

func (*Master) Run

func (m *Master) Run(myAddress, apiPrefix string) error

Run begins serving the Kubernetes API. It never returns.

type PodCache

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

PodCache contains both a cache of container information, as well as the mechanism for keeping that cache up to date.

func NewPodCache

func NewPodCache(info client.PodInfoGetter, pods registry.PodRegistry, period time.Duration) *PodCache

NewPodCache returns a new PodCache which watches container information registered in the given PodRegistry.

func (*PodCache) GetPodInfo

func (p *PodCache) GetPodInfo(host, podID string) (api.PodInfo, error)

GetPodInfo Implements the PodInfoGetter.GetPodInfo. The returned value should be treated as read-only.

func (*PodCache) Loop

func (p *PodCache) Loop()

Loop begins watching updates of container information. It runs forever, and is expected to be placed in a go routine.

func (*PodCache) UpdateAllContainers

func (p *PodCache) UpdateAllContainers()

UpdateAllContainers updates information about all containers. Either called by Loop() below, or one-off.

Jump to

Keyboard shortcuts

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