Documentation ¶
Overview ¶
Package master contains code for setting up and running a Kubernetes cluster master.
Index ¶
- type AddressFunc
- type Config
- type Controller
- func (c *Controller) CreateNamespaceIfNeeded(ns string) error
- func (c *Controller) CreateOrUpdateMasterServiceIfNeeded(serviceName string, serviceIP net.IP, servicePorts []api.ServicePort, ...) error
- func (c *Controller) ReconcileEndpoints(serviceName string, ip net.IP, endpointPorts []api.EndpointPort, ...) error
- func (c *Controller) RunKubernetesService(ch chan struct{})
- func (c *Controller) Start()
- func (c *Controller) UpdateKubernetesService(reconcile bool) error
- type InstallSSHKey
- type Master
- func (m *Master) HasThirdPartyResource(rsrc *extensions.ThirdPartyResource) (bool, error)
- func (m *Master) InstallAPIs(c *Config)
- func (m *Master) InstallThirdPartyResource(rsrc *extensions.ThirdPartyResource) error
- func (m *Master) IsTunnelSyncHealthy(req *http.Request) error
- func (m *Master) ListThirdPartyResources() []string
- func (m *Master) NewBootstrapController() *Controller
- func (m *Master) RemoveThirdPartyResource(path string) error
- type SSHTunneler
- type ThirdPartyController
- type Tunneler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressFunc ¶
type Config ¶
type Config struct { *genericapiserver.Config EnableCoreControllers bool EventTTL time.Duration KubeletClient kubeletclient.KubeletClient // Used to start and monitor tunneling Tunneler Tunneler }
type Controller ¶
type Controller struct { NamespaceRegistry namespace.Registry ServiceRegistry service.Registry // TODO: MasterCount is yucky MasterCount int ServiceClusterIPRegistry service.RangeRegistry ServiceClusterIPInterval time.Duration ServiceClusterIPRange *net.IPNet ServiceNodePortRegistry service.RangeRegistry ServiceNodePortInterval time.Duration ServiceNodePortRange utilnet.PortRange EndpointRegistry endpoint.Registry EndpointInterval time.Duration PublicIP net.IP ServiceIP net.IP ServicePort int ExtraServicePorts []api.ServicePort ExtraEndpointPorts []api.EndpointPort PublicServicePort int KubernetesServiceNodePort int // contains filtered or unexported fields }
Controller 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
func (*Controller) CreateNamespaceIfNeeded ¶
func (c *Controller) CreateNamespaceIfNeeded(ns string) error
CreateNamespaceIfNeeded will create the namespace that contains the master services if it doesn't already exist
func (*Controller) CreateOrUpdateMasterServiceIfNeeded ¶
func (c *Controller) CreateOrUpdateMasterServiceIfNeeded(serviceName string, serviceIP net.IP, servicePorts []api.ServicePort, serviceType api.ServiceType, reconcile bool) error
CreateMasterServiceIfNeeded will create the specified service if it doesn't already exist.
func (*Controller) ReconcileEndpoints ¶
func (c *Controller) ReconcileEndpoints(serviceName string, ip net.IP, endpointPorts []api.EndpointPort, reconcilePorts bool) error
ReconcileEndpoints sets the endpoints for the given apiserver service (ro or rw). ReconcileEndpoints expects that the endpoints objects it manages will all be managed only by ReconcileEndpoints; therefore, to understand this, you need only understand the requirements and the body of this function.
Requirements:
- All apiservers MUST use the same ports for their {rw, ro} services.
- All apiservers MUST use ReconcileEndpoints and only ReconcileEndpoints to manage the endpoints for their {rw, ro} services.
- All apiservers MUST know and agree on the number of apiservers expected to be running (c.masterCount).
- ReconcileEndpoints is called periodically from all apiservers.
func (*Controller) RunKubernetesService ¶
func (c *Controller) RunKubernetesService(ch chan struct{})
RunKubernetesService periodically updates the kubernetes service
func (*Controller) Start ¶
func (c *Controller) Start()
Start begins the core controller loops that must exist for bootstrapping a cluster.
func (*Controller) UpdateKubernetesService ¶
func (c *Controller) UpdateKubernetesService(reconcile bool) error
UpdateKubernetesService attempts to update the default Kube service.
type InstallSSHKey ¶
type Master ¶
type Master struct { *genericapiserver.GenericAPIServer // contains filtered or unexported fields }
Master contains state for a Kubernetes cluster master/api server.
func New ¶
New returns a new instance of Master from the given config. Certain config fields will be set to a default value if unset. Certain config fields must be specified, including:
KubeletClient
func (*Master) HasThirdPartyResource ¶
func (m *Master) HasThirdPartyResource(rsrc *extensions.ThirdPartyResource) (bool, error)
HasThirdPartyResource returns true if a particular third party resource currently installed.
func (*Master) InstallAPIs ¶
func (*Master) InstallThirdPartyResource ¶
func (m *Master) InstallThirdPartyResource(rsrc *extensions.ThirdPartyResource) error
InstallThirdPartyResource installs a third party resource specified by 'rsrc'. When a resource is installed a corresponding RESTful resource is added as a valid path in the web service provided by the master.
For example, if you install a resource ThirdPartyResource{ Name: "foo.company.com", Versions: {"v1"} } then the following RESTful resource is created on the server:
http://<host>/apis/company.com/v1/foos/...
func (*Master) ListThirdPartyResources ¶
ListThirdPartyResources lists all currently installed third party resources
func (*Master) NewBootstrapController ¶
func (m *Master) NewBootstrapController() *Controller
NewBootstrapController returns a controller for watching the core capabilities of the master.
func (*Master) RemoveThirdPartyResource ¶
RemoveThirdPartyResource removes all resources matching `path`. Also deletes any stored data
type SSHTunneler ¶
type SSHTunneler struct { SSHUser string SSHKeyfile string InstallSSHKey InstallSSHKey HealthCheckURL *url.URL // contains filtered or unexported fields }
func (*SSHTunneler) Run ¶
func (c *SSHTunneler) Run(getAddresses AddressFunc)
Run establishes tunnel loops and returns
func (*SSHTunneler) SecondsSinceSync ¶
func (c *SSHTunneler) SecondsSinceSync() int64
type ThirdPartyController ¶
type ThirdPartyController struct {
// contains filtered or unexported fields
}
ThirdPartyController is a control loop that knows how to synchronize ThirdPartyResource objects with RESTful resources which are present in the API server.
func (*ThirdPartyController) SyncOneResource ¶
func (t *ThirdPartyController) SyncOneResource(rsrc *expapi.ThirdPartyResource) error
Synchronize a single resource with RESTful resources on the master
func (*ThirdPartyController) SyncResources ¶
func (t *ThirdPartyController) SyncResources() error
Synchronize all resources with RESTful resources on the master
type Tunneler ¶
type Tunneler interface { Run(AddressFunc) Stop() Dial(net, addr string) (net.Conn, error) SecondsSinceSync() int64 }
func NewSSHTunneler ¶
func NewSSHTunneler(sshUser, sshKeyfile string, healthCheckURL *url.URL, installSSHKey InstallSSHKey) Tunneler