apiserver: k8s.io/apiserver/pkg/server/options Index | Files | Directories

package options

import "k8s.io/apiserver/pkg/server/options"

package options is the public flags and options used by a generic api server. It takes a minimal set of dependencies and does not reference implementations, in order to ensure it may be reused by multiple components (such as CLI commands that wish to generate or validate config).

Index

Package Files

admission.go api_enablement.go audit.go authentication.go authorization.go coreapi.go deprecated_insecure_serving.go doc.go etcd.go events.go feature.go recommended.go server_run_options.go serving.go serving_with_loopback.go webhook.go

Constants

const (
    // ModeBatch indicates that the audit backend should buffer audit events
    // internally, sending batch updates either once a certain number of
    // events have been received or a certain amount of time has passed.
    ModeBatch = "batch"
    // ModeBlocking causes the audit backend to block on every attempt to process
    // a set of events. This causes requests to the API server to wait for the
    // flush before sending a response.
    ModeBlocking = "blocking"
    // ModeBlockingStrict is the same as ModeBlocking, except when there is
    // a failure during audit logging at RequestReceived stage, the whole
    // request to apiserver will fail.
    ModeBlockingStrict = "blocking-strict"
)

Variables

var AllowedModes = []string{
    ModeBatch,
    ModeBlocking,
    ModeBlockingStrict,
}

AllowedModes is the modes known for audit backends.

func CreateListener Uses

func CreateListener(network, addr string) (net.Listener, int, error)

func ParseWatchCacheSizes Uses

func ParseWatchCacheSizes(cacheSizes []string) (map[schema.GroupResource]int, error)

ParseWatchCacheSizes turns a list of cache size values into a map of group resources to requested sizes.

func WriteWatchCacheSizes Uses

func WriteWatchCacheSizes(watchCacheSizes map[schema.GroupResource]int) ([]string, error)

WriteWatchCacheSizes turns a map of cache size values into a list of string specifications.

type APIEnablementOptions Uses

type APIEnablementOptions struct {
    RuntimeConfig cliflag.ConfigurationMap
}

APIEnablementOptions contains the options for which resources to turn on and off. Given small aggregated API servers, this option isn't required for "normal" API servers

func NewAPIEnablementOptions Uses

func NewAPIEnablementOptions() *APIEnablementOptions

func (*APIEnablementOptions) AddFlags Uses

