Documentation ¶
Overview ¶
Package master contains code for setting up and running a Kubernetes cluster master.
Index ¶
- Constants
- func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig
- func DefaultServiceIPRange(passedServiceClusterIPRange net.IPNet) (net.IPNet, net.IP, error)
- func NewMasterCountEndpointReconciler(masterCount int, endpointClient coreclient.EndpointsGetter) *masterCountEndpointReconciler
- type ClientCARegistrationHook
- type CompletedConfig
- 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) PostStartHook(hookContext genericapiserver.PostStartHookContext) 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 ExtraConfig
- type Master
- type RESTStorageProvider
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.1
func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig
func DefaultServiceIPRange ¶ added in v1.6.1
DefaultServiceIPRange takes a the serviceIPRange flag and returns the defaulted service ip range (if needed), api server service IP, and an error TODO move this out of the genericapiserver package
func NewMasterCountEndpointReconciler ¶ added in v1.3.1
func NewMasterCountEndpointReconciler(masterCount int, endpointClient coreclient.EndpointsGetter) *masterCountEndpointReconciler
NewMasterCountEndpointReconciler creates a new EndpointReconciler that reconciles based on a specified expected number of masters.
Types ¶
type ClientCARegistrationHook ¶ added in v1.6.1
type ClientCARegistrationHook struct { ClientCA []byte RequestHeaderUsernameHeaders []string RequestHeaderGroupHeaders []string RequestHeaderExtraHeaderPrefixes []string RequestHeaderCA []byte RequestHeaderAllowedNames []string }
func (ClientCARegistrationHook) PostStartHook ¶ added in v1.6.1
func (h ClientCARegistrationHook) PostStartHook(hookContext genericapiserver.PostStartHookContext) error
type CompletedConfig ¶ added in v1.8.1
type CompletedConfig struct {
// contains filtered or unexported fields
}
func (CompletedConfig) New ¶ added in v1.8.1
func (c CompletedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*Master, error)
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:
KubeletClientConfig
func (CompletedConfig) NewBootstrapController ¶ added in v1.8.1
func (c CompletedConfig) NewBootstrapController(legacyRESTStorage corerest.LegacyRESTStorage, serviceClient coreclient.ServicesGetter, nsClient coreclient.NamespacesGetter) *Controller
NewBootstrapController returns a controller for watching the core capabilities of the master
type Config ¶
type Config struct { GenericConfig *genericapiserver.Config ExtraConfig ExtraConfig }
func (*Config) Complete ¶ added in v1.5.0
func (cfg *Config) Complete(informers informers.SharedInformerFactory) CompletedConfig
Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
type Controller ¶ added in v0.17.0
type Controller struct { ServiceClient coreclient.ServicesGetter NamespaceClient coreclient.NamespacesGetter 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 indicates where the kubernetes service will live. It may not be nil. 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", "kube-system" and "kube-public" namespaces, and provide the IP repair check on service IPs
func (*Controller) CreateNamespaceIfNeeded ¶ added in v0.17.0
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.0
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) PostStartHook ¶ added in v1.5.0
func (c *Controller) PostStartHook(hookContext genericapiserver.PostStartHookContext) error
func (*Controller) RunKubernetesNamespaces ¶ added in v1.3.1
func (c *Controller) RunKubernetesNamespaces(ch chan struct{})
RunKubernetesNamespaces periodically makes sure that all internal namespaces exist
func (*Controller) RunKubernetesService ¶ added in v0.17.0
func (c *Controller) RunKubernetesService(ch chan struct{})
RunKubernetesService periodically updates the kubernetes service
func (*Controller) Start ¶ added in v0.17.0
func (c *Controller) Start()
Start begins the core controller loops that must exist for bootstrapping a cluster.
func (*Controller) UpdateKubernetesService ¶ added in v0.17.0
func (c *Controller) UpdateKubernetesService(reconcile bool) error
UpdateKubernetesService attempts to update the default Kube service.
type EndpointReconciler ¶ added in v1.3.1
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.0
type EndpointReconcilerConfig struct { Reconciler EndpointReconciler Interval time.Duration }
EndpointReconcilerConfig holds the endpoint reconciler and endpoint reconciliation interval to be used by the master.
type ExtraConfig ¶ added in v1.8.1
type ExtraConfig struct { ClientCARegistrationHook ClientCARegistrationHook APIResourceConfigSource serverstorage.APIResourceConfigSource StorageFactory serverstorage.StorageFactory EnableCoreControllers bool EndpointReconcilerConfig EndpointReconcilerConfig EventTTL time.Duration KubeletClientConfig kubeletclient.KubeletClientConfig // Used to start and monitor tunneling Tunneler tunneler.Tunneler EnableUISupport bool EnableLogsSupport bool ProxyTransport http.RoundTripper // Values to build the IP addresses used by discovery // The range of IPs to be assigned to services with type=ClusterIP or greater ServiceIPRange net.IPNet // The IP address for the GenericAPIServer service (must be inside ServiceIPRange) APIServerServiceIP net.IP // Port for the apiserver service. APIServerServicePort int // The range of ports to be assigned to services with type=NodePort or greater ServiceNodePortRange utilnet.PortRange // Additional ports to be exposed on the GenericAPIServer service // extraServicePorts is injectable in the event that more ports // (other than the default 443/tcp) are exposed on the GenericAPIServer // and those ports need to be load balanced by the GenericAPIServer // service because this pkg is linked by out-of-tree projects // like openshift which want to use the GenericAPIServer but also do // more stuff. ExtraServicePorts []api.ServicePort // Additional ports to be exposed on the GenericAPIServer endpoints // Port names should align with ports defined in ExtraServicePorts ExtraEndpointPorts []api.EndpointPort // If non-zero, the "kubernetes" services uses this port as NodePort. KubernetesServiceNodePort int // Number of masters running; all masters must be started with the // same value for this field. (Numbers > 1 currently untested.) MasterCount int }
type Master ¶
type Master struct { GenericAPIServer *genericapiserver.GenericAPIServer ClientCARegistrationHook ClientCARegistrationHook }
Master contains state for a Kubernetes cluster master/api server.
func (*Master) InstallAPIs ¶ added in v1.2.0
func (m *Master) InstallAPIs(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter, restStorageProviders ...RESTStorageProvider)
InstallAPIs will install the APIs for the restStorageProviders if they are enabled.
func (*Master) InstallLegacyAPI ¶ added in v1.5.0
func (m *Master) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.RESTOptionsGetter, legacyRESTStorageProvider corerest.LegacyRESTStorageProvider)
type RESTStorageProvider ¶ added in v1.4.0
type RESTStorageProvider interface { GroupName() string NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool) }
RESTStorageProvider is a factory type for REST storage.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
controller
|
|
Package ports defines ports used by various pieces of the kubernetes infrastructure.
|
Package ports defines ports used by various pieces of the kubernetes infrastructure. |