Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
05b1074d
Commit
05b1074d
authored
Dec 05, 2016
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-organize and document genericapiserver config
parent
2c63b6f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
55 deletions
+62
-55
config.go
pkg/genericapiserver/config.go
+62
-55
No files found.
pkg/genericapiserver/config.go
View file @
05b1074d
...
@@ -74,87 +74,94 @@ const (
...
@@ -74,87 +74,94 @@ const (
)
)
// Config is a structure used to configure a GenericAPIServer.
// Config is a structure used to configure a GenericAPIServer.
// It's members are sorted rougly in order of importance for composers.
type
Config
struct
{
type
Config
struct
{
// Destination for audit logs
// SecureServingInfo is required to serve https
AuditWriter
io
.
Writer
SecureServingInfo
*
SecureServingInfo
// Allow downstream consumers to disable swagger.
// This includes returning the generated swagger spec at /swaggerapi and swagger ui at /swagger-ui.
// LoopbackClientConfig is a config for a privileged loopback connection to the API server
// This is required for proper functioning of the PostStartHooks on a GenericAPIServer
LoopbackClientConfig
*
restclient
.
Config
// Authenticator determines which subject is making the request
Authenticator
authenticator
.
Request
// Authorizer determines whether the subject is allowed to make the request based only
// on the RequestURI
Authorizer
authorizer
.
Authorizer
// AdmissionControl performs deep inspection of a given request (including content)
// to set values and determine whether its allowed
AdmissionControl
admission
.
Interface
CorsAllowedOriginList
[]
string
EnableSwaggerSupport
bool
EnableSwaggerSupport
bool
// Allow downstream consumers to disable swagger ui.
EnableSwaggerUI
bool
// Note that this is ignored if EnableSwaggerSupport is false
EnableIndex
bool
EnableSwaggerUI
bool
EnableProfiling
bool
// Allows api group versions or specific resources to be conditionally enabled/disabled.
APIResourceConfigSource
APIResourceConfigSource
// allow downstream consumers to disable the index route
EnableIndex
bool
EnableProfiling
bool
// Requires generic profiling enabled
// Requires generic profiling enabled
EnableContentionProfiling
bool
EnableContentionProfiling
bool
EnableMetrics
bool
EnableGarbageCollection
bool
EnableGarbageCollection
bool
EnableMetrics
bool
EnableOpenAPISupport
bool
Version
*
version
.
Info
// Version will enable the /version endpoint if non-nil
CorsAllowedOriginList
[]
string
Version
*
version
.
Info
Authenticator
authenticator
.
Request
// AuditWriter is the destination for audit logs. If nil, they will not be written.
AuditWriter
io
.
Writer
// SupportsBasicAuth indicates that's at least one Authenticator supports basic auth
// If this is true, a basic auth challenge is returned on authentication failure
// 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
// ExternalAddress is the host name to use for external (public internet) facing URLs (e.g. Swagger)
AdmissionControl
admission
.
Interface
// Will default to a value based on secure serving info and available ipv4 IPs.
ExternalAddress
string
// LoopbackClientConfig is a config for a privileged loopback connection to the API server
//===========================================================================
LoopbackClientConfig
*
restclient
.
Config
// Fields you probably don't care about changing
//===========================================================================
// Map requests to contexts. Exported so downstream consumers can provider their own mappers
// BuildHandlerChainsFunc allows you to build custom handler chains by decorating the apiHandler.
BuildHandlerChainsFunc
func
(
apiHandler
http
.
Handler
,
c
*
Config
)
(
secure
,
insecure
http
.
Handler
)
// DiscoveryAddresses is used to build the IPs pass to discovery. If nil, the ExternalAddress is
// always reported
DiscoveryAddresses
DiscoveryAddresses
// LegacyAPIGroupPrefixes is used to set up URL parsing for authorization and for validating requests
// to InstallLegacyAPIGroup. New API servers don't generally have legacy groups at all.
LegacyAPIGroupPrefixes
sets
.
String
// RequestContextMapper maps requests to contexts. Exported so downstream consumers can provider their own mappers
// TODO confirm that anyone downstream actually uses this and doesn't just need an accessor
RequestContextMapper
api
.
RequestContextMapper
RequestContextMapper
api
.
RequestContextMapper
// Serializer is required and provides the interface for serializing and converting objects to and from the wire
//
Required, the interface for serializing and converting objects to and from the wire
//
The default (api.Codecs) usually works fine.
Serializer
runtime
.
NegotiatedSerializer
Serializer
runtime
.
NegotiatedSerializer
// OpenAPIConfig will be used in generating OpenAPI spec. This has "working" defaults.
OpenAPIConfig
*
common
.
Config
// If specified, requests will be allocated a random timeout between this value, and twice this value.
// If specified, requests will be allocated a random timeout between this value, and twice this value.
// Note that it is up to the request handlers to ignore or honor this timeout. In seconds.
// Note that it is up to the request handlers to ignore or honor this timeout. In seconds.
MinRequestTimeout
int
MinRequestTimeout
int
// MaxRequestsInFlight is the maximum number of parallel non-long-running requests. Every further
// request has to wait. Applies only to non-mutating requests.
MaxRequestsInFlight
int
// MaxMutatingRequestsInFlight is the maximum number of parallel mutating requests. Every further
// request has to wait.
MaxMutatingRequestsInFlight
int
// Predicate which is true for paths of long-running http requests
LongRunningFunc
genericfilters
.
LongRunningRequestCheck
SecureServingInfo
*
SecureServingInfo
// InsecureServingInfo is required to serve http. HTTP does NOT include authentication or authorization.
// You shouldn't be using this. It makes sig-auth sad.
InsecureServingInfo
*
ServingInfo
InsecureServingInfo
*
ServingInfo
//
DiscoveryAddresses is used to build the IPs pass to discovery. If nil, the ExternalAddress is
//
===========================================================================
//
always reported
//
values below here are targets for removal
DiscoveryAddresses
DiscoveryAddresses
//===========================================================================
APIResourceConfigSource
APIResourceConfigSource
// The port on PublicAddress where a read-write server will be installed.
// The port on PublicAddress where a read-write server will be installed.
// Defaults to 6443 if not set.
// Defaults to 6443 if not set.
ReadWritePort
int
ReadWritePort
int
// ExternalAddress is the host name to use for external (public internet) facing URLs (e.g. Swagger)
ExternalAddress
string
// PublicAddress is the IP address where members of the cluster (kubelet,
// PublicAddress is the IP address where members of the cluster (kubelet,
// kube-proxy, services, etc.) can reach the GenericAPIServer.
// kube-proxy, services, etc.) can reach the GenericAPIServer.
// If nil or 0.0.0.0, the host's default interface will be used.
// If nil or 0.0.0.0, the host's default interface will be used.
PublicAddress
net
.
IP
PublicAddress
net
.
IP
// EnableOpenAPISupport enables OpenAPI support. Allow downstream customers to disable OpenAPI spec.
EnableOpenAPISupport
bool
// OpenAPIConfig will be used in generating OpenAPI spec.
OpenAPIConfig
*
common
.
Config
// MaxRequestsInFlight is the maximum number of parallel non-long-running requests. Every further
// request has to wait. Applies only to non-mutating requests.
MaxRequestsInFlight
int
// MaxMutatingRequestsInFlight is the maximum number of parallel mutating requests. Every further
// request has to wait.
MaxMutatingRequestsInFlight
int
// Predicate which is true for paths of long-running http requests
LongRunningFunc
genericfilters
.
LongRunningRequestCheck
// Build the handler chains by decorating the apiHandler.
BuildHandlerChainsFunc
func
(
apiHandler
http
.
Handler
,
c
*
Config
)
(
secure
,
insecure
http
.
Handler
)
// LegacyAPIGroupPrefixes is used to set up URL parsing for authorization and for validating requests
// to InstallLegacyAPIGroup
LegacyAPIGroupPrefixes
sets
.
String
}
}
type
ServingInfo
struct
{
type
ServingInfo
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment