posit-dev / posit-dev/team-operator
feat: support disabling workbench load balancing via Site CR
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 10
- Forks
- 1
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
Problem
Workbench load balancing is hardcoded to enabled (load-balancing-enabled: 1) in site_controller_workbench.go:131. This causes the operator to always create a shared-storage PVC (<site>-workbench-shared-storage) that requires a StorageClass matching the VolumeSource naming convention (e.g. <site>-workbench-shared-storage-nfs).
When managing storage directly (setting volume.storageClassName rather than using a Site-level VolumeSource), this PVC references a StorageClass that doesn't exist, preventing workbench from starting.
Proposed Solution
Add a loadBalancingEnabled field to InternalWorkbenchSpec in site_types.go:
// LoadBalancingEnabled enables workbench load balancing with shared storage.
// Defaults to true. Set to false to disable shared-storage PVC creation
// and load-balancer init containers.
LoadBalancingEnabled *bool `json:"loadBalancingEnabled,omitempty"`
In site_controller_workbench.go, default to true (preserving current behavior) but respect false by setting LoadBalancingEnabled: 0 and ServerSharedStoragePath: "" on the generated Workbench resource.
Affected Code
api/core/v1beta1/site_types.go— add field toInternalWorkbenchSpecinternal/controller/core/site_controller_workbench.go— read field, conditionally set rserver configinternal/controller/core/workbench.go:684— shared-storage PVC creation (already gated onLoadBalancingEnabled)internal/controller/core/workbench.go:1046—isLoadBalancingEnabled(already gated)
Usage
spec:
workbench:
loadBalancingEnabled: false # disables shared-storage PVC and LB init containers
volume:
create: true
size: 10Gi
storageClassName: nfs
accessModes:
- ReadWriteMany
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with api/core/v1beta1/site_types.go and internal/controller/core/site_controller_workbench.go, then inspect the existing gates at internal/controller/core/workbench.go:684 and :1046. Confirm how the generated Workbench resource is configured and verify that the default preserves current behavior while false prevents shared-storage PVC and load-balancer init-container creation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100