Skip to content

fix(helm): template reindex ES cronjob SEARCH_HOST instead of hardcoding prod host [sc-44754] - #3397

Open
yodem wants to merge 1 commit into
masterfrom
fix/sc-44754/reindex-es-search-host
Open

fix(helm): template reindex ES cronjob SEARCH_HOST instead of hardcoding prod host [sc-44754]#3397
yodem wants to merge 1 commit into
masterfrom
fix/sc-44754/reindex-es-search-host

Conversation

@yodem

@yodem yodem commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

The reindex-elastic-search CronJob template hardcodes the production Elasticsearch hostname, so the job cannot run in the dev cluster / cauldrons.

helm-chart/sefaria/templates/cronjob/reindex-elasticsearch.yaml:

- name: SEARCH_HOST
  value: "elasticsearch-1b-es-http.elasticsearch.svc"   # prod-only name

That name doesn't resolve in dev. ES is healthy there — the services that actually exist in the dev elasticsearch namespace are:

elasticsearch-es-default   ClusterIP None         9200/TCP   (headless)
elasticsearch-es-http      ClusterIP 10.11.250.34 9200/TCP   (HTTP svc)

Reported by Steve while trying to run a reindex job for the sk-squad-feature cauldron (had to sed the host to work around it).

Root cause

This was the only cronjob template hardcoding SEARCH_HOST. The sibling index-from-queue.yaml already templates it from .Values.nginx.SEARCH_HOST.

Fix

Template SEARCH_HOST from .Values.nginx.SEARCH_HOST, matching index-from-queue.yaml.

  • prod (envs/prod/helmrelease.yaml) and preprod (build/ci/preprod-values.yaml) override nginx.SEARCH_HOST to elasticsearch-1b-es-http.elasticsearch.svcbehavior unchanged.
  • dev / cauldrons don't override it → inherit the chart default elasticsearch-es-default.elasticsearch, which resolves in dev.

Verified with helm template:

values rendered SEARCH_HOST
default (dev/cauldron) elasticsearch-es-default.elasticsearch
prod/preprod override elasticsearch-1b-es-http.elasticsearch.svc

Chart-level fix, not a per-cauldron patch.

Notes

  • cronJobs.reindexElasticSearch.SEARCH_HOST_ES6/ES8 in values.yaml are dead config (referenced nowhere) — left for a follow-up cleanup.

Story: sc-44754

🤖 Generated with Claude Code

…ing prod host [sc-44754]

The reindex-elastic-search CronJob hardcoded the production ES hostname
"elasticsearch-1b-es-http.elasticsearch.svc", which does not resolve in the
dev cluster, so the job could not run in dev/cauldrons (e.g. sk-squad-feature).

Template SEARCH_HOST from .Values.nginx.SEARCH_HOST, matching the sibling
index-from-queue cronjob. prod/preprod override nginx.SEARCH_HOST to the prod
host (unchanged behavior); dev/cauldrons inherit the working default
elasticsearch-es-default.elasticsearch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 1/100

11 × 0.1 (Nano ESF) = 1.1, floored to 1

Category Score Factors
🔭 Scope 2/20 Single file, single line infrastructure config change
🏗️ Architecture 2/20 Minor improvement: removes hardcoded value, improves configurability across environments
⚙️ Implementation 1/20 Trivial Helm template variable substitution
⚠️ Risk 4/20 Infrastructure change; no default value guard means missing .Values.nginx.SEARCH_HOST silently produces empty string; odd namespace (nginx) for elasticsearch config
✅ Quality 1/15 No tests, no documentation, no values file update shown in PR
🔒 Perf / Security 1/5 Minor security improvement by removing hardcoded internal hostname from template

Was this score accurate? 👍 Yes · 👎 No

Scored by GitVelocity · How are scores calculated?

@yodem
yodem requested a review from Copilot June 15, 2026 06:32

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants