apiserver

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 68 Imported by: 189

Documentation

Index

Constants

View Source
const (

	// StorageVersionPostStartHookName is the name of the storage version updater post start hook.
	StorageVersionPostStartHookName = "built-in-resources-storage-version-updater"
)

Variables

View Source
var APIRegistrationGroupPriority int = 20001

Maximum is 20000. Set to higher than that so apiregistration always is listed first (mirrors v1 discovery behavior)

View Source
var APIRegistrationGroupVersion metav1.GroupVersion = metav1.GroupVersion{Group: "apiregistration.k8s.io", Version: "v1"}

Functions

func DefaultAPIResourceConfigSource

func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig

DefaultAPIResourceConfigSource returns default configuration for an APIResource.

Types

type APIAggregator

type APIAggregator struct {
	GenericAPIServer *genericapiserver.GenericAPIServer

	// provided for easier embedding
	APIRegistrationInformers informers.SharedInformerFactory
	// contains filtered or unexported fields
}

APIAggregator contains state for a Kubernetes cluster master/api server.

func (*APIAggregator) AddAPIService

func (s *APIAggregator) AddAPIService(apiService *v1.APIService) error

AddAPIService adds an API service. It is not thread-safe, so only call it on one thread at a time please. It's a slow moving API, so its ok to run the controller on a single thread

func (*APIAggregator) PrepareRun added in v0.16.4

func (s *APIAggregator) PrepareRun() (preparedAPIAggregator, error)

PrepareRun prepares the aggregator to run, by setting up the OpenAPI spec & aggregated discovery document and calling the generic PrepareRun.

func (*APIAggregator) RemoveAPIService

func (s *APIAggregator) RemoveAPIService(apiServiceName string)

RemoveAPIService removes the APIService from being handled. It is not thread-safe, so only call it on one thread at a time please. It's a slow moving API, so it's ok to run the controller on a single thread.

type APIHandlerManager

type APIHandlerManager interface {
	AddAPIService(apiService *v1.APIService) error
	RemoveAPIService(apiServiceName string)
}

APIHandlerManager defines the behaviour that an API handler should have.

type APIServiceRegistrationController

type APIServiceRegistrationController struct {
	// contains filtered or unexported fields
}

APIServiceRegistrationController is responsible for registering and removing API services.

func NewAPIServiceRegistrationController

func NewAPIServiceRegistrationController(apiServiceInformer informers.APIServiceInformer, apiHandlerManager APIHandlerManager) *APIServiceRegistrationController

NewAPIServiceRegistrationController returns a new APIServiceRegistrationController.

func (*APIServiceRegistrationController) Enqueue added in v0.19.0

func (c *APIServiceRegistrationController) Enqueue()

Enqueue queues all apiservices to be rehandled. This method is used by the controller to notify when the proxy cert content changes.

func (*APIServiceRegistrationController) Run

func (c *APIServiceRegistrationController) Run(stopCh <-chan struct{}, handlerSyncedCh chan<- struct{})

Run starts APIServiceRegistrationController which will process all registration requests until stopCh is closed.

type CompletedConfig

type CompletedConfig struct {
	// contains filtered or unexported fields
}

CompletedConfig same as Config, just to swap private object.

func (CompletedConfig) NewWithDelegate

func (c CompletedConfig) NewWithDelegate(delegationTarget genericapiserver.DelegationTarget) (*APIAggregator, error)

NewWithDelegate returns a new instance of APIAggregator from the given config.

type Config

type Config struct {
	GenericConfig *genericapiserver.RecommendedConfig
	ExtraConfig   ExtraConfig
}

Config represents the configuration needed to create an APIAggregator.

func (*Config) Complete

func (cfg *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.

type DiscoveryAggregationController added in v0.26.0

type DiscoveryAggregationController interface {
	// Adds or Updates an APIService from the Aggregated Discovery Controller's
	// knowledge base
	// Thread-safe
	AddAPIService(apiService *apiregistrationv1.APIService, handler http.Handler)

	// Removes an APIService from the Aggregated Discovery Controller's Knowledge
	// bank
	// Thread-safe
	RemoveAPIService(apiServiceName string)

	// Spawns a worker which waits for added/updated apiservices and updates
	// the unified discovery document by contacting the aggregated api services
	Run(stopCh <-chan struct{}, discoverySyncedCh chan<- struct{})
}

func NewDiscoveryManager added in v0.26.0

type ExtraConfig

type ExtraConfig struct {
	// PeerAdvertiseAddress is the IP for this kube-apiserver which is used by peer apiservers to route a request
	// to this apiserver. This happens in cases where the peer is not able to serve the request due to
	// version skew. If unset, AdvertiseAddress/BindAddress will be used.
	PeerAdvertiseAddress peerreconcilers.PeerAdvertiseAddress

	// ProxyClientCert/Key are the client cert used to identify this proxy. Backing APIServices use
	// this to confirm the proxy's identity
	ProxyClientCertFile string
	ProxyClientKeyFile  string

	// If present, the Dial method will be used for dialing out to delegate
	// apiservers.
	ProxyTransport *http.Transport

	// Mechanism by which the Aggregator will resolve services. Required.
	ServiceResolver ServiceResolver

	RejectForwardingRedirects bool

	// DisableRemoteAvailableConditionController disables the controller that updates the Available conditions for
	// remote APIServices via querying endpoints of the referenced services. In generic controlplane use-cases,
	// the concept of services and endpoints might differ, and might require another implementation of this
	// controller. Local APIService are reconciled nevertheless.
	DisableRemoteAvailableConditionController bool
}

ExtraConfig represents APIServices-specific configuration

type ServiceResolver

type ServiceResolver interface {
	ResolveEndpoint(namespace, name string, port int32) (*url.URL, error)
}

A ServiceResolver knows how to get a URL given a service.

func NewClusterIPServiceResolver

func NewClusterIPServiceResolver(services listersv1.ServiceLister) ServiceResolver

NewClusterIPServiceResolver returns a ServiceResolver that directly calls the service's cluster IP.

func NewEndpointServiceResolver

func NewEndpointServiceResolver(services listersv1.ServiceLister, endpoints listersv1.EndpointsLister) ServiceResolver

NewEndpointServiceResolver returns a ServiceResolver that chooses one of the service's endpoints.

func NewLoopbackServiceResolver

func NewLoopbackServiceResolver(delegate ServiceResolver, host *url.URL) ServiceResolver

NewLoopbackServiceResolver returns a ServiceResolver that routes the kubernetes/default service with port 443 to loopback.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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