Skip to content

Closes #1902 Migrate Kafka from 3.2.1 + ZooKeeper to Strimzi Operator + Kafka 3.9 KRaft - #1907

Open
abhishek-1809 wants to merge 2 commits into
mosip:developfrom
abhishek-1809:develop
Open

abhishek-1809 wants to merge 2 commits into
mosip:developfrom
abhishek-1809:develop

Conversation

@abhishek-1809

@abhishek-1809 abhishek-1809 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a Strimzi-based Kafka cluster setup using KRaft, including broker and controller node pool manifests with persistent storage.
    • Introduced an updated Kafka installation flow that installs the operator, applies the cluster manifests, and reports readiness.
    • Added a dedicated cleanup script to remove Kafka/Strimzi resources.
  • Bug Fixes / Maintenance

    • Removed legacy Kafka installation, UI/Istio configuration, backup/restore, restart, and older Helm values to avoid outdated deployment paths.

…rator + Kafka 3.9 KRaft

Signed-off-by: abhishek-1809 <abhisahu1920@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cf7b372f-292d-44f8-9535-d89f2b529459

📥 Commits

Reviewing files that changed from the base of the PR and between f4c5f21 and 1d59ba7.

📒 Files selected for processing (1)
  • deployment/v3/external/kafka/kafka.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • deployment/v3/external/kafka/kafka.yaml

Walkthrough

This PR removes the legacy Kafka deployment assets and adds a Strimzi-based Kafka setup with broker and controller node pools, a Kafka custom resource, and scripts to install and delete the deployment.

Changes

Strimzi Kafka Migration

Layer / File(s) Summary
Strimzi node pool and cluster manifests
deployment/v3/external/kafka/broker-nodepool.yaml, deployment/v3/external/kafka/controller-nodepool.yaml, deployment/v3/external/kafka/kafka.yaml
New KafkaNodePool manifests define broker and controller roles with replicas, resource limits, and persistent storage; new Kafka CR enables KRaft mode, version 4.1.1, an internal listener on port 9092, and replication/min-ISR settings.
Install and delete scripts for Strimzi deployment
deployment/v3/external/kafka/install-kafka.sh, deployment/v3/external/kafka/delete-kafka.sh
New install script installs the Strimzi operator via Helm, applies node pool/Kafka manifests, waits for readiness, and reports status; new delete script removes those manifests, uninstalls the Helm release, and warns about manual PVC cleanup.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • mosip/mosip-infra#1859: Both PRs modify deployment/v3/external/kafka/values.yaml, removing Kafka KRaft-related configuration settings.

Suggested reviewers: ckm007

Poem

A rabbit watched old Kafka paths unwind,
Then Strimzi sprouts with orderly kind.
Brokers and controllers hop into place,
KRaft beats softly in the cluster’s space,
And `Ready` twinkles across the night. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Kafka migration from ZooKeeper/bitnami to Strimzi KRaft, which matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
deployment/v3/external/kafka/install-kafka.sh (1)

30-33: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

No kubectl wait for node pools before waiting on the Kafka resource.

The script proceeds straight to kubectl wait kafka/kafka --for=condition=Ready after applying the node pools; if node pool CRDs are slow to be picked up by the operator right after install, this could occasionally race. In practice kubectl wait on Ready should still succeed since it polls, so this is a minor robustness nit rather than a real defect.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deployment/v3/external/kafka/install-kafka.sh` around lines 30 - 33, Add a
readiness wait for the node pool resources before the existing kafka/kafka
kubectl wait in install-kafka.sh so the script does not race the operator right
after applying them. Use the same kubectl wait pattern already used for the
Kafka resource, and place it after the node pool apply step and before waiting
on Kafka, keeping the existing kafka/kafka wait in place.
deployment/v3/external/kafka/kafka.yaml (1)

1-35: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Missing entityOperator block.

Strimzi's reference examples for KRaft/node-pool deployments consistently include an entityOperator section (topicOperator: {}, userOperator: {}) to enable declarative KafkaTopic/KafkaUser management. Without it, topics/users must be managed manually via Kafka CLI/API. If MOSIP components rely on KafkaTopic/KafkaUser CRs elsewhere in the stack, this will silently not work.

♻️ Proposed addition
   min.insync.replicas: 2
+
+  entityOperator:
+    topicOperator: {}
+    userOperator: {}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deployment/v3/external/kafka/kafka.yaml` around lines 1 - 35, The Kafka
Strimzi manifest is missing the entityOperator configuration needed for
declarative topic/user management. Update the Kafka spec in kafka.yaml by adding
an entityOperator block alongside the existing kafka section, with both
topicOperator and userOperator enabled as empty objects, matching the standard
Strimzi KRaft/node-pool pattern. Use the Kafka resource definition as the anchor
so the new block is placed within spec and not inside kafka.config.
deployment/v3/external/kafka/delete-kafka.sh (1)

