Skip to content

Ingester Replica Count via env variable#4

Open
kapjain-rh wants to merge 1 commit into
netobserv:mainfrom
kapjain-rh:lokistack
Open

Ingester Replica Count via env variable#4
kapjain-rh wants to merge 1 commit into
netobserv:mainfrom
kapjain-rh:lokistack

Conversation

@kapjain-rh
Copy link
Copy Markdown
Member

@kapjain-rh kapjain-rh commented Apr 14, 2026

Summary by CodeRabbit

  • Chores
    • Made ingester replica configuration more flexible by enabling deployment parameter override. Default replica count remains at 2, allowing operators to adjust scaling without code modifications.

@openshift-ci openshift-ci Bot requested review from Amoghrd and mffiedler April 14, 2026 15:19
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kapjain-rh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@kapjain-rh has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 986bd05f-3302-4c56-8e1d-f458fc456349

📥 Commits

Reviewing files that changed from the base of the PR and between 0f4ca27 and d89dfc6.

📒 Files selected for processing (3)
  • scripts/env.sh
  • scripts/loki/lokistack.yaml
  • scripts/netobserv.sh
📝 Walkthrough

Walkthrough

Added a configurable environment variable INGESTER_REPLICAS with a default value of 2 to support dynamic ingester replica scaling. Updated the LokiStack template to reference this variable instead of using a hardcoded replica count.

Changes

Cohort / File(s) Summary
Ingester Replica Configuration
scripts/env.sh, scripts/loki/lokistack.yaml
Introduced INGESTER_REPLICAS environment variable (default 2) and updated LokiStack template to use ${{INGESTER_REPLICAS}} parameter instead of hardcoded replica count, allowing flexible scaling configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: making ingester replica count configurable via environment variables instead of hardcoded.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/env.sh`:
- Around line 7-8: The inline comment above TOPIC_PARTITIONS is incorrect — it
says the default is '6' while the variable is exported as 48; update the comment
to reflect the actual default (change the comment text to 'will use "48" if not
set') or if the intended default is 6, change the export to export
TOPIC_PARTITIONS=6; locate the TOPIC_PARTITIONS export in the env.sh snippet and
make the comment and value consistent.
- Around line 9-10: The INGESTER_REPLICAS environment variable exported in
INGESTER_REPLICAS should be forwarded into the OpenShift template processing
call: update the oc process invocation that builds the Lokistack (the oc process
command in scripts/netobserv.sh) to include -p
INGESTER_REPLICAS=$INGESTER_REPLICAS so the template parameter overrides the
default; ensure the variable name matches the exported INGESTER_REPLICAS and is
quoted/expanded the same way other -p parameters are handled in that oc process
call.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d771adc5-9798-494f-92e9-f0b2cddafbc9

📥 Commits

Reviewing files that changed from the base of the PR and between 8c1636c and 0f4ca27.

📒 Files selected for processing (2)
  • scripts/env.sh
  • scripts/loki/lokistack.yaml

Comment thread scripts/env.sh
Comment on lines +7 to 8
# will use '6' if not set
export TOPIC_PARTITIONS=48
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.

⚠️ Potential issue | 🟡 Minor

Default-value comment is stale.

Line 7 says default is '6', but Line 8 sets TOPIC_PARTITIONS=48. Please align the comment with actual behavior.

Proposed fix
-# will use '6' if not set
+# will use '48' if not set
 export TOPIC_PARTITIONS=48
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# will use '6' if not set
export TOPIC_PARTITIONS=48
# will use '48' if not set
export TOPIC_PARTITIONS=48
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/env.sh` around lines 7 - 8, The inline comment above TOPIC_PARTITIONS
is incorrect — it says the default is '6' while the variable is exported as 48;
update the comment to reflect the actual default (change the comment text to
'will use "48" if not set') or if the intended default is 6, change the export
to export TOPIC_PARTITIONS=6; locate the TOPIC_PARTITIONS export in the env.sh
snippet and make the comment and value consistent.

Comment thread scripts/env.sh
@kapjain-rh
Copy link
Copy Markdown
Member Author

/test test-deploy

Comment thread scripts/netobserv.sh
Comment on lines +319 to +323
if [[ -z $INGESTER_REPLICAS ]]; then
echo "====> No ingester replicas config was found - using '2'"
echo "====> To set config, set INGESTER_REPLICAS variable to desired number"
export INGESTER_REPLICAS=2
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we set this only for 1x.demo?

effect: NoExecute
ingester:
replicas: 2
replicas: ${INGESTER_REPLICAS}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how can we set this config only for 1x.demo size? could we do more templating around this config?

@kapjain-rh
Copy link
Copy Markdown
Member Author

/test test-deploy

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 15, 2026

@kapjain-rh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/test-deploy d89dfc6 link false /test test-deploy

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 16, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants