posit-dev / posit-dev/team-operator

feat: support disabling workbench load balancing via Site CR

Open
#119 0 comments 0 reactions 0 assignees View on GitHub

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 to InternalWorkbenchSpec
  • internal/controller/core/site_controller_workbench.go — read field, conditionally set rserver config
  • internal/controller/core/workbench.go:684 — shared-storage PVC creation (already gated on LoadBalancingEnabled)
  • internal/controller/core/workbench.go:1046isLoadBalancingEnabled (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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.