contrib-virtual-workspaces

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: Apache-2.0

README

contrib-virtual-workspaces

Contrib virtual workspaces for kcp.

Component What it serves Image
access/ SelfClusterAccessReview — "which workspaces can this user access?" in one call ghcr.io/kcp-dev/contrib-virtual-workspaces/access-vw
mcp/ Model Context Protocol as a virtual workspace, scoped to what the caller can see (uses the access VW) ghcr.io/kcp-dev/contrib-virtual-workspaces/mcp-vw
ephemeral/ Non-persisted resources: POST in, a provider webhook answers, nothing reaches etcd ghcr.io/kcp-dev/contrib-virtual-workspaces/ephemeral-vw

Each component's README documents its design, deployment and limits.

Layout

  • One go.mod at the root. The kcp Kubernetes fork replace block lives here once, and hack/verify-fork-pin.sh checks it against virtual-workspace-framework's.
  • One Dockerfile with a shared builder stage and one final stage per component; images are selected with --target access-vw|mcp-vw|ephemeral-vw.
  • The root Makefile owns building, testing and verification (make build, make test, make verify, make images, make test-e2e-<component>). Component Makefiles keep only the local development targets that need to run next to their manifests.
  • CI runs one verify job, one build/test job, and one e2e job per component (.github/workflows/ci.yaml); images build as a three-way matrix over the Dockerfile targets (.github/workflows/images.yaml).

Building

make build              # all binaries into bin/
make build-access       # or per component
make images             # all three container images
make image-mcp          # or per component

Testing

make test               # unit tests
make verify             # gofmt, vet, fork pin, manifest rendering, tidy -diff
make test-e2e-access    # kind + kcp-operator
make test-e2e-mcp       # kind + kcp-operator + both VWs from this checkout
make test-e2e-ephemeral # local processes against a real kcp

History

This repository merges three formerly separate repositories, imported with full history:

Directories

