Documentation ¶
Overview ¶
Package app does all of the work necessary to create a Kubernetes APIServer by binding together the API, master and APIServer infrastructure. It can be configured and called directly or via the hyperkube framework.
Package app does all of the work necessary to create a Kubernetes APIServer by binding together the API, master and APIServer infrastructure. It can be configured and called directly or via the hyperkube framework.
Index ¶
- Variables
- func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error)
- func CreateKubeAPIServerConfig(s completedServerRunOptions) (*master.Config, *genericapiserver.DeprecatedInsecureServingInfo, ...)
- func CreateKubeZooServer(kubeAPIServerConfig *master.Config, ...) (*master.Instance, error)
- func CreateServerChain(completedOptions completedServerRunOptions, stopCh <-chan struct{}) (*master.Instance, error)
- func InstallLegacyAPI(m *master.Instance, ...) error
- func NewAPIServerCommand() *cobra.Command
- func NewBuildHandlerChanFunc(discoveryProxy proxy.DiscoveryProxy) func(apiHandler http.Handler, c *server.Config) (secure http.Handler)
- func NewCustomResourceDefinitionHandler(crdInformer informers.CustomResourceDefinitionInformer, delegate http.Handler, ...) (*crdHandler, error)
- func Run(completeOptions completedServerRunOptions, stopCh <-chan struct{}) error
- type CRDRESTOptionsGetter
- type ControlPlaneConfig
- type ProxyConfig
- type UnstructuredObjectTyper
Constants ¶
This section is empty.
Variables ¶
var ( Scheme = runtime.NewScheme() Codecs = serializer.NewCodecFactory(Scheme) )
var CommonNameUserConversion = x509.UserConversionFunc(func(chain []*stdx509.Certificate) (*authenticator.Response, bool, error) { if len(chain[0].Subject.CommonName) == 0 { return nil, false, nil } OrganizationalUnit := chain[0].Subject.OrganizationalUnit CommonName := chain[0].Subject.CommonName u := user.DefaultInfo{ Name: CommonName, Groups: chain[0].Subject.Organization, } tenantIDLength := 6 if len(OrganizationalUnit) > 0 { if len(OrganizationalUnit[0]) == tenantIDLength && len(CommonName) > tenantIDLength { if OrganizationalUnit[0] == CommonName[:tenantIDLength] && CommonName[tenantIDLength] == '-' { tenantName := OrganizationalUnit[0] u.Extra = map[string][]string{"tenant": {tenantName}} } } } return &authenticator.Response{ User: &u, }, true, nil })
Functions ¶
func Complete ¶
func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error)
Complete set default ServerRunOptions. Should be called after kube-apiserver flags parsed.
func CreateKubeAPIServerConfig ¶
func CreateKubeAPIServerConfig( s completedServerRunOptions, ) ( *master.Config, *genericapiserver.DeprecatedInsecureServingInfo, aggregatorapiserver.ServiceResolver, *ProxyConfig, *ControlPlaneConfig, error, )
CreateKubeAPIServerConfig creates all the resources for running the API server, but runs none of them
func CreateKubeZooServer ¶
func CreateKubeZooServer(kubeAPIServerConfig *master.Config, delegateAPIServer genericapiserver.DelegationTarget, proxyConfig *ProxyConfig, controlPlaneConfig *ControlPlaneConfig) (*master.Instance, error)
CreateKubeZooServer creates and wires a workable kube-zoo-apiserver
func CreateServerChain ¶
func CreateServerChain(completedOptions completedServerRunOptions, stopCh <-chan struct{}) (*master.Instance, error)
CreateServerChain creates the apiservers connected via delegation.
func InstallLegacyAPI ¶
func InstallLegacyAPI(m *master.Instance, apiResourceConfigSource serverstorage.APIResourceConfigSource, c *master.CompletedConfig, restOptionsGetter generic.RESTOptionsGetter, legacyConfig common.APIGroupConfig) error
InstallLegacyAPI will install the legacy APIs if they are enabled.
func NewAPIServerCommand ¶
NewAPIServerCommand creates a *cobra.Command object with default parameters
func NewBuildHandlerChanFunc ¶
func NewCustomResourceDefinitionHandler ¶
func NewCustomResourceDefinitionHandler( crdInformer informers.CustomResourceDefinitionInformer, delegate http.Handler, restOptionsGetter generic.RESTOptionsGetter, admission admission.Interface, serviceResolver webhook.ServiceResolver, authResolverWrapper webhook.AuthenticationInfoResolverWrapper, masterCount int, authorizer authorizer.Authorizer, requestTimeout time.Duration, minRequestTimeout time.Duration, staticOpenAPISpec *spec.Swagger, maxRequestBodyBytes int64, upstreamConfig *ProxyConfig) (*crdHandler, error)
Types ¶
type CRDRESTOptionsGetter ¶
type CRDRESTOptionsGetter struct { StorageConfig storagebackend.Config StoragePrefix string EnableWatchCache bool DefaultWatchCacheSize int EnableGarbageCollection bool DeleteCollectionWorkers int CountMetricPollPeriod time.Duration }
func (CRDRESTOptionsGetter) GetRESTOptions ¶
func (t CRDRESTOptionsGetter) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error)
type ControlPlaneConfig ¶
type ControlPlaneConfig struct {
// contains filtered or unexported fields
}
type ProxyConfig ¶
type ProxyConfig struct {
// contains filtered or unexported fields
}
func (*ProxyConfig) ApplyToGroup ¶
func (c *ProxyConfig) ApplyToGroup(group *common.APIGroupConfig)
func (*ProxyConfig) ApplyToStorage ¶
func (c *ProxyConfig) ApplyToStorage(config *common.StorageConfig)
type UnstructuredObjectTyper ¶
type UnstructuredObjectTyper struct { Delegate runtime.ObjectTyper UnstructuredTyper runtime.ObjectTyper }
func (UnstructuredObjectTyper) ObjectKinds ¶
func (t UnstructuredObjectTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error)
func (UnstructuredObjectTyper) Recognizes ¶
func (t UnstructuredObjectTyper) Recognizes(gvk schema.GroupVersionKind) bool