app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 173 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

func NewAPIServerCommand() *cobra.Command

NewAPIServerCommand creates a *cobra.Command object with default parameters

func NewBuildHandlerChanFunc

func NewBuildHandlerChanFunc(discoveryProxy proxy.DiscoveryProxy) func(apiHandler http.Handler, c *server.Config) (secure http.Handler)

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)

func Run

func Run(completeOptions completedServerRunOptions, stopCh <-chan struct{}) error

Run runs the specified APIServer. This should never exit.

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 (UnstructuredObjectTyper) Recognizes

Directories

Path Synopsis
Package options contains flags and options for initializing an apiserver
Package options contains flags and options for initializing an apiserver

Jump to

Keyboard shortcuts

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