func (s *APIEnablementOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags for a specific APIServer to the specified FlagSet

func (*APIEnablementOptions) ApplyTo Uses

func (s *APIEnablementOptions) ApplyTo(c *server.Config, defaultResourceConfig *serverstore.ResourceConfig, registry resourceconfig.GroupVersionRegistry) error

ApplyTo override MergedResourceConfig with defaults and registry

func (*APIEnablementOptions) Validate Uses

func (s *APIEnablementOptions) Validate(registries ...GroupRegisty) []error

Validate validates RuntimeConfig with a list of registries. Usually this list only has one element, the apiserver registry of the process. But in the advanced (and usually not recommended) case of delegated apiservers there can be more. Validate will filter out the known groups of each registry. If anything is left over after that, an error is returned.

type AdmissionOptions Uses

type AdmissionOptions struct {
    // RecommendedPluginOrder holds an ordered list of plugin names we recommend to use by default
    RecommendedPluginOrder []string
    // DefaultOffPlugins is a set of plugin names that is disabled by default
    DefaultOffPlugins sets.String

    // EnablePlugins indicates plugins to be enabled passed through `--enable-admission-plugins`.
    EnablePlugins []string
    // DisablePlugins indicates plugins to be disabled passed through `--disable-admission-plugins`.
    DisablePlugins []string
    // ConfigFile is the file path with admission control configuration.
    ConfigFile string
    // Plugins contains all registered plugins.
    Plugins *admission.Plugins
    // Decorators is a list of admission decorator to wrap around the admission plugins
    Decorators admission.Decorators
}

AdmissionOptions holds the admission options

func NewAdmissionOptions Uses

func NewAdmissionOptions() *AdmissionOptions

NewAdmissionOptions creates a new instance of AdmissionOptions Note:

In addition it calls RegisterAllAdmissionPlugins to register
all generic admission plugins.

Provides the list of RecommendedPluginOrder that holds sane values
that can be used by servers that don't care about admission chain.
Servers that do care can overwrite/append that field after creation.

func (*AdmissionOptions) AddFlags Uses

func (a *AdmissionOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags related to admission for a specific APIServer to the specified FlagSet

func (*AdmissionOptions) ApplyTo Uses

func (a *AdmissionOptions) ApplyTo(
    c *server.Config,
    informers informers.SharedInformerFactory,
    kubeAPIServerClientConfig *rest.Config,
    pluginInitializers ...admission.PluginInitializer,
) error

ApplyTo adds the admission chain to the server configuration. In case admission plugin names were not provided by a custer-admin they will be prepared from the recommended/default values. In addition the method lazily initializes a generic plugin that is appended to the list of pluginInitializers note this method uses:

genericconfig.Authorizer

func (*AdmissionOptions) Validate Uses

func (a *AdmissionOptions) Validate() []error

Validate verifies flags passed to AdmissionOptions.

type AuditBatchOptions Uses

type AuditBatchOptions struct {
    // Should the backend asynchronous batch events to the webhook backend or
    // should the backend block responses?
    //
    // Defaults to asynchronous batch events.
    Mode string
    // Configuration for batching backend. Only used in batch mode.
    BatchConfig pluginbuffered.BatchConfig
}

func (*AuditBatchOptions) AddFlags Uses

func (o *AuditBatchOptions) AddFlags(pluginName string, fs *pflag.FlagSet)

type AuditDynamicOptions Uses

type AuditDynamicOptions struct {
    // Enabled tells whether the dynamic audit capability is enabled.
    Enabled bool

    // Configuration for batching backend. This is currently only used as an override
    // for integration tests
    BatchConfig *pluginbuffered.BatchConfig
}

AuditDynamicOptions control the configuration of dynamic backends for audit events

func (*AuditDynamicOptions) AddFlags Uses

func (o *AuditDynamicOptions) AddFlags(fs *pflag.FlagSet)

func (*AuditDynamicOptions) Validate Uses

func (o *AuditDynamicOptions) Validate() []error

type AuditLogOptions Uses

type AuditLogOptions struct {
    Path       string
    MaxAge     int
    MaxBackups int
    MaxSize    int
    Format     string

    BatchOptions    AuditBatchOptions
    TruncateOptions AuditTruncateOptions

    // API group version used for serializing audit events.
    GroupVersionString string
}

AuditLogOptions determines the output of the structured audit log by default.

func (*AuditLogOptions) AddFlags Uses

func (o *AuditLogOptions) AddFlags(fs *pflag.FlagSet)

func (*AuditLogOptions) Validate Uses

func (o *AuditLogOptions) Validate() []error

type AuditOptions Uses

type AuditOptions struct {
    // Policy configuration file for filtering audit events that are captured.
    // If unspecified, a default is provided.
    PolicyFile string

    // Plugin options
    LogOptions     AuditLogOptions
    WebhookOptions AuditWebhookOptions
    DynamicOptions AuditDynamicOptions
}

func NewAuditOptions Uses

func NewAuditOptions() *AuditOptions

func (*AuditOptions) AddFlags Uses

func (o *AuditOptions) AddFlags(fs *pflag.FlagSet)

func (*AuditOptions) ApplyTo Uses

func (o *AuditOptions) ApplyTo(
    c *server.Config,
    kubeClientConfig *restclient.Config,
    informers informers.SharedInformerFactory,
    processInfo *ProcessInfo,
    webhookOptions *WebhookOptions,
) error

func (*AuditOptions) Validate Uses

func (o *AuditOptions) Validate() []error

Validate checks invalid config combination

type AuditTruncateOptions Uses

type AuditTruncateOptions struct {
    // Whether truncating is enabled or not.
    Enabled bool

    // Truncating configuration.
    TruncateConfig plugintruncate.Config
}

func NewAuditTruncateOptions Uses

func NewAuditTruncateOptions() AuditTruncateOptions

func (*AuditTruncateOptions) AddFlags Uses

func (o *AuditTruncateOptions) AddFlags(pluginName string, fs *pflag.FlagSet)

func (*AuditTruncateOptions) Validate Uses

func (o *AuditTruncateOptions) Validate(pluginName string) error

type AuditWebhookOptions Uses

type AuditWebhookOptions struct {
    ConfigFile     string
    InitialBackoff time.Duration

    BatchOptions    AuditBatchOptions
    TruncateOptions AuditTruncateOptions

    // API group version used for serializing audit events.
    GroupVersionString string
}

AuditWebhookOptions control the webhook configuration for audit events.

func (*AuditWebhookOptions) AddFlags Uses

func (o *AuditWebhookOptions) AddFlags(fs *pflag.FlagSet)

func (*AuditWebhookOptions) Validate Uses

func (o *AuditWebhookOptions) Validate() []error

type CertKey Uses

type CertKey struct {
    // CertFile is a file containing a PEM-encoded certificate, and possibly the complete certificate chain
    CertFile string
    // KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile
    KeyFile string
}

type ClientCertAuthenticationOptions Uses

type ClientCertAuthenticationOptions struct {
    // ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates
    ClientCA string
}

func (*ClientCertAuthenticationOptions) AddFlags Uses

func (s *ClientCertAuthenticationOptions) AddFlags(fs *pflag.FlagSet)

type CoreAPIOptions Uses

type CoreAPIOptions struct {
    // CoreAPIKubeconfigPath is a filename for a kubeconfig file to contact the core API server with.
    // If it is not set, the in cluster config is used.
    CoreAPIKubeconfigPath string
}

CoreAPIOptions contains options to configure the connection to a core API Kubernetes apiserver.

func NewCoreAPIOptions Uses

func NewCoreAPIOptions() *CoreAPIOptions

func (*CoreAPIOptions) AddFlags Uses

func (o *CoreAPIOptions) AddFlags(fs *pflag.FlagSet)

func (*CoreAPIOptions) ApplyTo Uses

func (o *CoreAPIOptions) ApplyTo(config *server.RecommendedConfig) error

func (*CoreAPIOptions) Validate Uses

func (o *CoreAPIOptions) Validate() []error

type DelegatingAuthenticationOptions Uses

type DelegatingAuthenticationOptions struct {
    // RemoteKubeConfigFile is the file to use to connect to a "normal" kube API server which hosts the
    // TokenAccessReview.authentication.k8s.io endpoint for checking tokens.
    RemoteKubeConfigFile string
    // RemoteKubeConfigFileOptional is specifying whether not specifying the kubeconfig or
    // a missing in-cluster config will be fatal.
    RemoteKubeConfigFileOptional bool

    // CacheTTL is the length of time that a token authentication answer will be cached.
    CacheTTL time.Duration

    ClientCert    ClientCertAuthenticationOptions
    RequestHeader RequestHeaderAuthenticationOptions

    // SkipInClusterLookup indicates missing authentication configuration should not be retrieved from the cluster configmap
    SkipInClusterLookup bool

    // TolerateInClusterLookupFailure indicates failures to look up authentication configuration from the cluster configmap should not be fatal.
    // Setting this can result in an authenticator that will reject all requests.
    TolerateInClusterLookupFailure bool
}

DelegatingAuthenticationOptions provides an easy way for composing API servers to delegate their authentication to the root kube API server. The API federator will act as a front proxy and direction connections will be able to delegate to the core kube API server

func NewDelegatingAuthenticationOptions Uses

func NewDelegatingAuthenticationOptions() *DelegatingAuthenticationOptions

func (*DelegatingAuthenticationOptions) AddFlags Uses

func (s *DelegatingAuthenticationOptions) AddFlags(fs *pflag.FlagSet)

func (*DelegatingAuthenticationOptions) ApplyTo Uses

func (s *DelegatingAuthenticationOptions) ApplyTo(c *server.AuthenticationInfo, servingInfo *server.SecureServingInfo, openAPIConfig *openapicommon.Config) error

func (*DelegatingAuthenticationOptions) Validate Uses

func (s *DelegatingAuthenticationOptions) Validate() []error

type DelegatingAuthorizationOptions Uses

type DelegatingAuthorizationOptions struct {
    // RemoteKubeConfigFile is the file to use to connect to a "normal" kube API server which hosts the
    // SubjectAccessReview.authorization.k8s.io endpoint for checking tokens.
    RemoteKubeConfigFile string
    // RemoteKubeConfigFileOptional is specifying whether not specifying the kubeconfig or
    // a missing in-cluster config will be fatal.
    RemoteKubeConfigFileOptional bool

    // AllowCacheTTL is the length of time that a successful authorization response will be cached
    AllowCacheTTL time.Duration

    // DenyCacheTTL is the length of time that an unsuccessful authorization response will be cached.
    // You generally want more responsive, "deny, try again" flows.
    DenyCacheTTL time.Duration

    // AlwaysAllowPaths are HTTP paths which are excluded from authorization. They can be plain
    // paths or end in * in which case prefix-match is applied. A leading / is optional.
    AlwaysAllowPaths []string

    // AlwaysAllowGroups are groups which are allowed to take any actions.  In kube, this is system:masters.
    AlwaysAllowGroups []string
}

DelegatingAuthorizationOptions provides an easy way for composing API servers to delegate their authorization to the root kube API server. WARNING: never assume that every authenticated incoming request already does authorization.

The aggregator in the kube API server does this today, but this behaviour is not
guaranteed in the future.

func NewDelegatingAuthorizationOptions Uses

func NewDelegatingAuthorizationOptions() *DelegatingAuthorizationOptions

func (*DelegatingAuthorizationOptions) AddFlags Uses

func (s *DelegatingAuthorizationOptions) AddFlags(fs *pflag.FlagSet)

func (*DelegatingAuthorizationOptions) ApplyTo Uses

func (s *DelegatingAuthorizationOptions) ApplyTo(c *server.AuthorizationInfo) error

func (*DelegatingAuthorizationOptions) Validate Uses

func (s *DelegatingAuthorizationOptions) Validate() []error

func (*DelegatingAuthorizationOptions) WithAlwaysAllowGroups Uses

func (s *DelegatingAuthorizationOptions) WithAlwaysAllowGroups(groups ...string) *DelegatingAuthorizationOptions

WithAlwaysAllowGroups appends the list of paths to AlwaysAllowGroups

func (*DelegatingAuthorizationOptions) WithAlwaysAllowPaths Uses

func (s *DelegatingAuthorizationOptions) WithAlwaysAllowPaths(paths ...string) *DelegatingAuthorizationOptions

WithAlwaysAllowPaths appends the list of paths to AlwaysAllowPaths

type DeprecatedInsecureServingOptions Uses

type DeprecatedInsecureServingOptions struct {
    BindAddress net.IP
    BindPort    int
    // BindNetwork is the type of network to bind to - defaults to "tcp", accepts "tcp",
    // "tcp4", and "tcp6".
    BindNetwork string

    // Listener is the secure server network listener.
    // either Listener or BindAddress/BindPort/BindNetwork is set,
    // if Listener is set, use it and omit BindAddress/BindPort/BindNetwork.
    Listener net.Listener

    // ListenFunc can be overridden to create a custom listener, e.g. for mocking in tests.
    // It defaults to options.CreateListener.
    ListenFunc func(network, addr string) (net.Listener, int, error)
}

DeprecatedInsecureServingOptions are for creating an unauthenticated, unauthorized, insecure port. No one should be using these anymore. DEPRECATED: all insecure serving options are removed in a future version

func (*DeprecatedInsecureServingOptions) AddFlags Uses

func (s *DeprecatedInsecureServingOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags related to insecure serving to the specified FlagSet.

func (*DeprecatedInsecureServingOptions) AddUnqualifiedFlags Uses

func (s *DeprecatedInsecureServingOptions) AddUnqualifiedFlags(fs *pflag.FlagSet)

AddUnqualifiedFlags adds flags related to insecure serving without the --insecure prefix to the specified FlagSet.

func (*DeprecatedInsecureServingOptions) ApplyTo Uses

func (s *DeprecatedInsecureServingOptions) ApplyTo(c **server.DeprecatedInsecureServingInfo) error

ApplyTo adds DeprecatedInsecureServingOptions to the insecureserverinfo and kube-controller manager configuration. Note: the double pointer allows to set the *DeprecatedInsecureServingInfo to nil without referencing the struct hosting this pointer.

func (*DeprecatedInsecureServingOptions) Validate Uses

func (s *DeprecatedInsecureServingOptions) Validate() []error

Validate ensures that the insecure port values within the range of the port.

func (*DeprecatedInsecureServingOptions) WithLoopback Uses

func (o *DeprecatedInsecureServingOptions) WithLoopback() *DeprecatedInsecureServingOptionsWithLoopback

WithLoopback adds loopback functionality to the serving options.

type DeprecatedInsecureServingOptionsWithLoopback Uses

type DeprecatedInsecureServingOptionsWithLoopback struct {
    *DeprecatedInsecureServingOptions
}

DeprecatedInsecureServingOptionsWithLoopback adds loopback functionality to the DeprecatedInsecureServingOptions. DEPRECATED: all insecure serving options will be removed in a future version, however note that there are security concerns over how health checks can work here - see e.g. #43784

func (*DeprecatedInsecureServingOptionsWithLoopback) ApplyTo Uses

func (s *DeprecatedInsecureServingOptionsWithLoopback) ApplyTo(insecureServingInfo **server.DeprecatedInsecureServingInfo, loopbackClientConfig **rest.Config) error

ApplyTo fills up serving information in the server configuration.

type EtcdOptions Uses

type EtcdOptions struct {
    // The value of Paging on StorageConfig will be overridden by the
    // calculated feature gate value.
    StorageConfig                    storagebackend.Config
    EncryptionProviderConfigFilepath string

    EtcdServersOverrides []string

    // To enable protobuf as storage format, it is enough
    // to set it to "application/vnd.kubernetes.protobuf".
    DefaultStorageMediaType string
    DeleteCollectionWorkers int
    EnableGarbageCollection bool

    // Set EnableWatchCache to false to disable all watch caches
    EnableWatchCache bool
    // Set DefaultWatchCacheSize to zero to disable watch caches for those resources that have no explicit cache size set
    DefaultWatchCacheSize int
    // WatchCacheSizes represents override to a given resource
    WatchCacheSizes []string
}

func NewEtcdOptions Uses

func NewEtcdOptions(backendConfig *storagebackend.Config) *EtcdOptions

func (*EtcdOptions) AddFlags Uses

func (s *EtcdOptions) AddFlags(fs *pflag.FlagSet)

AddEtcdFlags adds flags related to etcd storage for a specific APIServer to the specified FlagSet

func (*EtcdOptions) ApplyTo Uses

func (s *EtcdOptions) ApplyTo(c *server.Config) error

func (*EtcdOptions) ApplyWithStorageFactoryTo Uses

func (s *EtcdOptions) ApplyWithStorageFactoryTo(factory serverstorage.StorageFactory, c *server.Config) error

func (*EtcdOptions) Validate Uses

func (s *EtcdOptions) Validate() []error

type FeatureOptions Uses

type FeatureOptions struct {
    EnableProfiling           bool
    EnableContentionProfiling bool
}

func NewFeatureOptions Uses

func NewFeatureOptions() *FeatureOptions

func (*FeatureOptions) AddFlags Uses

func (o *FeatureOptions) AddFlags(fs *pflag.FlagSet)

func (*FeatureOptions) ApplyTo Uses

func (o *FeatureOptions) ApplyTo(c *server.Config) error

func (*FeatureOptions) Validate Uses

func (o *FeatureOptions) Validate() []error

type GeneratableKeyCert Uses

type GeneratableKeyCert struct {
    // CertKey allows setting an explicit cert/key file to use.
    CertKey CertKey

    // CertDirectory specifies a directory to write generated certificates to if CertFile/KeyFile aren't explicitly set.
    // PairName is used to determine the filenames within CertDirectory.
    // If CertDirectory and PairName are not set, an in-memory certificate will be generated.
    CertDirectory string
    // PairName is the name which will be used with CertDirectory to make a cert and key filenames.
    // It becomes CertDirectory/PairName.crt and CertDirectory/PairName.key
    PairName string

    // GeneratedCert holds an in-memory generated certificate if CertFile/KeyFile aren't explicitly set, and CertDirectory/PairName are not set.
    GeneratedCert *tls.Certificate

    // FixtureDirectory is a directory that contains test fixture used to avoid regeneration of certs during tests.
    // The format is:
    // <host>_<ip>-<ip>_<alternateDNS>-<alternateDNS>.crt
    // <host>_<ip>-<ip>_<alternateDNS>-<alternateDNS>.key
    FixtureDirectory string
}

type GroupRegisty Uses

type GroupRegisty interface {
    // IsRegistered returns true if given group is registered.
    IsGroupRegistered(group string) bool
}

GroupRegisty provides a method to check whether given group is registered.

type ProcessInfo Uses

type ProcessInfo struct {
    // Name of the api process to identify events
    Name string

    // Namespace of the api process to send events
    Namespace string
}

ProcessInfo holds the apiserver process information used to send events

func NewProcessInfo Uses

func NewProcessInfo(name, namespace string) *ProcessInfo

NewProcessInfo returns a new process info with the hostname concatenated to the name given

type RecommendedOptions Uses

type RecommendedOptions struct {
    Etcd           *EtcdOptions
    SecureServing  *SecureServingOptionsWithLoopback
    Authentication *DelegatingAuthenticationOptions
    Authorization  *DelegatingAuthorizationOptions
    Audit          *AuditOptions
    Features       *FeatureOptions
    CoreAPI        *CoreAPIOptions

    // ExtraAdmissionInitializers is called once after all ApplyTo from the options above, to pass the returned
    // admission plugin initializers to Admission.ApplyTo.
    ExtraAdmissionInitializers func(c *server.RecommendedConfig) ([]admission.PluginInitializer, error)
    Admission                  *AdmissionOptions
    // ProcessInfo is used to identify events created by the server.
    ProcessInfo *ProcessInfo
    Webhook     *WebhookOptions
}

RecommendedOptions contains the recommended options for running an API server. If you add something to this list, it should be in a logical grouping. Each of them can be nil to leave the feature unconfigured on ApplyTo.

func NewRecommendedOptions Uses

func NewRecommendedOptions(prefix string, codec runtime.Codec, processInfo *ProcessInfo) *RecommendedOptions

func (*RecommendedOptions) AddFlags Uses

func (o *RecommendedOptions) AddFlags(fs *pflag.FlagSet)

func (*RecommendedOptions) ApplyTo Uses

func (o *RecommendedOptions) ApplyTo(config *server.RecommendedConfig) error

ApplyTo adds RecommendedOptions to the server configuration. pluginInitializers can be empty, it is only need for additional initializers.

func (*RecommendedOptions) Validate Uses

func (o *RecommendedOptions) Validate() []error

type RequestHeaderAuthenticationOptions Uses

type RequestHeaderAuthenticationOptions struct {
    // ClientCAFile is the root certificate bundle to verify client certificates on incoming requests
    // before trusting usernames in headers.
    ClientCAFile string

    UsernameHeaders     []string
    GroupHeaders        []string
    ExtraHeaderPrefixes []string
    AllowedNames        []string
}

func (*RequestHeaderAuthenticationOptions) AddFlags Uses

func (s *RequestHeaderAuthenticationOptions) AddFlags(fs *pflag.FlagSet)

func (*RequestHeaderAuthenticationOptions) ToAuthenticationRequestHeaderConfig Uses

func (s *RequestHeaderAuthenticationOptions) ToAuthenticationRequestHeaderConfig() *authenticatorfactory.RequestHeaderConfig

ToAuthenticationRequestHeaderConfig returns a RequestHeaderConfig config object for these options if necessary, nil otherwise.

type SecureServingOptions Uses

type SecureServingOptions struct {
    BindAddress net.IP
    // BindPort is ignored when Listener is set, will serve https even with 0.
    BindPort int
    // BindNetwork is the type of network to bind to - defaults to "tcp", accepts "tcp",
    // "tcp4", and "tcp6".
    BindNetwork string
    // Required set to true means that BindPort cannot be zero.
    Required bool
    // ExternalAddress is the address advertised, even if BindAddress is a loopback. By default this
    // is set to BindAddress if the later no loopback, or to the first host interface address.
    ExternalAddress net.IP

    // Listener is the secure server network listener.
    // either Listener or BindAddress/BindPort/BindNetwork is set,
    // if Listener is set, use it and omit BindAddress/BindPort/BindNetwork.
    Listener net.Listener

    // ServerCert is the TLS cert info for serving secure traffic
    ServerCert GeneratableKeyCert
    // SNICertKeys are named CertKeys for serving secure traffic with SNI support.
    SNICertKeys []cliflag.NamedCertKey
    // CipherSuites is the list of allowed cipher suites for the server.
    // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
    CipherSuites []string
    // MinTLSVersion is the minimum TLS version supported.
    // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
    MinTLSVersion string

    // HTTP2MaxStreamsPerConnection is the limit that the api server imposes on each client.
    // A value of zero means to use the default provided by golang's HTTP/2 support.
    HTTP2MaxStreamsPerConnection int
}

func NewSecureServingOptions Uses

func NewSecureServingOptions() *SecureServingOptions

func (*SecureServingOptions) AddFlags Uses

func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet)

func (*SecureServingOptions) ApplyTo Uses

func (s *SecureServingOptions) ApplyTo(config **server.SecureServingInfo) error

ApplyTo fills up serving information in the server configuration.

func (*SecureServingOptions) DefaultExternalAddress Uses

func (s *SecureServingOptions) DefaultExternalAddress() (net.IP, error)

func (*SecureServingOptions) MaybeDefaultWithSelfSignedCerts Uses

func (s *SecureServingOptions) MaybeDefaultWithSelfSignedCerts(publicAddress string, alternateDNS []string, alternateIPs []net.IP) error

func (*SecureServingOptions) Validate Uses

func (s *SecureServingOptions) Validate() []error

func (*SecureServingOptions) WithLoopback Uses

func (o *SecureServingOptions) WithLoopback() *SecureServingOptionsWithLoopback

type SecureServingOptionsWithLoopback Uses

type SecureServingOptionsWithLoopback struct {
    *SecureServingOptions
}

func (*SecureServingOptionsWithLoopback) ApplyTo Uses

func (s *SecureServingOptionsWithLoopback) ApplyTo(secureServingInfo **server.SecureServingInfo, loopbackClientConfig **rest.Config) error

ApplyTo fills up serving information in the server configuration.

type ServerRunOptions Uses

type ServerRunOptions struct {
    AdvertiseAddress net.IP

    CorsAllowedOriginList       []string
    ExternalHost                string
    MaxRequestsInFlight         int
    MaxMutatingRequestsInFlight int
    RequestTimeout              time.Duration
    MinRequestTimeout           int
    // We intentionally did not add a flag for this option. Users of the
    // apiserver library can wire it to a flag.
    JSONPatchMaxCopyBytes int64
    // The limit on the request body size that would be accepted and
    // decoded in a write request. 0 means no limit.
    // We intentionally did not add a flag for this option. Users of the
    // apiserver library can wire it to a flag.
    MaxRequestBodyBytes       int64
    TargetRAMMB               int
    EnableInfightQuotaHandler bool
}

ServerRunOptions contains the options while running a generic api server.

func NewServerRunOptions Uses

func NewServerRunOptions() *ServerRunOptions

func (*ServerRunOptions) AddUniversalFlags Uses

func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet)

AddUniversalFlags adds flags for a specific APIServer to the specified FlagSet

func (*ServerRunOptions) ApplyTo Uses

func (s *ServerRunOptions) ApplyTo(c *server.Config) error

ApplyOptions applies the run options to the method receiver and returns self

func (*ServerRunOptions) DefaultAdvertiseAddress Uses

func (s *ServerRunOptions) DefaultAdvertiseAddress(secure *SecureServingOptions) error

DefaultAdvertiseAddress sets the field AdvertiseAddress if unset. The field will be set based on the SecureServingOptions.

func (*ServerRunOptions) Validate Uses

func (s *ServerRunOptions) Validate() []error

Validate checks validation of ServerRunOptions

type SimpleRestOptionsFactory Uses

type SimpleRestOptionsFactory struct {
    Options EtcdOptions
}

func (*SimpleRestOptionsFactory) GetRESTOptions Uses

func (f *SimpleRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error)

type StorageFactoryRestOptionsFactory Uses

type StorageFactoryRestOptionsFactory struct {
    Options        EtcdOptions
    StorageFactory serverstorage.StorageFactory
}

func (*StorageFactoryRestOptionsFactory) GetRESTOptions Uses

func (f *StorageFactoryRestOptionsFactory) GetRESTOptions(resource schema.GroupResource) (generic.RESTOptions, error)

type WebhookOptions Uses

type WebhookOptions struct {
    ServiceResolver         utilwebhook.ServiceResolver
    AuthInfoResolverWrapper utilwebhook.AuthenticationInfoResolverWrapper
}

WebhookOptions holds the outgoing webhook options

func NewWebhookOptions Uses

func NewWebhookOptions() *WebhookOptions

NewWebhookOptions returns the default options for outgoing webhooks

Directories

PathSynopsis
encryptionconfig

Package options imports 70 packages (graph) and is imported by 182 packages. Updated 2019-04-19. Refresh now. Tools for package owners.