Chaos Testing KubeDB Elasticsearch - #579
Open
fr-sarker wants to merge 1 commit into
Open
Conversation
Signed-off-by: Fazle Rabbi Sarker <fazlerabbi@appscode.com>
|
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 |
There was a problem hiding this comment.
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 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) |
|
|
||
| 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.