Skip to content

feat(ensure_pvc): accept ReadWriteOncePod on imported archive PVCs#214

Merged
bdchatham merged 1 commit intomainfrom
feat/pvc-rwop-validation
May 8, 2026
Merged

feat(ensure_pvc): accept ReadWriteOncePod on imported archive PVCs#214
bdchatham merged 1 commit intomainfrom
feat/pvc-rwop-validation

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

@bdchatham bdchatham commented May 8, 2026

Closes #213.

Summary

Relaxes the imported-PVC validator to accept either ReadWriteOnce or ReadWriteOncePod. Both are single-writer access modes that satisfy the validator's intent. Previously the validator rejected RWOP-only PVCs with "accessModes does not include ReadWriteOnce".

This is the controller-side prerequisite for landing the SELinux-mount-labeling optimization on EKS 1.34. Platform-repo archive manifests will then ship accessModes: [ReadWriteOncePod], which activates SELinuxMountReadWriteOncePod (GA since K8s 1.27, default-on) and skips the ~20-minute recursive setxattr walk on the archive PVC every pod start.

Why RWOP and not seLinuxChangePolicy: MountOption

The cleaner standard fix (seLinuxChangePolicy: MountOption) requires the upstream SELinuxMount feature gate at the API server — default-off in K8s 1.33–1.36 and not exposed to customers on managed EKS (containers-roadmap#512, still open). RWOP sidesteps that constraint entirely.

Background and prior attempts: #202 (reverted by #206) and #207 (closed). #213 has the full analysis.

Files

File Change
internal/task/ensure_pvc.go Validator now accepts RWO or RWOP (3-line change)
internal/task/ensure_pvc_test.go New test: RWOP-only PVC passes validation; existing wrong-access-mode test still passes
.agent/runbooks/operating-archive-node-byov.md New §6.4 documenting the rationale, manifest examples updated, migration procedure for existing RWO archives, pre-flight checklist updated

Test plan

  • make test green locally for ./internal/task/... (the Error 1 from make test is a go-toolchain-version mismatch in my local env; the tests themselves all pass — ok internal/task 1.680s coverage: 46.1%)
  • CI test+lint green
  • Existing test TestEnsureDataPVC_Import_WrongAccessMode_Terminal still passes (verified locally — it now triggers because ReadOnlyMany doesn't include either RWO or RWOP)
  • New test TestEnsureDataPVC_Import_ReadWriteOncePod_AccessMode_Completes passes (verified locally)

Follow-ups (separate PRs, in sei-protocol/platform)

  • archive-1.yaml authored with RWOP from creation (eu-central-1a; pending fpsync completion)
  • archive-2.yaml ships RWOP from creation (future, eu-central-1c)
  • archive-0.yaml migration PR queued for next natural pod-restart event (next chain upgrade or image bump). Migration procedure documented in the updated runbook.

🤖 Generated with Claude Code


Note

Medium Risk
Touches controller-side validation for imported PVCs; a mistake could incorrectly accept/reject volumes and block node startup, though the change is small and covered by tests.

Overview
Allows imported data PVCs to satisfy the controller’s import validator with either ReadWriteOnce or ReadWriteOncePod (treated as acceptable single-writer modes), updating the terminal error message accordingly.

Adds a regression test ensuring an RWOP-only PV/PVC pair validates successfully, and updates the BYOV archive runbook to recommend RWOP by default, document SELinux mount-labeling performance implications, and provide a delete/recreate migration procedure plus checklist updates.

Reviewed by Cursor Bugbot for commit b85f8f7. Bugbot is set up for automated code reviews on this repo. Configure here.

…loses #213)

Relaxes the PVC import validator at internal/task/ensure_pvc.go to accept
either ReadWriteOnce OR ReadWriteOncePod. Both are single-writer access
modes that satisfy the validator's intent.

Why: archives on EKS 1.34 pay a ~20-minute recursive setxattr walk on
pod start because the kubelet relabels every inode for SELinux at mount
time. Setting accessModes: [ReadWriteOncePod] activates the GA-since-1.27
SELinuxMountReadWriteOncePod feature, which applies the label as a
per-mount option in milliseconds. The cleaner alternative
(seLinuxChangePolicy: MountOption) requires the SELinuxMount feature
gate at the API server — default-off in K8s 1.33–1.36 and not exposed
to customers on managed EKS (containers-roadmap#512).

This change is the controller-side prerequisite. Platform-repo archive
manifests (PV+PVC) flip independently to ship RWOP from creation
(archive-1 / archive-2) or migrate at next natural pod restart
(archive-0).

- internal/task/ensure_pvc.go: validator accepts RWO or RWOP
- internal/task/ensure_pvc_test.go: new test for RWOP-only PVC
- .agent/runbooks/operating-archive-node-byov.md: new §6.4 SELinux
  mount labeling section + migration procedure for existing RWO
  archives, manifest examples updated, validation contract updated

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit 069a866 into main May 8, 2026
3 checks passed
bdchatham added a commit that referenced this pull request May 8, 2026
…#215)

Pulls in #214 — internal/task/ensure_pvc.go now accepts either
ReadWriteOnce or ReadWriteOncePod on imported archive PVCs. Required
for the archive-0 PV/PVC RWOP migration (#213)
to land cleanly without the validator rejecting the new accessModes.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch BYOV archive PVCs to ReadWriteOncePod (EKS-1.34 path to SELinux mount labeling)

1 participant