Documentation ¶
Overview ¶
Package genericapiserver contains code to setup a generic kubernetes-like API server. This does not contain any kubernetes API specific code. Note that this is a work in progress. We are pulling out generic code (specifically from pkg/master and pkg/apiserver) here. We plan to move this package into a separate repo on github once it is done. For more details: https://github.com/kubernetes/kubernetes/issues/2742
Index ¶
- Constants
- func DefaultAndValidateRunOptions(options *options.ServerRunOptions)
- func DefaultBuildHandlerChain(apiHandler http.Handler, c *Config) (secure, insecure http.Handler)
- func DefaultServiceIPRange(passedServiceClusterIPRange net.IPNet) (net.IPNet, net.IP, error)
- func NewRequestInfoResolver(c *Config) *request.RequestInfoFactory
- func NewStorageCodec(storageMediaType string, ns runtime.StorageSerializer, ...) (runtime.Codec, error)
- func TunnelSyncHealthChecker(tunneler Tunneler) func(req *http.Request) error
- type APIGroupInfo
- type APIResourceConfigSource
- type AddressFunc
- type CertKey
- type Config
- type DefaultDiscoveryAddresses
- type DefaultResourceEncodingConfig
- func (o *DefaultResourceEncodingConfig) InMemoryEncodingFor(resource unversioned.GroupResource) (unversioned.GroupVersion, error)
- func (o *DefaultResourceEncodingConfig) SetResourceEncoding(resourceBeingStored unversioned.GroupResource, ...)
- func (o *DefaultResourceEncodingConfig) SetVersionEncoding(group string, ...)
- func (o *DefaultResourceEncodingConfig) StorageEncodingFor(resource unversioned.GroupResource) (unversioned.GroupVersion, error)
- type DefaultStorageFactory
- func (s *DefaultStorageFactory) AddCohabitatingResources(groupResources ...unversioned.GroupResource)
- func (s *DefaultStorageFactory) Backends() []string
- func (s *DefaultStorageFactory) NewConfig(groupResource unversioned.GroupResource) (*storagebackend.Config, error)
- func (s *DefaultStorageFactory) ResourcePrefix(groupResource unversioned.GroupResource) string
- func (s *DefaultStorageFactory) SetEtcdLocation(groupResource unversioned.GroupResource, location []string)
- func (s *DefaultStorageFactory) SetEtcdPrefix(groupResource unversioned.GroupResource, prefix string)
- func (s *DefaultStorageFactory) SetResourceEtcdPrefix(groupResource unversioned.GroupResource, prefix string)
- func (s *DefaultStorageFactory) SetSerializer(groupResource unversioned.GroupResource, mediaType string, ...)
- type DiscoveryAddresses
- type DiscoveryCIDRRule
- type GeneratableKeyCert
- type GenericAPIServer
- func (s *GenericAPIServer) AddAPIGroupForDiscovery(apiGroup unversioned.APIGroup)
- func (s *GenericAPIServer) AddHealthzChecks(checks ...healthz.HealthzChecker) error
- func (s *GenericAPIServer) AddPostStartHook(name string, hook PostStartHookFunc) error
- func (s *GenericAPIServer) DynamicApisDiscovery() *restful.WebService
- func (s *GenericAPIServer) InstallAPIGroup(apiGroupInfo *APIGroupInfo) error
- func (s *GenericAPIServer) InstallLegacyAPIGroup(apiPrefix string, apiGroupInfo *APIGroupInfo) error
- func (s *GenericAPIServer) MinRequestTimeout() time.Duration
- func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer
- func (s *GenericAPIServer) RemoveAPIGroupForDiscovery(groupName string)
- func (s *GenericAPIServer) RequestContextMapper() api.RequestContextMapper
- func (s *GenericAPIServer) RunPostStartHooks()
- type GroupResourceEncodingConfig
- type GroupVersionResourceConfig
- type InstallSSHKey
- type NamedCertKey
- type PostStartHookContext
- type PostStartHookFunc
- type PostStartHookProvider
- type RESTOptionsGetter
- type RESTStorageProvider
- type ResourceConfig
- func (o *ResourceConfig) AllResourcesForVersionEnabled(version unversioned.GroupVersion) bool
- func (o *ResourceConfig) AnyResourcesForGroupEnabled(group string) bool
- func (o *ResourceConfig) AnyResourcesForVersionEnabled(version unversioned.GroupVersion) bool
- func (o *ResourceConfig) AnyVersionOfResourceEnabled(resource unversioned.GroupResource) bool
- func (o *ResourceConfig) DisableResources(resources ...unversioned.GroupVersionResource)
- func (o *ResourceConfig) DisableVersions(versions ...unversioned.GroupVersion)
- func (o *ResourceConfig) EnableResources(resources ...unversioned.GroupVersionResource)
- func (o *ResourceConfig) EnableVersions(versions ...unversioned.GroupVersion)
- func (o *ResourceConfig) ResourceEnabled(resource unversioned.GroupVersionResource) bool
- type ResourceEncodingConfig
- type SSHTunneler
- type SecureServingInfo
- type ServingInfo
- type StorageFactory
- type Tunneler
Constants ¶
const ( // DefaultLegacyAPIPrefix is where the the legacy APIs will be located. DefaultLegacyAPIPrefix = "/api" // APIGroupPrefix is where non-legacy API group will be located. APIGroupPrefix = "/apis" )
const AllResources = "*"
Variables ¶
This section is empty.
Functions ¶
func DefaultAndValidateRunOptions ¶ added in v1.3.0
func DefaultAndValidateRunOptions(options *options.ServerRunOptions)
func DefaultBuildHandlerChain ¶ added in v1.5.0
func DefaultServiceIPRange ¶ added in v1.5.0
DefaultServiceIPRange takes a the serviceIPRange flag and returns the defaulted service ip range (if needed), api server service IP, and an error TODO move this out of the genericapiserver package
func NewRequestInfoResolver ¶ added in v1.5.0
func NewRequestInfoResolver(c *Config) *request.RequestInfoFactory
func NewStorageCodec ¶ added in v1.3.0
func NewStorageCodec(storageMediaType string, ns runtime.StorageSerializer, storageVersion, memoryVersion unversioned.GroupVersion, config storagebackend.Config) (runtime.Codec, error)
NewStorageCodec assembles a storage codec for the provided storage media type, the provided serializer, and the requested storage and memory versions.
Types ¶
type APIGroupInfo ¶
type APIGroupInfo struct { GroupMeta apimachinery.GroupMeta // Info about the resources in this group. Its a map from version to resource to the storage. VersionedResourcesStorageMap map[string]map[string]rest.Storage // OptionsExternalVersion controls the APIVersion used for common objects in the // schema like api.Status, api.DeleteOptions, and api.ListOptions. Other implementors may // define a version "v1beta1" but want to use the Kubernetes "v1" internal objects. // If nil, defaults to groupMeta.GroupVersion. // TODO: Remove this when https://github.com/kubernetes/kubernetes/issues/19018 is fixed. OptionsExternalVersion *unversioned.GroupVersion // Scheme includes all of the types used by this group and how to convert between them (or // to convert objects from outside of this group that are accepted in this API). // TODO: replace with interfaces Scheme *runtime.Scheme // NegotiatedSerializer controls how this group encodes and decodes data NegotiatedSerializer runtime.NegotiatedSerializer // ParameterCodec performs conversions for query parameters passed to API calls ParameterCodec runtime.ParameterCodec // SubresourceGroupVersionKind contains the GroupVersionKind overrides for each subresource that is // accessible from this API group version. The GroupVersionKind is that of the external version of // the subresource. The key of this map should be the path of the subresource. The keys here should // match the keys in the Storage map above for subresources. SubresourceGroupVersionKind map[string]unversioned.GroupVersionKind }
Info about an API group.
func NewDefaultAPIGroupInfo ¶ added in v1.4.1
func NewDefaultAPIGroupInfo(group string) APIGroupInfo
NewDefaultAPIGroupInfo returns an APIGroupInfo stubbed with "normal" values exposed for easier composition from other packages
type APIResourceConfigSource ¶ added in v1.3.0
type APIResourceConfigSource interface { AnyVersionOfResourceEnabled(resource unversioned.GroupResource) bool ResourceEnabled(resource unversioned.GroupVersionResource) bool AllResourcesForVersionEnabled(version unversioned.GroupVersion) bool AnyResourcesForVersionEnabled(version unversioned.GroupVersion) bool AnyResourcesForGroupEnabled(group string) bool }
APIResourceConfigSource is the interface to determine which versions and resources are enabled
type AddressFunc ¶ added in v1.3.0
type Config ¶
type Config struct { // Destination for audit logs AuditWriter io.Writer // Allow downstream consumers to disable swagger. // This includes returning the generated swagger spec at /swaggerapi and swagger ui at /swagger-ui. EnableSwaggerSupport bool // Allow downstream consumers to disable swagger ui. // Note that this is ignored if EnableSwaggerSupport is false EnableSwaggerUI 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 EnableContentionProfiling bool EnableMetrics bool EnableGarbageCollection bool Version *version.Info 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 // TODO(ericchiang): Determine if policy escalation checks should be an admission controller. AuthorizerRBACSuperUser string // LoopbackClientConfig is a config for a privileged loopback connection to the API server LoopbackClientConfig *restclient.Config // Map requests to contexts. Exported so downstream consumers can provider their own mappers RequestContextMapper api.RequestContextMapper // Required, the interface for serializing and converting objects to and from the wire Serializer runtime.NegotiatedSerializer // 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. MinRequestTimeout int SecureServingInfo *SecureServingInfo InsecureServingInfo *ServingInfo // DiscoveryAddresses is used to build the IPs pass to discovery. If nil, the ExternalAddress is // always reported DiscoveryAddresses DiscoveryAddresses // The port on PublicAddress where a read-write server will be installed. // Defaults to 6443 if not set. 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, // kube-proxy, services, etc.) can reach the GenericAPIServer. // If nil or 0.0.0.0, the host's default interface will be used. 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. MaxRequestsInFlight 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 }
Config is a structure used to configure a GenericAPIServer.
func NewConfig ¶ added in v1.3.0
func NewConfig() *Config
NewConfig returns a Config struct with the default values
func (*Config) ApplyOptions ¶ added in v1.5.0
func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config
ApplyOptions applies the run options to the method receiver and returns self
func (*Config) Complete ¶ added in v1.5.0
func (c *Config) Complete() completedConfig
Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.
func (*Config) SkipComplete ¶ added in v1.5.0
func (c *Config) SkipComplete() completedConfig
SkipComplete provides a way to construct a server instance without config completion.
type DefaultDiscoveryAddresses ¶ added in v1.5.0
type DefaultDiscoveryAddresses struct { // DiscoveryCIDRRules is a list of CIDRs and Addresses to use if a client is in the range DiscoveryCIDRRules []DiscoveryCIDRRule // DefaultAddress is the address (hostname or IP and port) that should be used in // if no CIDR matches more specifically. DefaultAddress string }
DefaultDiscoveryAddresses is a default implementation of DiscoveryAddresses that will work in most cases
func (DefaultDiscoveryAddresses) ServerAddressByClientCIDRs ¶ added in v1.5.0
func (d DefaultDiscoveryAddresses) ServerAddressByClientCIDRs(clientIP net.IP) []unversioned.ServerAddressByClientCIDR
type DefaultResourceEncodingConfig ¶ added in v1.3.0
type DefaultResourceEncodingConfig struct {
Groups map[string]*GroupResourceEncodingConfig
}
func NewDefaultResourceEncodingConfig ¶ added in v1.3.0
func NewDefaultResourceEncodingConfig() *DefaultResourceEncodingConfig
func (*DefaultResourceEncodingConfig) InMemoryEncodingFor ¶ added in v1.3.0
func (o *DefaultResourceEncodingConfig) InMemoryEncodingFor(resource unversioned.GroupResource) (unversioned.GroupVersion, error)
func (*DefaultResourceEncodingConfig) SetResourceEncoding ¶ added in v1.3.0
func (o *DefaultResourceEncodingConfig) SetResourceEncoding(resourceBeingStored unversioned.GroupResource, externalEncodingVersion, internalVersion unversioned.GroupVersion)
func (*DefaultResourceEncodingConfig) SetVersionEncoding ¶ added in v1.3.0
func (o *DefaultResourceEncodingConfig) SetVersionEncoding(group string, externalEncodingVersion, internalVersion unversioned.GroupVersion)
func (*DefaultResourceEncodingConfig) StorageEncodingFor ¶ added in v1.3.0
func (o *DefaultResourceEncodingConfig) StorageEncodingFor(resource unversioned.GroupResource) (unversioned.GroupVersion, error)
type DefaultStorageFactory ¶ added in v1.3.0
type DefaultStorageFactory struct { // StorageConfig describes how to create a storage backend in general. // Its authentication information will be used for every storage.Interface returned. StorageConfig storagebackend.Config Overrides map[unversioned.GroupResource]groupResourceOverrides DefaultResourcePrefixes map[unversioned.GroupResource]string // DefaultMediaType is the media type used to store resources. If it is not set, "application/json" is used. DefaultMediaType string // DefaultSerializer is used to create encoders and decoders for the storage.Interface. DefaultSerializer runtime.StorageSerializer // ResourceEncodingConfig describes how to encode a particular GroupVersionResource ResourceEncodingConfig ResourceEncodingConfig // APIResourceConfigSource indicates whether the *storage* is enabled, NOT the API // This is discrete from resource enablement because those are separate concerns. How this source is configured // is left to the caller. APIResourceConfigSource APIResourceConfigSource // contains filtered or unexported fields }
DefaultStorageFactory takes a GroupResource and returns back its storage interface. This result includes: 1. Merged etcd config, including: auth, server locations, prefixes 2. Resource encodings for storage: group,version,kind to store as 3. Cohabitating default: some resources like hpa are exposed through multiple APIs. They must agree on 1 and 2
func BuildDefaultStorageFactory ¶ added in v1.3.0
func BuildDefaultStorageFactory(storageConfig storagebackend.Config, defaultMediaType string, serializer runtime.StorageSerializer, defaultResourceEncoding *DefaultResourceEncodingConfig, storageEncodingOverrides map[string]unversioned.GroupVersion, resourceEncodingOverrides []unversioned.GroupVersionResource, defaultAPIResourceConfig *ResourceConfig, resourceConfigOverrides config.ConfigurationMap) (*DefaultStorageFactory, error)
Builds the DefaultStorageFactory. Merges defaultResourceConfig with the user specified overrides and merges defaultAPIResourceConfig with the corresponding user specified overrides as well.
func NewDefaultStorageFactory ¶ added in v1.3.0
func NewDefaultStorageFactory(config storagebackend.Config, defaultMediaType string, defaultSerializer runtime.StorageSerializer, resourceEncodingConfig ResourceEncodingConfig, resourceConfig APIResourceConfigSource) *DefaultStorageFactory
func (*DefaultStorageFactory) AddCohabitatingResources ¶ added in v1.3.0
func (s *DefaultStorageFactory) AddCohabitatingResources(groupResources ...unversioned.GroupResource)
AddCohabitatingResources links resources together the order of the slice matters! its the priority order of lookup for finding a storage location
func (*DefaultStorageFactory) Backends ¶ added in v1.3.0
func (s *DefaultStorageFactory) Backends() []string
Get all backends for all registered storage destinations. Used for getting all instances for health validations.
func (*DefaultStorageFactory) NewConfig ¶ added in v1.4.1
func (s *DefaultStorageFactory) NewConfig(groupResource unversioned.GroupResource) (*storagebackend.Config, error)
New finds the storage destination for the given group and resource. It will return an error if the group has no storage destination configured.
func (*DefaultStorageFactory) ResourcePrefix ¶ added in v1.4.1
func (s *DefaultStorageFactory) ResourcePrefix(groupResource unversioned.GroupResource) string
func (*DefaultStorageFactory) SetEtcdLocation ¶ added in v1.3.0
func (s *DefaultStorageFactory) SetEtcdLocation(groupResource unversioned.GroupResource, location []string)
func (*DefaultStorageFactory) SetEtcdPrefix ¶ added in v1.3.0
func (s *DefaultStorageFactory) SetEtcdPrefix(groupResource unversioned.GroupResource, prefix string)
func (*DefaultStorageFactory) SetResourceEtcdPrefix ¶ added in v1.4.1
func (s *DefaultStorageFactory) SetResourceEtcdPrefix(groupResource unversioned.GroupResource, prefix string)
SetResourceEtcdPrefix sets the prefix for a resource, but not the base-dir. You'll end up in `etcdPrefix/resourceEtcdPrefix`.
func (*DefaultStorageFactory) SetSerializer ¶ added in v1.3.0
func (s *DefaultStorageFactory) SetSerializer(groupResource unversioned.GroupResource, mediaType string, serializer runtime.StorageSerializer)
type DiscoveryAddresses ¶ added in v1.5.0
type DiscoveryAddresses interface {
ServerAddressByClientCIDRs(net.IP) []unversioned.ServerAddressByClientCIDR
}
type DiscoveryCIDRRule ¶ added in v1.5.0
type DiscoveryCIDRRule struct { IPRange net.IPNet // Address is the address (hostname or IP and port) that should be used in // if this CIDR matches Address string }
DiscoveryCIDRRule is a rule for adding an alternate path to the master based on matching CIDR
func (DiscoveryCIDRRule) ServerAddressByClientCIDRs ¶ added in v1.5.0
func (d DiscoveryCIDRRule) ServerAddressByClientCIDRs(clientIP net.IP) []unversioned.ServerAddressByClientCIDR
type GeneratableKeyCert ¶ added in v1.5.0
type GenericAPIServer ¶
type GenericAPIServer struct { // LoopbackClientConfig is a config for a privileged loopback connection to the API server LoopbackClientConfig *restclient.Config // The registered APIs HandlerContainer *genericmux.APIContainer SecureServingInfo *SecureServingInfo InsecureServingInfo *ServingInfo // ExternalAddress is the address (hostname or IP and port) that should be used in // external (public internet) URLs for this GenericAPIServer. ExternalAddress string // Serializer controls how common API objects not in a group/version prefix are serialized for this server. // Individual APIGroups may define their own serializers. Serializer runtime.NegotiatedSerializer // "Outputs" Handler http.Handler InsecureHandler http.Handler // contains filtered or unexported fields }
GenericAPIServer contains state for a Kubernetes cluster api server.
func (*GenericAPIServer) AddAPIGroupForDiscovery ¶
func (s *GenericAPIServer) AddAPIGroupForDiscovery(apiGroup unversioned.APIGroup)
func (*GenericAPIServer) AddHealthzChecks ¶ added in v1.5.0
func (s *GenericAPIServer) AddHealthzChecks(checks ...healthz.HealthzChecker) error
AddHealthzCheck allows you to add a HealthzCheck.
func (*GenericAPIServer) AddPostStartHook ¶ added in v1.5.0
func (s *GenericAPIServer) AddPostStartHook(name string, hook PostStartHookFunc) error
AddPostStartHook allows you to add a PostStartHook.
func (*GenericAPIServer) DynamicApisDiscovery ¶ added in v1.5.0
func (s *GenericAPIServer) DynamicApisDiscovery() *restful.WebService
DynamicApisDiscovery returns a webservice serving api group discovery. Note: during the server runtime apiGroupsForDiscovery might change.
func (*GenericAPIServer) InstallAPIGroup ¶ added in v1.3.0
func (s *GenericAPIServer) InstallAPIGroup(apiGroupInfo *APIGroupInfo) error
Exposes the given api group in the API.
func (*GenericAPIServer) InstallLegacyAPIGroup ¶ added in v1.5.0
func (s *GenericAPIServer) InstallLegacyAPIGroup(apiPrefix string, apiGroupInfo *APIGroupInfo) error
func (*GenericAPIServer) MinRequestTimeout ¶
func (s *GenericAPIServer) MinRequestTimeout() time.Duration
MinRequestTimeout is exposed so that third party resource storage can be build in a different location. TODO refactor third party resource storage
func (*GenericAPIServer) PrepareRun ¶ added in v1.5.0
func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer
PrepareRun does post API installation setup steps.
func (*GenericAPIServer) RemoveAPIGroupForDiscovery ¶
func (s *GenericAPIServer) RemoveAPIGroupForDiscovery(groupName string)
func (*GenericAPIServer) RequestContextMapper ¶
func (s *GenericAPIServer) RequestContextMapper() api.RequestContextMapper
RequestContextMapper is exposed so that third party resource storage can be build in a different location. TODO refactor third party resource storage
func (*GenericAPIServer) RunPostStartHooks ¶ added in v1.5.0
func (s *GenericAPIServer) RunPostStartHooks()
RunPostStartHooks runs the PostStartHooks for the server
type GroupResourceEncodingConfig ¶ added in v1.3.0
type GroupResourceEncodingConfig struct { DefaultExternalEncoding unversioned.GroupVersion ExternalResourceEncodings map[string]unversioned.GroupVersion DefaultInternalEncoding unversioned.GroupVersion InternalResourceEncodings map[string]unversioned.GroupVersion }
type GroupVersionResourceConfig ¶ added in v1.3.0
type GroupVersionResourceConfig struct { // Whether to enable or disable this entire group version. This dominates any enablement check. // Enable=true means the group version is enabled, and EnabledResources/DisabledResources are considered. // Enable=false means the group version is disabled, and EnabledResources/DisabledResources are not considered. Enable bool // DisabledResources lists the resources that are specifically disabled for a group/version // DisabledResources trumps EnabledResources DisabledResources sets.String // EnabledResources lists the resources that should be enabled by default. This is a little // unusual, but we need it for compatibility with old code for now. An empty set means // enable all, a non-empty set means that all other resources are disabled. EnabledResources sets.String }
Specifies the overrides for various API group versions. This can be used to enable/disable entire group versions or specific resources.
func NewGroupVersionResourceConfig ¶ added in v1.3.0
func NewGroupVersionResourceConfig() *GroupVersionResourceConfig
type InstallSSHKey ¶ added in v1.3.0
type NamedCertKey ¶ added in v1.5.0
type PostStartHookContext ¶ added in v1.5.0
type PostStartHookContext struct { // LoopbackClientConfig is a config for a privileged loopback connection to the API server LoopbackClientConfig *restclient.Config }
PostStartHookContext provides information about this API server to a PostStartHookFunc
type PostStartHookFunc ¶ added in v1.5.0
type PostStartHookFunc func(context PostStartHookContext) error
PostStartHookFunc is a function that is called after the server has started. It must properly handle cases like:
- asynchronous start in multiple API server processes
- conflicts between the different processes all trying to perform the same action
- partially complete work (API server crashes while running your hook)
- API server access **BEFORE** your hook has completed
Think of it like a mini-controller that is super privileged and gets to run in-process If you use this feature, tag @deads2k on github who has promised to review code for anyone's PostStartHook until it becomes easier to use.
type PostStartHookProvider ¶ added in v1.5.0
type PostStartHookProvider interface {
PostStartHook() (string, PostStartHookFunc, error)
}
PostStartHookProvider is an interface in addition to provide a post start hook for the api server
type RESTOptionsGetter ¶ added in v1.5.0
type RESTOptionsGetter func(resource unversioned.GroupResource) generic.RESTOptions
type RESTStorageProvider ¶ added in v1.5.0
type RESTStorageProvider interface { GroupName() string NewRESTStorage(apiResourceConfigSource APIResourceConfigSource, restOptionsGetter RESTOptionsGetter) (APIGroupInfo, bool) }
type ResourceConfig ¶ added in v1.3.0
type ResourceConfig struct {
GroupVersionResourceConfigs map[unversioned.GroupVersion]*GroupVersionResourceConfig
}
func NewResourceConfig ¶ added in v1.3.0
func NewResourceConfig() *ResourceConfig
func (*ResourceConfig) AllResourcesForVersionEnabled ¶ added in v1.3.0
func (o *ResourceConfig) AllResourcesForVersionEnabled(version unversioned.GroupVersion) bool
func (*ResourceConfig) AnyResourcesForGroupEnabled ¶ added in v1.4.1
func (o *ResourceConfig) AnyResourcesForGroupEnabled(group string) bool
func (*ResourceConfig) AnyResourcesForVersionEnabled ¶ added in v1.3.0
func (o *ResourceConfig) AnyResourcesForVersionEnabled(version unversioned.GroupVersion) bool
func (*ResourceConfig) AnyVersionOfResourceEnabled ¶ added in v1.3.0
func (o *ResourceConfig) AnyVersionOfResourceEnabled(resource unversioned.GroupResource) bool
AnyResourcesForVersionEnabled only considers matches based on exactly group/resource lexical matching. This means that resource renames across versions are NOT considered to be the same resource by this method. You'll need to manually check using the ResourceEnabled function.
func (*ResourceConfig) DisableResources ¶ added in v1.3.0
func (o *ResourceConfig) DisableResources(resources ...unversioned.GroupVersionResource)
func (*ResourceConfig) DisableVersions ¶ added in v1.3.0
func (o *ResourceConfig) DisableVersions(versions ...unversioned.GroupVersion)
DisableVersions disables the versions entirely. No resources (even those whitelisted in EnabledResources) will be enabled
func (*ResourceConfig) EnableResources ¶ added in v1.3.0
func (o *ResourceConfig) EnableResources(resources ...unversioned.GroupVersionResource)
func (*ResourceConfig) EnableVersions ¶ added in v1.3.0
func (o *ResourceConfig) EnableVersions(versions ...unversioned.GroupVersion)
func (*ResourceConfig) ResourceEnabled ¶ added in v1.3.0
func (o *ResourceConfig) ResourceEnabled(resource unversioned.GroupVersionResource) bool
type ResourceEncodingConfig ¶ added in v1.3.0
type ResourceEncodingConfig interface { // StorageEncoding returns the serialization format for the resource. // TODO this should actually return a GroupVersionKind since you can logically have multiple "matching" Kinds // For now, it returns just the GroupVersion for consistency with old behavior StorageEncodingFor(unversioned.GroupResource) (unversioned.GroupVersion, error) // InMemoryEncodingFor returns the groupVersion for the in memory representation the storage should convert to. InMemoryEncodingFor(unversioned.GroupResource) (unversioned.GroupVersion, error) }
type SSHTunneler ¶ added in v1.3.0
type SSHTunneler struct { SSHUser string SSHKeyfile string InstallSSHKey InstallSSHKey HealthCheckURL *url.URL // contains filtered or unexported fields }
func (*SSHTunneler) Dial ¶ added in v1.3.0
func (c *SSHTunneler) Dial(net, addr string) (net.Conn, error)
func (*SSHTunneler) Run ¶ added in v1.3.0
func (c *SSHTunneler) Run(getAddresses AddressFunc)
Run establishes tunnel loops and returns
func (*SSHTunneler) SecondsSinceSSHKeySync ¶ added in v1.3.0
func (c *SSHTunneler) SecondsSinceSSHKeySync() int64
func (*SSHTunneler) SecondsSinceSync ¶ added in v1.3.0
func (c *SSHTunneler) SecondsSinceSync() int64
func (*SSHTunneler) Stop ¶ added in v1.3.0
func (c *SSHTunneler) Stop()
Stop gracefully shuts down the tunneler
type SecureServingInfo ¶ added in v1.5.0
type SecureServingInfo struct { ServingInfo // ServerCert is the TLS cert info for serving secure traffic ServerCert GeneratableKeyCert // SNICerts are named CertKeys for serving secure traffic with SNI support. SNICerts []NamedCertKey // ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates ClientCA *x509.CertPool }
type ServingInfo ¶ added in v1.5.0
type StorageFactory ¶ added in v1.3.0
type StorageFactory interface { // New finds the storage destination for the given group and resource. It will // return an error if the group has no storage destination configured. NewConfig(groupResource unversioned.GroupResource) (*storagebackend.Config, error) // ResourcePrefix returns the overridden resource prefix for the GroupResource // This allows for cohabitation of resources with different native types and provides // centralized control over the shape of etcd directories ResourcePrefix(groupResource unversioned.GroupResource) string // Backends gets all backends for all registered storage destinations. // Used for getting all instances for health validations. Backends() []string }
StorageFactory is the interface to locate the storage for a given GroupResource
type Tunneler ¶ added in v1.3.0
type Tunneler interface { Run(AddressFunc) Stop() Dial(net, addr string) (net.Conn, error) SecondsSinceSync() int64 SecondsSinceSSHKeySync() int64 }
func NewSSHTunneler ¶ added in v1.3.0
func NewSSHTunneler(sshUser, sshKeyfile string, healthCheckURL *url.URL, installSSHKey InstallSSHKey) Tunneler
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package filters contains all the http handler chain filters which are not api related.
|
Package filters contains all the http handler chain filters which are not api related. |
Package mux contains abstractions for http multiplexing of APIs.
|
Package mux contains abstractions for http multiplexing of APIs. |
Package openapi contains code to generate OpenAPI discovery spec (which initial version of it also known as Swagger 2.0).
|
Package openapi contains code to generate OpenAPI discovery spec (which initial version of it also known as Swagger 2.0). |
common
package common holds shared codes and types between open API code generator and spec generator.
|
package common holds shared codes and types between open API code generator and spec generator. |
package options is the public flags and options used by a generic api server.
|
package options is the public flags and options used by a generic api server. |
Package routes holds a collection of optional genericapiserver http handlers.
|
Package routes holds a collection of optional genericapiserver http handlers. |