Documentation ¶
Overview ¶
Package master contains code for setting up and running a Kubernetes cluster master.
Index ¶
- Constants
- func DefaultAPIResourceConfigSource() *genericapiserver.ResourceConfig
- func MetricsWithReset(w http.ResponseWriter, req *http.Request)
- func NewMasterCountEndpointReconciler(masterCount int, endpointRegistry endpoint.Registry) *masterCountEndpointReconciler
- type AppsRESTStorageProvider
- type AuthenticationRESTStorageProvider
- type AuthorizationRESTStorageProvider
- type AutoscalingRESTStorageProvider
- type BatchRESTStorageProvider
- type CertificatesRESTStorageProvider
- 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) RunKubernetesNamespaces(ch chan struct{})
- func (c *Controller) RunKubernetesService(ch chan struct{})
- func (c *Controller) Start()
- func (c *Controller) UpdateKubernetesService(reconcile bool) error
- type EndpointReconciler
- type EndpointReconcilerConfig
- type ExtensionsRESTStorageProvider
- type Master
- func (m *Master) GetRESTOptionsOrDie(c *Config, resource unversioned.GroupResource) generic.RESTOptions
- 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(endpointReconcilerConfig EndpointReconcilerConfig) *Controller
- func (m *Master) RemoveThirdPartyResource(path string) error
- type PolicyRESTStorageProvider
- type RBACRESTStorageProvider
- type RESTOptionsGetter
- type RESTStorageProvider
- type StorageRESTStorageProvider
- type ThirdPartyController
Constants ¶
const ( // DefaultEndpointReconcilerInterval is the default amount of time for how often the endpoints for // the kubernetes Service are reconciled. DefaultEndpointReconcilerInterval = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func DefaultAPIResourceConfigSource ¶ added in v1.3.0
func DefaultAPIResourceConfigSource() *genericapiserver.ResourceConfig
func MetricsWithReset ¶ added in v1.3.0
func MetricsWithReset(w http.ResponseWriter, req *http.Request)
MetricsWithReset is a handler that resets metrics when DELETE is passed to the endpoint.
func NewMasterCountEndpointReconciler ¶ added in v1.3.0
func NewMasterCountEndpointReconciler(masterCount int, endpointRegistry endpoint.Registry) *masterCountEndpointReconciler
NewMasterCountEndpointReconciler creates a new EndpointReconciler that reconciles based on a specified expected number of masters.
Types ¶
type AppsRESTStorageProvider ¶ added in v1.4.2
type AppsRESTStorageProvider struct{}
func (AppsRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p AppsRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type AuthenticationRESTStorageProvider ¶ added in v1.4.2
type AuthenticationRESTStorageProvider struct {
Authenticator authenticator.Request
}
func (AuthenticationRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p AuthenticationRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type AuthorizationRESTStorageProvider ¶ added in v1.4.2
type AuthorizationRESTStorageProvider struct {
Authorizer authorizer.Authorizer
}
func (AuthorizationRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p AuthorizationRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type AutoscalingRESTStorageProvider ¶ added in v1.4.2
type AutoscalingRESTStorageProvider struct{}
func (AutoscalingRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p AutoscalingRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type BatchRESTStorageProvider ¶ added in v1.4.2
type BatchRESTStorageProvider struct{}
func (BatchRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p BatchRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type CertificatesRESTStorageProvider ¶ added in v1.4.2
type CertificatesRESTStorageProvider struct{}
func (CertificatesRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p CertificatesRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type Config ¶
type Config struct { *genericapiserver.Config EnableCoreControllers bool EndpointReconcilerConfig EndpointReconcilerConfig DeleteCollectionWorkers int EventTTL time.Duration KubeletClient kubeletclient.KubeletClient // RESTStorageProviders provides RESTStorage building methods keyed by groupName RESTStorageProviders map[string]RESTStorageProvider // Used to start and monitor tunneling Tunneler genericapiserver.Tunneler // contains filtered or unexported fields }
type Controller ¶ added in v0.18.2
type Controller struct { NamespaceRegistry namespace.Registry ServiceRegistry service.Registry ServiceClusterIPRegistry rangeallocation.RangeRegistry ServiceClusterIPInterval time.Duration ServiceClusterIPRange *net.IPNet ServiceNodePortRegistry rangeallocation.RangeRegistry ServiceNodePortInterval time.Duration ServiceNodePortRange utilnet.PortRange EndpointReconciler EndpointReconciler EndpointInterval time.Duration SystemNamespaces []string SystemNamespacesInterval 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" and "kube-system" namespace, and provide the IP repair check on service IPs
func (*Controller) CreateNamespaceIfNeeded ¶ added in v0.18.2
func (c *Controller) CreateNamespaceIfNeeded(ns string) error
CreateNamespaceIfNeeded will create a namespace if it doesn't already exist
func (*Controller) CreateOrUpdateMasterServiceIfNeeded ¶ added in v1.2.3
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) RunKubernetesNamespaces ¶ added in v1.3.0
func (c *Controller) RunKubernetesNamespaces(ch chan struct{})
RunKubernetesNamespaces periodically makes sure that all internal namespaces exist
func (*Controller) RunKubernetesService ¶ added in v0.18.2
func (c *Controller) RunKubernetesService(ch chan struct{})
RunKubernetesService periodically updates the kubernetes service
func (*Controller) Start ¶ added in v0.18.2
func (c *Controller) Start()
Start begins the core controller loops that must exist for bootstrapping a cluster.
func (*Controller) UpdateKubernetesService ¶ added in v0.18.2
func (c *Controller) UpdateKubernetesService(reconcile bool) error
UpdateKubernetesService attempts to update the default Kube service.
type EndpointReconciler ¶ added in v1.3.0
type EndpointReconciler interface { // 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. // // 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. // * ReconcileEndpoints is called periodically from all apiservers. ReconcileEndpoints(serviceName string, ip net.IP, endpointPorts []api.EndpointPort, reconcilePorts bool) error }
EndpointReconciler knows how to reconcile the endpoints for the apiserver service.
type EndpointReconcilerConfig ¶ added in v1.4.2
type EndpointReconcilerConfig struct { Reconciler EndpointReconciler Interval time.Duration }
EndpointReconcilerConfig holds the endpoint reconciler and endpoint reconciliation interval to be used by the master.
type ExtensionsRESTStorageProvider ¶ added in v1.4.2
type ExtensionsRESTStorageProvider struct { ResourceInterface resourceInterface DisableThirdPartyControllerForTesting bool }
func (ExtensionsRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p ExtensionsRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
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) GetRESTOptionsOrDie ¶ added in v1.3.0
func (m *Master) GetRESTOptionsOrDie(c *Config, resource unversioned.GroupResource) generic.RESTOptions
func (*Master) HasThirdPartyResource ¶ added in v1.2.3
func (m *Master) HasThirdPartyResource(rsrc *extensions.ThirdPartyResource) (bool, error)
HasThirdPartyResource returns true if a particular third party resource currently installed.
func (*Master) InstallAPIs ¶ added in v1.2.3
func (*Master) InstallThirdPartyResource ¶ added in v1.2.3
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) IsTunnelSyncHealthy ¶ added in v1.0.2
func (*Master) ListThirdPartyResources ¶ added in v1.2.3
ListThirdPartyResources lists all currently installed third party resources The format is <path>/<resource-plural-name>
func (*Master) NewBootstrapController ¶ added in v0.18.2
func (m *Master) NewBootstrapController(endpointReconcilerConfig EndpointReconcilerConfig) *Controller
NewBootstrapController returns a controller for watching the core capabilities of the master. If endpointReconcilerConfig.Interval is 0, the default value of DefaultEndpointReconcilerInterval will be used instead. If endpointReconcilerConfig.Reconciler is nil, the default MasterCountEndpointReconciler will be used.
func (*Master) RemoveThirdPartyResource ¶ added in v1.2.3
RemoveThirdPartyResource removes all resources matching `path`. Also deletes any stored data
type PolicyRESTStorageProvider ¶ added in v1.4.2
type PolicyRESTStorageProvider struct{}
func (PolicyRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p PolicyRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type RBACRESTStorageProvider ¶ added in v1.4.2
type RBACRESTStorageProvider struct {
AuthorizerRBACSuperUser string
}
func (RBACRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p RBACRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type RESTOptionsGetter ¶ added in v1.4.2
type RESTOptionsGetter func(resource unversioned.GroupResource) generic.RESTOptions
type RESTStorageProvider ¶ added in v1.4.2
type RESTStorageProvider interface {
NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
}
type StorageRESTStorageProvider ¶ added in v1.4.2
type StorageRESTStorageProvider struct { }
func (StorageRESTStorageProvider) NewRESTStorage ¶ added in v1.4.2
func (p StorageRESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool)
type ThirdPartyController ¶ added in v1.2.3
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 ¶ added in v1.2.3
func (t *ThirdPartyController) SyncOneResource(rsrc *expapi.ThirdPartyResource) error
Synchronize a single resource with RESTful resources on the master
func (*ThirdPartyController) SyncResources ¶ added in v1.2.3
func (t *ThirdPartyController) SyncResources() error
Synchronize all resources with RESTful resources on the master