mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Apiserver cleanups
- remove unused genericapiserver Config.MasterServiceNamespace - move init code into ApplyOptions - initialize genericapiserver Config.MaxRequestsInFlight - move ServiceReadWritePort to master
This commit is contained in:
parent
e4b41dd292
commit
d6dc0e561f
@ -299,12 +299,9 @@ func Run(s *options.APIServer) error {
|
|||||||
genericConfig.Version = &kubeVersion
|
genericConfig.Version = &kubeVersion
|
||||||
genericConfig.LoopbackClientConfig = selfClientConfig
|
genericConfig.LoopbackClientConfig = selfClientConfig
|
||||||
genericConfig.Authenticator = apiAuthenticator
|
genericConfig.Authenticator = apiAuthenticator
|
||||||
genericConfig.SupportsBasicAuth = len(s.BasicAuthFile) > 0
|
|
||||||
genericConfig.Authorizer = apiAuthorizer
|
genericConfig.Authorizer = apiAuthorizer
|
||||||
genericConfig.AuthorizerRBACSuperUser = s.AuthorizationRBACSuperUser
|
|
||||||
genericConfig.AdmissionControl = admissionController
|
genericConfig.AdmissionControl = admissionController
|
||||||
genericConfig.APIResourceConfigSource = storageFactory.APIResourceConfigSource
|
genericConfig.APIResourceConfigSource = storageFactory.APIResourceConfigSource
|
||||||
genericConfig.MasterServiceNamespace = s.MasterServiceNamespace
|
|
||||||
genericConfig.OpenAPIConfig.Info.Title = "Kubernetes"
|
genericConfig.OpenAPIConfig.Info.Title = "Kubernetes"
|
||||||
genericConfig.OpenAPIConfig.Definitions = generatedopenapi.OpenAPIDefinitions
|
genericConfig.OpenAPIConfig.Definitions = generatedopenapi.OpenAPIDefinitions
|
||||||
genericConfig.EnableOpenAPISupport = true
|
genericConfig.EnableOpenAPISupport = true
|
||||||
|
@ -189,12 +189,9 @@ func Run(s *options.ServerRunOptions) error {
|
|||||||
genericConfig.Version = &kubeVersion
|
genericConfig.Version = &kubeVersion
|
||||||
genericConfig.LoopbackClientConfig = selfClientConfig
|
genericConfig.LoopbackClientConfig = selfClientConfig
|
||||||
genericConfig.Authenticator = apiAuthenticator
|
genericConfig.Authenticator = apiAuthenticator
|
||||||
genericConfig.SupportsBasicAuth = len(s.BasicAuthFile) > 0
|
|
||||||
genericConfig.Authorizer = apiAuthorizer
|
genericConfig.Authorizer = apiAuthorizer
|
||||||
genericConfig.AuthorizerRBACSuperUser = s.AuthorizationRBACSuperUser
|
|
||||||
genericConfig.AdmissionControl = admissionController
|
genericConfig.AdmissionControl = admissionController
|
||||||
genericConfig.APIResourceConfigSource = storageFactory.APIResourceConfigSource
|
genericConfig.APIResourceConfigSource = storageFactory.APIResourceConfigSource
|
||||||
genericConfig.MasterServiceNamespace = s.MasterServiceNamespace
|
|
||||||
genericConfig.OpenAPIConfig.Definitions = openapi.OpenAPIDefinitions
|
genericConfig.OpenAPIConfig.Definitions = openapi.OpenAPIDefinitions
|
||||||
genericConfig.EnableOpenAPISupport = true
|
genericConfig.EnableOpenAPISupport = true
|
||||||
genericConfig.OpenAPIConfig.SecurityDefinitions = securityDefinitions
|
genericConfig.OpenAPIConfig.SecurityDefinitions = securityDefinitions
|
||||||
|
@ -84,14 +84,12 @@ type Config struct {
|
|||||||
EnableGarbageCollection bool
|
EnableGarbageCollection bool
|
||||||
|
|
||||||
Version *version.Info
|
Version *version.Info
|
||||||
APIGroupPrefix string
|
|
||||||
CorsAllowedOriginList []string
|
CorsAllowedOriginList []string
|
||||||
Authenticator authenticator.Request
|
Authenticator authenticator.Request
|
||||||
// TODO(roberthbailey): Remove once the server no longer supports http basic auth.
|
// TODO(roberthbailey): Remove once the server no longer supports http basic auth.
|
||||||
SupportsBasicAuth bool
|
SupportsBasicAuth bool
|
||||||
Authorizer authorizer.Authorizer
|
Authorizer authorizer.Authorizer
|
||||||
AdmissionControl admission.Interface
|
AdmissionControl admission.Interface
|
||||||
MasterServiceNamespace string
|
|
||||||
// TODO(ericchiang): Determine if policy escalation checks should be an admission controller.
|
// TODO(ericchiang): Determine if policy escalation checks should be an admission controller.
|
||||||
AuthorizerRBACSuperUser string
|
AuthorizerRBACSuperUser string
|
||||||
|
|
||||||
@ -275,6 +273,7 @@ func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config {
|
|||||||
c.InsecureServingInfo = insecureServingInfo
|
c.InsecureServingInfo = insecureServingInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.AuthorizerRBACSuperUser = options.AuthorizationRBACSuperUser
|
||||||
c.CorsAllowedOriginList = options.CorsAllowedOriginList
|
c.CorsAllowedOriginList = options.CorsAllowedOriginList
|
||||||
c.EnableGarbageCollection = options.EnableGarbageCollection
|
c.EnableGarbageCollection = options.EnableGarbageCollection
|
||||||
c.EnableProfiling = options.EnableProfiling
|
c.EnableProfiling = options.EnableProfiling
|
||||||
@ -282,11 +281,12 @@ func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config {
|
|||||||
c.ExternalHost = options.ExternalHost
|
c.ExternalHost = options.ExternalHost
|
||||||
c.KubernetesServiceNodePort = options.KubernetesServiceNodePort
|
c.KubernetesServiceNodePort = options.KubernetesServiceNodePort
|
||||||
c.MasterCount = options.MasterCount
|
c.MasterCount = options.MasterCount
|
||||||
|
c.MaxRequestsInFlight = options.MaxRequestsInFlight
|
||||||
c.MinRequestTimeout = options.MinRequestTimeout
|
c.MinRequestTimeout = options.MinRequestTimeout
|
||||||
c.PublicAddress = options.AdvertiseAddress
|
c.PublicAddress = options.AdvertiseAddress
|
||||||
c.ServiceClusterIPRange = &options.ServiceClusterIPRange
|
c.ServiceClusterIPRange = &options.ServiceClusterIPRange
|
||||||
c.ServiceNodePortRange = options.ServiceNodePortRange
|
c.ServiceNodePortRange = options.ServiceNodePortRange
|
||||||
c.MaxRequestsInFlight = options.MaxRequestsInFlight
|
c.SupportsBasicAuth = len(options.BasicAuthFile) > 0
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
|
|||||||
"The number of apiservers running in the cluster.")
|
"The number of apiservers running in the cluster.")
|
||||||
|
|
||||||
fs.StringVar(&s.MasterServiceNamespace, "master-service-namespace", s.MasterServiceNamespace, ""+
|
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, ""+
|
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, "+
|
"The maximum number of requests in flight at a given time. When the server exceeds this, "+
|
||||||
|
Loading…
Reference in New Issue
Block a user