Apiserver cleanups

- remove unused genericapiserver Config.MasterServiceNamespace
- move init code into ApplyOptions
- initialize genericapiserver Config.MaxRequestsInFlight
- move ServiceReadWritePort to master
pull/6/head
Dr. Stefan Schimanski 2016-10-25 08:08:01 +02:00
parent e4b41dd292
commit d6dc0e561f
4 changed files with 7 additions and 13 deletions

View File

@ -299,12 +299,9 @@ func Run(s *options.APIServer) error {
genericConfig.Version = &kubeVersion
genericConfig.LoopbackClientConfig = selfClientConfig
genericConfig.Authenticator = apiAuthenticator
genericConfig.SupportsBasicAuth = len(s.BasicAuthFile) > 0
genericConfig.Authorizer = apiAuthorizer
genericConfig.AuthorizerRBACSuperUser = s.AuthorizationRBACSuperUser
genericConfig.AdmissionControl = admissionController
genericConfig.APIResourceConfigSource = storageFactory.APIResourceConfigSource
genericConfig.MasterServiceNamespace = s.MasterServiceNamespace
genericConfig.OpenAPIConfig.Info.Title = "Kubernetes"
genericConfig.OpenAPIConfig.Definitions = generatedopenapi.OpenAPIDefinitions
genericConfig.EnableOpenAPISupport = true

View File

@ -189,12 +189,9 @@ func Run(s *options.ServerRunOptions) error {
genericConfig.Version = &kubeVersion
genericConfig.LoopbackClientConfig = selfClientConfig
genericConfig.Authenticator = apiAuthenticator
genericConfig.SupportsBasicAuth = len(s.BasicAuthFile) > 0
genericConfig.Authorizer = apiAuthorizer
genericConfig.AuthorizerRBACSuperUser = s.AuthorizationRBACSuperUser
genericConfig.AdmissionControl = admissionController
genericConfig.APIResourceConfigSource = storageFactory.APIResourceConfigSource
genericConfig.MasterServiceNamespace = s.MasterServiceNamespace
genericConfig.OpenAPIConfig.Definitions = openapi.OpenAPIDefinitions
genericConfig.EnableOpenAPISupport = true
genericConfig.OpenAPIConfig.SecurityDefinitions = securityDefinitions

View File

@ -84,14 +84,12 @@ type Config struct {
EnableGarbageCollection bool
Version *version.Info
APIGroupPrefix string
CorsAllowedOriginList []string
Authenticator authenticator.Request
// TODO(roberthbailey): Remove once the server no longer supports http basic auth.
SupportsBasicAuth bool
Authorizer authorizer.Authorizer
AdmissionControl admission.Interface
MasterServiceNamespace string
SupportsBasicAuth bool
Authorizer authorizer.Authorizer
AdmissionControl admission.Interface
// TODO(ericchiang): Determine if policy escalation checks should be an admission controller.
AuthorizerRBACSuperUser string
@ -275,6 +273,7 @@ func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config {
c.InsecureServingInfo = insecureServingInfo
}
c.AuthorizerRBACSuperUser = options.AuthorizationRBACSuperUser
c.CorsAllowedOriginList = options.CorsAllowedOriginList
c.EnableGarbageCollection = options.EnableGarbageCollection
c.EnableProfiling = options.EnableProfiling
@ -282,11 +281,12 @@ func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config {
c.ExternalHost = options.ExternalHost
c.KubernetesServiceNodePort = options.KubernetesServiceNodePort
c.MasterCount = options.MasterCount
c.MaxRequestsInFlight = options.MaxRequestsInFlight
c.MinRequestTimeout = options.MinRequestTimeout
c.PublicAddress = options.AdvertiseAddress
c.ServiceClusterIPRange = &options.ServiceClusterIPRange
c.ServiceNodePortRange = options.ServiceNodePortRange
c.MaxRequestsInFlight = options.MaxRequestsInFlight
c.SupportsBasicAuth = len(options.BasicAuthFile) > 0
return c
}

View File

@ -393,7 +393,7 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
"The number of apiservers running in the cluster.")
fs.StringVar(&s.MasterServiceNamespace, "master-service-namespace", s.MasterServiceNamespace, ""+
"The namespace from which the kubernetes master services should be injected into pods.")
"DEPRECATED: the namespace from which the kubernetes master services should be injected into pods.")
fs.IntVar(&s.MaxRequestsInFlight, "max-requests-inflight", s.MaxRequestsInFlight, ""+
"The maximum number of requests in flight at a given time. When the server exceeds this, "+