Skip to content

Commit 1ab5f17

Browse files
fix(kafka): set entity-operator resources to avoid OOM under tenant LimitRange
entityOperator.topicOperator/userOperator carried no resources, so in tenant namespaces (the LimitRange defaults containers to 128Mi) the JVM topic-operator and user-operator are OOMKilled on startup. The entity-operator stays in CrashLoopBackOff, KafkaTopics/KafkaUsers never reconcile, and on teardown topics get stuck on the strimzi.io/topic-operator finalizer. Set explicit requests/limits (256Mi/512Mi) so they no longer inherit the namespace default; add a template test. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 27442bd commit 1ab5f17

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

‎packages/apps/kafka/templates/kafka.yaml‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,25 @@ spec:
9797
name: {{ .Release.Name }}-metrics
9898
key: kafka-metrics-config.yml
9999
entityOperator:
100-
topicOperator: {}
101-
userOperator: {}
100+
# Tenant namespaces ship a LimitRange that defaults containers to 128Mi.
101+
# The topic-operator and user-operator are JVM processes and OOMKill at
102+
# that default, leaving the entity-operator in CrashLoopBackOff so
103+
# KafkaTopics/KafkaUsers never reconcile. Set explicit resources so they
104+
# don't inherit the namespace default.
105+
topicOperator:
106+
resources:
107+
requests:
108+
cpu: 100m
109+
memory: 256Mi
110+
limits:
111+
memory: 512Mi
112+
userOperator:
113+
resources:
114+
requests:
115+
cpu: 100m
116+
memory: 256Mi
117+
limits:
118+
memory: 512Mi
102119
template:
103120
# `pod` accepts metadata + a flat set of pod-spec fields
104121
# (enableServiceLinks, securityContext, affinity, …) directly.

‎packages/apps/kafka/tests/entityoperator_template_test.yaml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,15 @@ tests:
2020
# the phantom template.spec key must not reappear
2121
- notExists:
2222
path: spec.entityOperator.template.spec
23+
24+
- it: topic-operator and user-operator set explicit resources (avoid 128Mi LimitRange OOM)
25+
release:
26+
name: test-kafka
27+
namespace: tenant-test
28+
asserts:
29+
- equal:
30+
path: spec.entityOperator.topicOperator.resources.limits.memory
31+
value: 512Mi
32+
- equal:
33+
path: spec.entityOperator.userOperator.resources.limits.memory
34+
value: 512Mi

0 commit comments

Comments
 (0)