feat: allow Connect content pods to run on tainted session nodes#150
feat: allow Connect content pods to run on tainted session nodes#150amdove wants to merge 2 commits into
Conversation
Extends the existing Workbench session toleration/placement mechanism to Connect content (off-host execution) pods via new contentTolerations and contentNodeSelector fields on the Connect site spec. These are applied only to content pods, not the Connect server, mirroring how Workbench session tolerations work.
|
Claude finished @amdove's task in 1m 41s —— View job Review
The implementation is clean and the pattern is correct. A few observations: Missing tests: Asymmetry in Connect spec: Workbench has both a universal Everything else looks good: the wiring at |
| @@ -284,6 +284,12 @@ type InternalConnectSpec struct { | |||
|
|
|||
| NodeSelector map[string]string `json:"nodeSelector,omitempty"` | |||
There was a problem hiding this comment.
Suggestion: The Workbench spec differentiates between server-level NodeSelector/Tolerations (applied universally) and session-only ones. For Connect, NodeSelector at this line applies to the server pod (line 148 in the controller), but there's no server-level Tolerations equivalent. If Connect server pods need to run on tainted nodes (e.g., to co-locate with Karpenter-provisioned infra), there's currently no way to do that. Worth noting in docs or adding a Tolerations field to mirror Workbench's server-level one — but fine to defer if not needed yet.
|
Thanks for the review. Addressed both points:
|
Lytol
left a comment
There was a problem hiding this comment.
Awesome! Same as my comment on the ptd side: we should probably do some end-to-end verification on internal infra before merging.
Description
Extends the existing Workbench session toleration/placement capability to Posit Connect content pods. Connect content (off-host execution) pods can now be both permitted onto (via tolerations) and directed to (via a node selector) tainted Karpenter session nodes, exactly mirroring how Workbench session pods already work.
Two new optional fields are added to the Connect site spec:
contentTolerations— tolerations applied only to Connect content (session) pods, not the Connect server.contentNodeSelector— a node selector applied only to Connect content (session) pods, not the Connect server.This directly parallels the existing Workbench
sessionTolerationsmechanism, but for Connect's content pods.Code Flow
api/core/v1beta1/site_types.go: addsContentTolerationsandContentNodeSelectortoInternalConnectSpec.internal/controller/core/site_controller_connect.go: wires those fields into the ConnectSessionConfig.Pod(product.PodConfig) asTolerationsandNodeSelector, mirroringsite_controller_workbench.gowhich sets sessionTolerations/NodeSelectorfor Workbench session pods.api/templates/*/job.tplalready renderspod.tolerationsandpod.nodeSelector.just mgenerate/ the Helm chart generation hook.Category of change
Checklist
Companion PR: posit-dev/ptd#356 — emits the
spec.connect.contentTolerations/contentNodeSelectorvalues consumed by the fields added here. These two PRs go together; merge this one first.