Documentation
¶
Overview ¶
Package operator reconciles the tenancy API into kcp workspaces and RBAC.
It runs one manager per APIExport, and that is the whole security design: each manager can only see and touch the clusters that bound its export, with only the verbs that export claims. Nothing here holds an admin client, and no write happens outside a claim.
platform Tenants, in the platform workspace.
tenancy Projects and Memberships, in each tenant workspace.
provisioner creates and deletes Workspace objects, in the two tiers
that have children: the platform workspace and each tenant
workspace.
access writes namespaces and RBAC, in project workspaces only.
A Membership never materializes in the tenant workspace, only in project workspaces. The tenant tier holds the objects that decide who may reach what, so no binding there names any tenant identity — that tier is unreachable by construction rather than by a check.
Index ¶
- func DesiredBinding(membership *tenancyv1alpha1.Membership) (*rbacv1.ClusterRoleBinding, error)
- func DesiredClusterRole(role tenancyv1alpha1.Role) (*rbacv1.ClusterRole, error)
- func MembershipBindingName(membershipName string) string
- func RoleClusterRoleName(role tenancyv1alpha1.Role) string
- func Run(ctx context.Context, opts Options) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DesiredBinding ¶
func DesiredBinding(membership *tenancyv1alpha1.Membership) (*rbacv1.ClusterRoleBinding, error)
DesiredBinding returns the ClusterRoleBinding for a Membership.
func DesiredClusterRole ¶
func DesiredClusterRole(role tenancyv1alpha1.Role) (*rbacv1.ClusterRole, error)
DesiredClusterRole returns the ClusterRole for a role. Every role also carries kcp's workspace-content `access` verb: without it a subject can hold resource permissions in a workspace it cannot enter.
func MembershipBindingName ¶
MembershipBindingName is the name of the ClusterRoleBinding materialized for a Membership. Deterministic in the membership's name so reconciles converge and deletion knows what to remove.
func RoleClusterRoleName ¶
func RoleClusterRoleName(role tenancyv1alpha1.Role) string
RoleClusterRoleName is the name of the ClusterRole materialized for a role in a target workspace.
Types ¶
type Options ¶
type Options struct {
// RestConfig reaches the kcp shard hosting the tenancy APIExports.
RestConfig *rest.Config
// Slice names, one per export. Defaults match what init installs.
PlatformSlice string
TenancySlice string
ProvisionerSlice string
AccessSlice string
// Strategy names workspaces after tenants and projects.
Strategy naming.Strategy
// ExportsPath is where the WorkspaceTypes live; Workspace objects
// reference their type by path.
ExportsPath string
// TenantsPath is the workspace every tenant workspace is created
// under. It is deliberately not the workspace Tenant records live in,
// so the operator resolves it once rather than deriving it from the
// object it is reconciling.
TenantsPath string
}
Options configures the operator.