Path Synopsis
access
cmd/access-vw command
cmd/init command
Command access-vw-init installs the kcp-side objects the access virtual workspace needs — the APIResourceSchema, the APIExport, and the APIExportEndpointSlice the RBAC provider follows — and verifies they came up.
Command access-vw-init installs the kcp-side objects the access virtual workspace needs — the APIResourceSchema, the APIExport, and the APIExportEndpointSlice the RBAC provider follows — and verifies they came up.
cmd/scar-to-kubeconfig command
Command scar-to-kubeconfig calls the SCAR endpoint with a bearer token and writes a kubeconfig with one context per authorized cluster.
Command scar-to-kubeconfig calls the SCAR endpoint with a bearer token and writes a kubeconfig with one context per authorized cluster.
config/apiexport
Package apiexport holds the kcp-side assets the access virtual workspace needs in the workspace that hosts its APIExport: the APIResourceSchema for SelfClusterAccessReview, the APIExport itself, the RBAC that makes the export bindable, and the APIExportEndpointSlice the RBAC provider follows.
Package apiexport holds the kcp-side assets the access virtual workspace needs in the workspace that hosts its APIExport: the APIResourceSchema for SelfClusterAccessReview, the APIExport itself, the RBAC that makes the export bindable, and the APIExportEndpointSlice the RBAC provider follows.
config/controller
Package controller holds the identity the access virtual workspace runs as: a ServiceAccount in the workspace that hosts the APIExport, its token, and the RBAC it needs.
Package controller holds the identity the access virtual workspace runs as: a ServiceAccount in the workspace that hosts the APIExport, its token, and the RBAC it needs.
pkg/accessprovider
Package accessprovider defines the AccessProvider interface — the writer-side seam between the access graph and the various sources of authorization data that may populate it.
Package accessprovider defines the AccessProvider interface — the writer-side seam between the access graph and the various sources of authorization data that may populate it.
pkg/bootstrap
Package bootstrap installs the kcp-side objects the access virtual workspace needs and verifies they came up.
Package bootstrap installs the kcp-side objects the access virtual workspace needs and verifies they came up.
pkg/graph
Package graph provides an in-memory RBAC permission map for kcp.
Package graph provides an in-memory RBAC permission map for kcp.
pkg/rbacprovider
Package rbacprovider implements the kcp-native RBAC AccessProvider.
Package rbacprovider implements the kcp-native RBAC AccessProvider.
pkg/server
Package server wires the Access Virtual Workspace binary together: the shared access graph, the RBAC provider that populates it, and a virtual-workspace root apiserver (kcp virtual-workspace-framework) serving the access virtual workspace at /services/access behind kcp's front-proxy.
Package server wires the Access Virtual Workspace binary together: the shared access graph, the RBAC provider that populates it, and a virtual-workspace root apiserver (kcp virtual-workspace-framework) serving the access virtual workspace at /services/access behind kcp's front-proxy.
pkg/virtual
Package virtual provides shared building blocks for the virtual workspaces served by this binary, built on the kcp virtual-workspace-framework.
Package virtual provides shared building blocks for the virtual workspaces served by this binary, built on the kcp virtual-workspace-framework.
pkg/virtual/scar
Package scar implements the SelfClusterAccessReview API of the Access Virtual Workspace.
Package scar implements the SelfClusterAccessReview API of the Access Virtual Workspace.
sdk/apis/access/v1alpha1
Package v1alpha1 holds the API types for the Access Virtual Workspace (group access.contrib.kcp.io).
Package v1alpha1 holds the API types for the Access Virtual Workspace (group access.contrib.kcp.io).
ephemeral
cmd/endpointslice-controller command
Command endpointslice-controller publishes a virtual workspace's address into the EphemeralResourceEndpointSlices of one workspace.
Command endpointslice-controller publishes a virtual workspace's address into the EphemeralResourceEndpointSlices of one workspace.
cmd/ephemeral-virtual-workspace/command
Package command wires the ephemeral virtual workspace server together.
Package command wires the ephemeral virtual workspace server together.
cmd/ephemeral-virtual-workspace/options
Package options holds the command line surface of the ephemeral virtual workspace server.
Package options holds the command line surface of the ephemeral virtual workspace server.
examples/webhook command
Command example-webhook is a reference implementation of the EphemeralReview contract: a BucketInfo service that answers with live numbers.
Command example-webhook is a reference implementation of the EphemeralReview contract: a BucketInfo service that answers with live numbers.
pkg/apis/ephemeral/v1alpha1
Package v1alpha1 defines the wire contract between the ephemeral virtual workspace and a provider's webhook.
Package v1alpha1 defines the wire contract between the ephemeral virtual workspace and a provider's webhook.
pkg/cacheclient
Package cacheclient builds a rest.Config that talks to a kcp cache server.
Package cacheclient builds a rest.Config that talks to a kcp cache server.
pkg/config
Package config holds the operator-supplied registry of webhook-backed resources.
Package config holds the operator-supplied registry of webhook-backed resources.
pkg/endpointslice
Package endpointslice publishes a virtual workspace's address into the endpoint slices that APIExports reference.
Package endpointslice publishes a virtual workspace's address into the endpoint slices that APIExports reference.
pkg/registry
Package registry implements the REST storage that answers a create by calling a provider webhook.
Package registry implements the REST storage that answers a create by calling a provider webhook.
pkg/virtualworkspace/apidefinitions
Package apidefinitions turns the operator's webhook registry plus the APIExport/APIResourceSchema objects in kcp into the served API surface.
Package apidefinitions turns the operator's webhook registry plus the APIExport/APIResourceSchema objects in kcp into the served API surface.
pkg/virtualworkspace/apidomainkey
Package apidomainkey encodes which APIExport a request is being served for.
Package apidomainkey encodes which APIExport a request is being served for.
pkg/virtualworkspace/authorizer
Package authorizer gates access to the ephemeral virtual workspace.
Package authorizer gates access to the ephemeral virtual workspace.
pkg/virtualworkspace/builder
Package builder assembles the ephemeral virtual workspace.
Package builder assembles the ephemeral virtual workspace.
pkg/webhook
Package webhook implements the client half of the EphemeralReview contract.
Package webhook implements the client half of the EphemeralReview contract.
mcp
cmd
internal/access
Package access asks the access virtual workspace which workspaces a caller can see.
Package access asks the access virtual workspace which workspaces a caller can see.
internal/mcp
Package mcp serves the Model Context Protocol as a kcp virtual workspace.
Package mcp serves the Model Context Protocol as a kcp virtual workspace.
pkg/tools
Package tools is the shared kit for kcp MCP tools: the Scope authorization contract every tool operates within, plus helpers for GVR parsing and unstructured object handling.
Package tools is the shared kit for kcp MCP tools: the Scope authorization contract every tool operates within, plus helpers for GVR parsing and unstructured object handling.
pkg/tools/admin
Package admin provides read tools for kcp operator internals — LogicalClusters, Shards, Partitions and PartitionSets.
Package admin provides read tools for kcp operator internals — LogicalClusters, Shards, Partitions and PartitionSets.
pkg/tools/apis
Package apis provides read tools for the machinery of kcp's API sharing model — APIResourceSchemas and APIConversions.
Package apis provides read tools for the machinery of kcp's API sharing model — APIResourceSchemas and APIConversions.
pkg/tools/core
Package core is the default toolset: navigating the caller's workspaces (workspaces, APIBindings, APIExports, WorkspaceTypes, workspace lifecycle) plus generic read access to any resource by GVR.
Package core is the default toolset: navigating the caller's workspaces (workspaces, APIBindings, APIExports, WorkspaceTypes, workspace lifecycle) plus generic read access to any resource by GVR.
pkg/tools/write
Package write provides generic mutation tools — create, update, patch, delete and scale by GVR.
Package write provides generic mutation tools — create, update, patch, delete and scale by GVR.
pkg/toolsets
Package toolsets names the groups of MCP tools an operator can enable.
Package toolsets names the groups of MCP tools an operator can enable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL