From 1ab5f17caca0a950596f6dfd6e64eda318739e1e Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Tue, 16 Jun 2026 17:36:27 +0500 Subject: [PATCH] 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) Signed-off-by: Myasnikov Daniil --- packages/apps/kafka/templates/kafka.yaml | 21 +++++++++++++++++-- .../tests/entityoperator_template_test.yaml | 12 +++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/packages/apps/kafka/templates/kafka.yaml b/packages/apps/kafka/templates/kafka.yaml index 49876bacf..b2a65d24f 100644 --- a/packages/apps/kafka/templates/kafka.yaml +++ b/packages/apps/kafka/templates/kafka.yaml @@ -97,8 +97,25 @@ spec: name: {{ .Release.Name }}-metrics key: kafka-metrics-config.yml entityOperator: - topicOperator: {} - userOperator: {} + # Tenant namespaces ship a LimitRange that defaults containers to 128Mi. + # The topic-operator and user-operator are JVM processes and OOMKill at + # that default, leaving the entity-operator in CrashLoopBackOff so + # KafkaTopics/KafkaUsers never reconcile. Set explicit resources so they + # don't inherit the namespace default. + topicOperator: + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + memory: 512Mi + userOperator: + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + memory: 512Mi template: # `pod` accepts metadata + a flat set of pod-spec fields # (enableServiceLinks, securityContext, affinity, …) directly. diff --git a/packages/apps/kafka/tests/entityoperator_template_test.yaml b/packages/apps/kafka/tests/entityoperator_template_test.yaml index 95b792138..b17940013 100644 --- a/packages/apps/kafka/tests/entityoperator_template_test.yaml +++ b/packages/apps/kafka/tests/entityoperator_template_test.yaml @@ -20,3 +20,15 @@ tests: # the phantom template.spec key must not reappear - notExists: path: spec.entityOperator.template.spec + + - it: topic-operator and user-operator set explicit resources (avoid 128Mi LimitRange OOM) + release: + name: test-kafka + namespace: tenant-test + asserts: + - equal: + path: spec.entityOperator.topicOperator.resources.limits.memory + value: 512Mi + - equal: + path: spec.entityOperator.userOperator.resources.limits.memory + value: 512Mi