Skip to content

Comments

[Document Engine] Add StatefulSet support with persistent storage#118

Open
lazyoldbear wants to merge 4 commits intomasterfrom
lazyoldbear/docengine-statefulset
Open

[Document Engine] Add StatefulSet support with persistent storage#118
lazyoldbear wants to merge 4 commits intomasterfrom
lazyoldbear/docengine-statefulset

Conversation

@lazyoldbear
Copy link
Collaborator

Summary

This introduces configurable Deployment/StatefulSet workload type for Document Engine, enabling per-pod persistent volumes via volumeClaimTemplates. Default remains Deployment for backward compatibility.

Changes

  • Extracted pod template into _pod-template.tpl shared by both workload types
  • Added document-engine.isStatefulSet helper to centralize condition logic (no more | default in templates)
  • Refactored scheduling and certificate trust into reusable helpers, reducing duplication in migration job
  • StatefulSet uses stable pod identities with configurable persistent storage (storageClass, size, mountPath)
  • Headless service now created for StatefulSet (required for serviceName)
  • HPA dynamically targets correct workload kind
  • Chart version bumped to 8.0.0 (major architectural change)

Test Coverage

  • Modified CI tests 02-cnpg-clustering-values.yaml and 05-envoy-sidecar-values.yaml to test StatefulSet mode
  • All 7 CI value files pass helm lint
  • Default Deployment mode produces identical output (no regression)
  • StatefulSet mode correctly renders volumeClaimTemplates, persistent volume mount, headless service

🤖 Generated with Claude Code

@lazyoldbear lazyoldbear changed the title feat: Add StatefulSet support with persistent storage [Document Engine] Add StatefulSet support with persistent storage Feb 25, 2026
@lazyoldbear lazyoldbear self-assigned this Feb 25, 2026
lazyoldbear and others added 2 commits February 25, 2026 01:35
This introduces a configurable workload type (`Deployment` or `StatefulSet`) allowing users to deploy Document Engine pods with stable identities and per-pod persistent volumes via volumeClaimTemplates. Default remains Deployment for backward compatibility.

Key changes:
- Extracted pod template into _pod-template.tpl for reuse by both workload types
- Added `document-engine.isStatefulSet` helper to centralize condition logic
- Refactored scheduling and certificate trust helpers to reduce duplication in migration job
- Updated headless service to be created for StatefulSet (required by serviceName)
- Updated HPA to dynamically target StatefulSet when workloadType changes
- Added `workloadType`, `podManagementPolicy`, and `persistence` configuration values
- Modified CI tests 02 (clustering) and 05 (envoy-sidecar) to test StatefulSet with persistent storage

Backward compatible: Default `workloadType: Deployment` produces identical output to previous version. StatefulSet volumes are mounted at /data with configurable storageClass and size. Chart version bumped to 8.0.0 (major change due to architectural flexibility).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lazyoldbear lazyoldbear force-pushed the lazyoldbear/docengine-statefulset branch from ea60fc5 to 1c67356 Compare February 25, 2026 00:35
lazyoldbear and others added 2 commits February 25, 2026 01:36
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lazyoldbear lazyoldbear requested review from bejoygm and zrzka February 25, 2026 00:38
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.

1 participant