{"modulePath":"github.com/dockerstack/kubernetes","version":"v0.20.1-0.20150627061651-1c0b765df6da","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package master\n\nPackage master contains code for setting up and running a Kubernetes cluster master.\n\n## Constants\n\n```go\nconst (\n\tDefaultEtcdPathPrefix = \"/registry\"\n)\n```\n\n## Functions\n\n```go\nfunc NewEtcdHelper(client tools.EtcdGetSet, version string, prefix string) (helper tools.EtcdHelper, err error)\n```\nNewEtcdHelper returns an EtcdHelper for the provided arguments or an error if the version is incorrect.\n\n```go\nfunc NewHandlerContainer(mux *http.ServeMux) *restful.Container\n```\n\n## Types\n\n```go\ntype Config struct {\n\tEtcdHelper    tools.EtcdHelper\n\tEventTTL      time.Duration\n\tMinionRegexp  string\n\tKubeletClient client.KubeletClient\n\t// allow downstream consumers to disable the core controller loops\n\tEnableCoreControllers bool\n\tEnableLogsSupport     bool\n\tEnableUISupport       bool\n\t// allow downstream consumers to disable swagger\n\tEnableSwaggerSupport bool\n\t// allow v1beta3 to be conditionally disabled\n\tDisableV1Beta3 bool\n\t// allow v1 to be conditionally disabled\n\tDisableV1 bool\n\t// allow downstream consumers to disable the index route\n\tEnableIndex           bool\n\tEnableProfiling       bool\n\tAPIPrefix             string\n\tCorsAllowedOriginList util.StringList\n\tAuthenticator         authenticator.Request\n\t// TODO(roberthbailey): Remove once the server no longer supports http basic auth.\n\tSupportsBasicAuth      bool\n\tAuthorizer             authorizer.Authorizer\n\tAdmissionControl       admission.Interface\n\tMasterServiceNamespace string\n\n\t// Map requests to contexts. Exported so downstream consumers can provider their own mappers\n\tRequestContextMapper api.RequestContextMapper\n\n\t// If specified, all web services will be registered into this container\n\tRestfulContainer *restful.Container\n\n\t// If specified, requests will be allocated a random timeout between this value, and twice this value.\n\t// Note that it is up to the request handlers to ignore or honor this timeout. In seconds.\n\tMinRequestTimeout int\n\n\t// Number of masters running; all masters must be started with the\n\t// same value for this field. (Numbers \u003e 1 currently untested.)\n\tMasterCount int\n\n\t// The port on PublicAddress where a read-write server will be installed.\n\t// Defaults to 6443 if not set.\n\tReadWritePort int\n\n\t// ExternalHost is the host name to use for external (public internet) facing URLs (e.g. Swagger)\n\tExternalHost string\n\n\t// PublicAddress is the IP address where members of the cluster (kubelet,\n\t// kube-proxy, services, etc.) can reach the master.\n\t// If nil or 0.0.0.0, the host's default interface will be used.\n\tPublicAddress net.IP\n\n\t// Control the interval that pod, node IP, and node heath status caches\n\t// expire.\n\tCacheTimeout time.Duration\n\n\t// The name of the cluster.\n\tClusterName string\n\n\t// The range of IPs to be assigned to services with type=ClusterIP or greater\n\tServiceClusterIPRange *net.IPNet\n\n\t// The range of ports to be assigned to services with type=NodePort or greater\n\tServiceNodePortRange util.PortRange\n\n\t// Used for secure proxy.  If empty, don't use secure proxy.\n\tSSHUser       string\n\tSSHKeyfile    string\n\tInstallSSHKey InstallSSHKey\n}\n```\nConfig is a structure used to configure a Master.\n\n```go\ntype Controller struct {\n\tNamespaceRegistry namespace.Registry\n\tServiceRegistry   service.Registry\n\t// TODO: MasterCount is yucky\n\tMasterCount int\n\n\tServiceClusterIPRegistry service.RangeRegistry\n\tServiceClusterIPInterval time.Duration\n\tServiceClusterIPRange    *net.IPNet\n\n\tServiceNodePortRegistry service.RangeRegistry\n\tServiceNodePortInterval time.Duration\n\tServiceNodePortRange    util.PortRange\n\n\tEndpointRegistry endpoint.Registry\n\tEndpointInterval time.Duration\n\n\tPublicIP net.IP\n\n\tServiceIP         net.IP\n\tServicePort       int\n\tPublicServicePort int\n\t// contains filtered or unexported fields\n}\n```\nController is the controller manager for the core bootstrap Kubernetes controller loops, which manage creating the \"kubernetes\" service, the \"default\" namespace, and provide the IP repair check on service IPs\n\n```go\nfunc (c *Controller) CreateMasterServiceIfNeeded(serviceName string, serviceIP net.IP, servicePort int) error\n```\nCreateMasterServiceIfNeeded will create the specified service if it doesn't already exist.\n\n```go\nfunc (c *Controller) CreateNamespaceIfNeeded(ns string) error\n```\nCreateNamespaceIfNeeded will create the namespace that contains the master services if it doesn't already exist\n\n```go\nfunc (c *Controller) RunKubernetesService(ch chan struct{})\n```\nRunKubernetesService periodically updates the kubernetes service\n\n```go\nfunc (c *Controller) SetEndpoints(serviceName string, ip net.IP, port int) error\n```\nSetEndpoints sets the endpoints for the given apiserver service (ro or rw). SetEndpoints expects that the endpoints objects it manages will all be managed only by SetEndpoints; therefore, to understand this, you need only understand the requirements and the body of this function.\n\nRequirements:\n\n  - All apiservers MUST use the same ports for their {rw, ro} services.\n  - All apiservers MUST use SetEndpoints and only SetEndpoints to manage the endpoints for their {rw, ro} services.\n  - All apiservers MUST know and agree on the number of apiservers expected to be running (c.masterCount).\n  - SetEndpoints is called periodically from all apiservers.\n\n```go\nfunc (c *Controller) Start()\n```\nStart begins the core controller loops that must exist for bootstrapping a cluster.\n\n```go\nfunc (c *Controller) UpdateKubernetesService() error\n```\nUpdateKubernetesService attempts to update the default Kube service.\n\n```go\ntype InstallSSHKey func(user string, data []byte) error\n```\n\n```go\ntype Master struct {\n\n\t// \"Outputs\"\n\tHandler         http.Handler\n\tInsecureHandler http.Handler\n\t// contains filtered or unexported fields\n}\n```\nMaster contains state for a Kubernetes cluster master/api server.\n\n```go\nfunc New(c *Config) *Master\n```\nNew returns a new instance of Master from the given config. Certain config fields will be set to a default value if unset, including:\n\n\tServiceClusterIPRange\n\tServiceNodePortRange\n\tMasterCount\n\tReadWritePort\n\tPublicAddress\n\nCertain config fields must be specified, including:\n\n\tKubeletClient\n\nPublic fields:\n\n\tHandler -- The returned master has a field TopHandler which is an\n\thttp.Handler which handles all the endpoints provided by the master,\n\tincluding the API, the UI, and miscelaneous debugging endpoints.  All\n\tthese are subject to authorization and authentication.\n\tInsecureHandler -- an http.Handler which handles all the same\n\tendpoints as Handler, but no authorization and authentication is done.\n\nPublic methods:\n\n\tHandleWithAuth -- Allows caller to add an http.Handler for an endpoint\n\tthat uses the same authentication and authorization (if any is configured)\n\tas the master's built-in endpoints.\n\tIf the caller wants to add additional endpoints not using the master's\n\tauth, then the caller should create a handler for those endpoints, which delegates the\n\tany unhandled paths to \"Handler\".\n\n```go\nfunc (m *Master) Dial(net, addr string) (net.Conn, error)\n```\n\n```go\nfunc (m *Master) HandleFuncWithAuth(pattern string, handler func(http.ResponseWriter, *http.Request))\n```\nHandleFuncWithAuth 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.\n\n```go\nfunc (m *Master) HandleWithAuth(pattern string, handler http.Handler)\n```\nHandleWithAuth 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.\n\n```go\nfunc (m *Master) InstallSwaggerAPI()\n```\nInstallSwaggerAPI installs the /swaggerapi/ endpoint to allow schema discovery and traversal.  It is optional to allow consumers of the Kubernetes master to register their own web services into the Kubernetes mux prior to initialization of swagger, so that other resource types show up in the documentation.\n\n```go\nfunc (m *Master) NewBootstrapController() *Controller\n```\nNewBootstrapController returns a controller for watching the core capabilities of the master.\n\n","path":"github.com/dockerstack/kubernetes/pkg/master","name":"master","synopsis":"Package master contains code for setting up and running a Kubernetes cluster master.","isRedistributable":true}
