Skip to content

Chaos Testing KubeDB Elasticsearch - #579

Open
fr-sarker wants to merge 1 commit into
masterfrom
es-chaos-eng
Open

Chaos Testing KubeDB Elasticsearch#579
fr-sarker wants to merge 1 commit into
masterfrom
es-chaos-eng

Conversation

@fr-sarker

Copy link
Copy Markdown

No description provided.

Signed-off-by: Fazle Rabbi Sarker <fazlerabbi@appscode.com>
Copilot AI review requested due to automatic review settings July 22, 2026 09:46
@github-actions

Copy link
Copy Markdown

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

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

(expires Wed, 29 Jul 2026 09:47:47 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

To receive product announcements, follow us on [Twitter](https://twitter.com/KubeDB).

If you have found a bug with KubeDB or want to request for new features, please [file an issue](https://github.com/kubedb/project/issues/new).
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