Skip to content

Chaos Testing KubeDB Elasticsearch - #579

Merged
tamalsaha merged 2 commits into
masterfrom
es-chaos-eng
Aug 13, 2026
Merged

Chaos Testing KubeDB Elasticsearch#579
tamalsaha merged 2 commits into
masterfrom
es-chaos-eng

Conversation

@fr-sarker

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 22, 2026 09:46
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit f0a0932):

https://blog-v1-hugo--pr579-es-chaos-eng-lotf6q66.web.app

(expires Thu, 20 Aug 2026 17:02:16 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: ddacb919f90a98185619681ef0da6429c962b808

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new long-form blog post documenting chaos engineering experiments against a KubeDB-managed Elasticsearch cluster using Chaos Mesh, including setup steps, a continuous load generator, 21 failure scenarios, and a results summary to demonstrate shard resilience and failover behavior.

Changes:

  • Introduces a full tutorial for deploying an HA Elasticsearch topology via KubeDB and validating behavior under controlled chaos.
  • Includes a curl-based continuous index/search load client and verification approach to detect acknowledged-write data loss.
  • Summarizes outcomes across 21 experiments with recovery times, health transitions, and key operational takeaways.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread content/post/chaos-testing-elasticsearch/index.md
Comment on lines +293 to +313
C="curl -s -k -u ${USER}:${PASS}"
committed=0; idx_ok=0; idx_fail=0; search_ok=0; search_fail=0
start=$(date +%s); last_report=$start
until $C "${URL}/_cluster/health" | grep -qE '"status":"(green|yellow)"'; do sleep 3; done
$C -X PUT "${URL}/${INDEX}" -H 'Content-Type: application/json' \
-d '{"settings":{"number_of_shards":3,"number_of_replicas":1,"index.write.wait_for_active_shards":"1"}}' >/dev/null
while [ $(( $(date +%s) - start )) -lt "$DURATION" ]; do
ts=$(date -u +%FT%TZ); i=$committed; end=$(( committed + BATCH )); : > /tmp/bulk
while [ $i -lt $end ]; do
printf '{"index":{"_id":"%s"}}\n{"n":%s,"ts":"%s","pad":"chaos-load-doc"}\n' "$i" "$i" "$ts" >> /tmp/bulk
i=$(( i + 1 ))
done
resp=$($C -X POST "${URL}/${INDEX}/_bulk" -H 'Content-Type: application/x-ndjson' --data-binary @/tmp/bulk)
if echo "$resp" | grep -q '"errors":false'; then
committed=$(( committed + BATCH )); idx_ok=$(( idx_ok + 1 ))
else idx_fail=$(( idx_fail + 1 )); sleep 0.3; fi
if [ $(( (idx_ok + idx_fail) % 5 )) -eq 0 ]; then
if $C "${URL}/${INDEX}/_search?size=0&q=*:*" | grep -q '"total"'; then
search_ok=$(( search_ok + 1 )); else search_fail=$(( search_fail + 1 )); fi
fi
now=$(date +%s)
Comment thread content/post/chaos-testing-elasticsearch/index.md
Comment thread content/post/chaos-testing-elasticsearch/index.md Outdated
Comment thread content/post/chaos-testing-elasticsearch/index.md Outdated
Signed-off-by: Fazle Rabbi Sarker <fazlerabbi@appscode.com>
- Quote curl credentials properly in load.sh to avoid breaking on
  special characters (use a shell function instead of a command string)
- Note that dashboard.securityMode=false is dev-only and link to the
  production installation guide for proper auth setup
- Fix minor grammar nits (instructions plural, request new features)

Signed-off-by: Tamal Saha <tamal@appscode.com>
@appscode appscode deleted a comment from CLAassistant Aug 13, 2026
@tamalsaha
tamalsaha merged commit a3edb21 into master Aug 13, 2026
6 of 7 checks passed
@tamalsaha
tamalsaha deleted the es-chaos-eng branch August 13, 2026 17:03
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.

3 participants