1-3: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

No set -e unlike the install script.

install-kafka.sh uses set -e but this script doesn't. Given most commands here already use --ignore-not-found=true or || true, failures are mostly tolerated by design, so this is a minor stylistic inconsistency rather than a functional bug.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deployment/v3/external/kafka/delete-kafka.sh` around lines 1 - 3, This script
is missing the same error-handling convention used by install-kafka.sh, so
update delete-kafka.sh to include set -e near the top for consistency with the
other Kafka deployment script. Keep the existing ignore-not-found/|| true
safeguards in place, and ensure the change is applied alongside the existing
NAMESPACE assignment in the script entrypoint.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@deployment/v3/external/kafka/delete-kafka.sh`:
- Around line 1-3: This script is missing the same error-handling convention
used by install-kafka.sh, so update delete-kafka.sh to include set -e near the
top for consistency with the other Kafka deployment script. Keep the existing
ignore-not-found/|| true safeguards in place, and ensure the change is applied
alongside the existing NAMESPACE assignment in the script entrypoint.

In `@deployment/v3/external/kafka/install-kafka.sh`:
- Around line 30-33: Add a readiness wait for the node pool resources before the
existing kafka/kafka kubectl wait in install-kafka.sh so the script does not
race the operator right after applying them. Use the same kubectl wait pattern
already used for the Kafka resource, and place it after the node pool apply step
and before waiting on Kafka, keeping the existing kafka/kafka wait in place.

In `@deployment/v3/external/kafka/kafka.yaml`:
- Around line 1-35: The Kafka Strimzi manifest is missing the entityOperator
configuration needed for declarative topic/user management. Update the Kafka
spec in kafka.yaml by adding an entityOperator block alongside the existing
kafka section, with both topicOperator and userOperator enabled as empty
objects, matching the standard Strimzi KRaft/node-pool pattern. Use the Kafka
resource definition as the anchor so the new block is placed within spec and not
inside kafka.config.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7f5bd37e-f8df-4bd4-9288-9b2b341e5e39

📥 Commits

Reviewing files that changed from the base of the PR and between 929c55b and f4c5f21.

📒 Files selected for processing (14)
  • deployment/v3/external/kafka/README.md
  • deployment/v3/external/kafka/backup.sh
  • deployment/v3/external/kafka/broker-nodepool.yaml
  • deployment/v3/external/kafka/controller-nodepool.yaml
  • deployment/v3/external/kafka/delete-kafka.sh
  • deployment/v3/external/kafka/delete.sh
  • deployment/v3/external/kafka/install-kafka.sh
  • deployment/v3/external/kafka/install.sh
  • deployment/v3/external/kafka/istio-addons-values.yaml
  • deployment/v3/external/kafka/kafka.yaml
  • deployment/v3/external/kafka/restart.sh
  • deployment/v3/external/kafka/restore.sh
  • deployment/v3/external/kafka/ui-values.yaml
  • deployment/v3/external/kafka/values.yaml
💤 Files with no reviewable changes (9)
  • deployment/v3/external/kafka/istio-addons-values.yaml
  • deployment/v3/external/kafka/README.md
  • deployment/v3/external/kafka/restart.sh
  • deployment/v3/external/kafka/ui-values.yaml
  • deployment/v3/external/kafka/delete.sh
  • deployment/v3/external/kafka/values.yaml
  • deployment/v3/external/kafka/restore.sh
  • deployment/v3/external/kafka/install.sh
  • deployment/v3/external/kafka/backup.sh

…rator + Kafka 3.9 KRaft

Signed-off-by: abhishek-1809 <abhisahu1920@gmail.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.

1 participant