Summary
When users create an AxonOpsPlatform CR without specifying resources on the TimeSeries, Search, or Server components, the resulting containers run with no CPU/memory requests or limits (best-effort QoS
class). This causes unpredictable scheduling, OOM kills under memory pressure, and noisy-neighbour interference in shared clusters. This issue adds sensible default resource requests and limits derived from
each component's runtime characteristics, applied only when the user has not specified their own.
Dashboard defaults are explicitly out of scope for this issue.
Requirements
Heap size parser
Add a helper parseHeapSizeMi(heapSize string) (int64, error) that:
- Accepts
M/m (MiB) and G/g (GiB) suffixes: "1024M" → 1024, "2g" → 2048
- Rejects empty string, no suffix, bad suffix, decimals, zero, negative values
Default resource computation
TimeSeries and Search (JVM): memory = int64(heapMi * 1.5) MiB req/limit; CPU request 1000m, no CPU limit. Falls back to component default heap on parse error with a V(0) warning.
Server (Go): memory request 256Mi, limit 512Mi; CPU request 250m, no CPU limit.
Application logic
Applied only when component.Resources.Requests == nil. No CRD schema changes. No webhook. Dashboard explicitly excluded.
Acceptance Criteria
- TimeSeries with no resources →
1536Mi memory req/limit, 1000m CPU req, no CPU limit
- TimeSeries with
heapSize: "2048M" → 3072Mi memory
- TimeSeries with
heapSize: "invalid" → falls back to 1536Mi
- TimeSeries with explicit resources → user values preserved verbatim
- Search with no resources →
3072Mi memory req/limit, 1000m CPU req, no CPU limit
- Search with
heapSize: "4096M" → 6144Mi memory
- Search with
heapSize: "invalid" → falls back to 3072Mi
- Search with explicit resources → user values preserved verbatim
- Server with no resources →
256Mi req, 512Mi limit, 250m CPU req, no CPU limit
- Server with explicit resources → user values preserved verbatim
parseHeapSizeMi unit tests pass for valid and invalid inputs
- No public API signature changes
- No data race (
go test -race)
- Dashboard resources unchanged
make lint passes
Testing Requirements
TestParseHeapSizeMi_ValidInputs and TestParseHeapSizeMi_InvalidInputs (table-driven)
TestParseHeapSizeMi_ArbitraryString_NeverPanics (property-based, testing/quick)
- Envtest:
TestEnsureTimeseriesStatefulSet_DefaultResources_AppliedWhenOmitted, _CustomHeap_ScalesMemory, _InvalidHeap_FallsBackToDefault, _UserResources_NotOverridden
- Envtest: same 4 variants for Search and 2 for Server
TestDashboardResources_Unchanged
- BDD:
test/bdd/default-resources.feature already exists with 15 scenarios
Documentation Requirements
- Godoc on
parseHeapSizeMi
- CHANGELOG
Added entry describing the defaults
- Helm
values.yaml comments on timeSeries.resources, search.resources, server.resources
Dependencies & Blockers
Summary
When users create an
AxonOpsPlatformCR without specifyingresourceson the TimeSeries, Search, or Server components, the resulting containers run with no CPU/memory requests or limits (best-effort QoSclass). This causes unpredictable scheduling, OOM kills under memory pressure, and noisy-neighbour interference in shared clusters. This issue adds sensible default resource requests and limits derived from
each component's runtime characteristics, applied only when the user has not specified their own.
Dashboard defaults are explicitly out of scope for this issue.
Requirements
Heap size parser
Add a helper
parseHeapSizeMi(heapSize string) (int64, error)that:M/m(MiB) andG/g(GiB) suffixes:"1024M"→ 1024,"2g"→ 2048Default resource computation
TimeSeries and Search (JVM): memory =
int64(heapMi * 1.5)MiB req/limit; CPU request1000m, no CPU limit. Falls back to component default heap on parse error with aV(0)warning.Server (Go): memory request
256Mi, limit512Mi; CPU request250m, no CPU limit.Application logic
Applied only when
component.Resources.Requests == nil. No CRD schema changes. No webhook. Dashboard explicitly excluded.Acceptance Criteria
1536Mimemory req/limit,1000mCPU req, no CPU limitheapSize: "2048M"→3072MimemoryheapSize: "invalid"→ falls back to1536Mi3072Mimemory req/limit,1000mCPU req, no CPU limitheapSize: "4096M"→6144MimemoryheapSize: "invalid"→ falls back to3072Mi256Mireq,512Milimit,250mCPU req, no CPU limitparseHeapSizeMiunit tests pass for valid and invalid inputsgo test -race)make lintpassesTesting Requirements
TestParseHeapSizeMi_ValidInputsandTestParseHeapSizeMi_InvalidInputs(table-driven)TestParseHeapSizeMi_ArbitraryString_NeverPanics(property-based,testing/quick)TestEnsureTimeseriesStatefulSet_DefaultResources_AppliedWhenOmitted,_CustomHeap_ScalesMemory,_InvalidHeap_FallsBackToDefault,_UserResources_NotOverriddenTestDashboardResources_Unchangedtest/bdd/default-resources.featurealready exists with 15 scenariosDocumentation Requirements
parseHeapSizeMiAddedentry describing the defaultsvalues.yamlcomments ontimeSeries.resources,search.resources,server.resourcesDependencies & Blockers