Documentation
¶
Overview ¶
Package builder assembles the ephemeral virtual workspace.
Index ¶
Constants ¶
const DefaultVirtualWorkspaceName = "ephemeral"
DefaultVirtualWorkspaceName is the path segment this virtual workspace is mounted under, giving URLs of the shape
<external URL>/services/ephemeral/<cluster>/<export>
Name it after the service it provides -- --virtual-workspace-name=ephemeral-buckets serves /services/ephemeral-buckets/... -- because the name is only ever seen by whoever operates it. The URL a shard uses is whatever this server publishes into the endpoint slice an APIExport references, so any name works as long as the two agree, which pkg/endpointslice takes care of.
It used to default to "apiexport", squatting on the path kcp's own APIExport virtual workspace answers on. That was not a choice: the URL came from kcp's controller as <shard.spec.virtualWorkspaceURL>/services/apiexport/..., so this server had to answer there, and an operator had to route around the collision. Publishing the URL removes the collision along with the need to route by API group.
Variables ¶
This section is empty.
Functions ¶
func BuildVirtualWorkspace ¶
func BuildVirtualWorkspace(cfg Config) ([]rootapiserver.NamedVirtualWorkspace, error)
BuildVirtualWorkspace assembles the ephemeral virtual workspace.
Types ¶
type Config ¶
type Config struct {
// Configuration is the operator's registry of webhook-backed resources.
Configuration *config.Configuration
// WebhookFactory builds the HTTP clients used to call providers.
WebhookFactory *webhook.Factory
// RootPathPrefix is the prefix all virtual workspaces are served under,
// conventionally "/services".
RootPathPrefix string
// VirtualWorkspaceName is the path segment identifying this virtual
// workspace. Defaults to DefaultVirtualWorkspaceName.
VirtualWorkspaceName string
// AuthorizerOptions tune the content authorizer.
AuthorizerOptions ephemeralauthorizer.Options
KubeClusterClient kcpkubernetesclientset.ClusterInterface
// LocalInformers watch the shard this virtual workspace is attached to;
// CacheInformers watch the cache server, which is where APIExports and
// APIResourceSchemas owned by other shards are found.
LocalInformers kcpinformers.SharedInformerFactory
CacheInformers kcpinformers.SharedInformerFactory
}
Config is everything BuildVirtualWorkspace needs.