master

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2015 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

HACK(jdef): cloned from https://github.com/GoogleCloudPlatform/kubernetes/blob/v0.5.4/pkg/master/handlers.go

HACK(jdef): cloned from https://github.com/GoogleCloudPlatform/kubernetes/blob/v0.5.4/pkg/master/publish.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEtcdHelper

func NewEtcdHelper(client tools.EtcdGetSet, version string) (helper tools.EtcdHelper, err error)

NewEtcdHelper returns an EtcdHelper for the provided arguments or an error if the version is incorrect.

func NewHandlerContainer added in v0.3.0

func NewHandlerContainer(mux *http.ServeMux) *restful.Container

Types

type Config

type Config struct {
	Client                *client.Client
	Cloud                 cloudprovider.Interface
	EtcdHelper            tools.EtcdHelper
	HealthCheckMinions    bool
	MinionCacheTTL        time.Duration
	EventTTL              time.Duration
	MinionRegexp          string
	KubeletClient         client.KubeletClient
	PortalNet             *net.IPNet
	EnableLogsSupport     bool
	EnableUISupport       bool
	APIPrefix             string
	CorsAllowedOriginList util.StringList
	Authenticator         authenticator.Request
	Authorizer            authorizer.Authorizer

	// Number of masters running; all masters must be started with the
	// same value for this field. (Numbers > 1 currently untested.)
	MasterCount int

	// The port on PublicAddress where a read-only server will be installed.
	// Defaults to 7080 if not set.
	ReadOnlyPort int
	// The port on PublicAddress where a read-write server will be installed.
	// Defaults to 443 if not set.
	ReadWritePort int

	// If empty, the first result from net.InterfaceAddrs will be used.
	PublicAddress string

	// HACK(jdef): k8s-mesos implements a custom pod registry, we reference it this way
	PRFactory PodRegistryFactory
}

Config is a structure used to configure a Master.

type Master

type Master struct {

	// "Outputs"
	Handler         http.Handler
	InsecureHandler http.Handler
	// 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 from the given config. Certain config fields will be set to a default value if unset, including:

PortalNet
MasterCount
ReadOnlyPort
ReadWritePort
PublicAddress

Certain config fields must be specified, including:

KubeletClient

Public fields:

Handler -- The returned master has a field TopHandler which is an
http.Handler which handles all the endpoints provided by the master,
including the API, the UI, and miscelaneous debugging endpoints.  All
these are subject to authorization and authentication.
InsecureHandler -- an http.Handler which handles all the same
endpoints as Handler, but no authorization and authentication is done.

Public methods:

HandleWithAuth -- Allows caller to add an http.Handler for an endpoint
that uses the same authentication and authorization (if any is configured)
as the master's built-in endpoints.
If the caller wants to add additional endpoints not using the master's
auth, then the caller should create a handler for those endpoints, which delegates the
any unhandled paths to "Handler".

func (*Master) API_v1beta1

API_v1beta1 returns the resources and codec for API version v1beta1.

func (*Master) API_v1beta2

API_v1beta2 returns the resources and codec for API version v1beta2.

func (*Master) GetBoundPodFactory added in v0.3.0

func (m *Master) GetBoundPodFactory() pod.BoundPodFactory

HACK(jdef): factory method that our custom pod registry impl needs

func (*Master) HandleFuncWithAuth added in v0.3.0

func (m *Master) HandleFuncWithAuth(pattern string, handler func(http.ResponseWriter, *http.Request))

HandleFuncWithAuth adds an http.Handler for pattern to an http.ServeMux Applies the same authentication and authorization (if any is configured) to the request is used for the master's built-in endpoints.

func (*Master) HandleWithAuth added in v0.3.0

func (m *Master) HandleWithAuth(pattern string, handler http.Handler)

HandleWithAuth adds an http.Handler for pattern to an http.ServeMux Applies the same authentication and authorization (if any is configured) to the request is used for the master's built-in endpoints.

type PodRegistryFactory

type PodRegistryFactory func() pod.Registry

Jump to

Keyboard shortcuts

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