Skip to content

WIP: Increase etcd pod-disruption severity to simulate a real failure#82272

Open
oharan2 wants to merge 5 commits into
openshift:mainfrom
oharan2:chaos_poc
Open

WIP: Increase etcd pod-disruption severity to simulate a real failure#82272
oharan2 wants to merge 5 commits into
openshift:mainfrom
oharan2:chaos_poc

Conversation

@oharan2

@oharan2 oharan2 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR intentionally increases the severity of the redhat-chaos-pod-scenarios-etcd-disruption step so that a CI run actually exercises Krkn's post-chaos gating checks, instead of completing "clean" every time.

Today, with the default DISRUPTION_COUNT=1, EXPECTED_RECOVERY_TIME=101, and WAIT_DURATION=300, etcd has enough time to recover a single killed pod before Krkn ever checks recovery status or Prometheus alerts. As a result, the step almost always passes and the gating logic (recovery check + CHECK_CRITICAL_ALERTS) is never really put to the test in this pipeline.

Changes

In redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml:

  • DISRUPTION_COUNT: Kills 6 of 6 etcd pods, breaking quorum instead of a single, easily-tolerated pod loss.
  • WAIT_DURATION: (Decreased to 15) key change - shrinks the pause before the post-chaos alert check, so Krkn queries Prometheus while etcd is still degraded, giving CHECK_CRITICAL_ALERTS (already True) a real window to catch actual firing critical alerts instead of checking after everything has already self-healed.

Why this matters

CHECK_CRITICAL_ALERTS is a post-chaos gate: Krkn queries Prometheus after the scenario and exits non-zero if any severity: critical alert is firing. With the previous defaults, the long WAIT_DURATION let etcd fully recover before that check ran, so the gate was effectively never exercised in this job — a real quorum-loss/critical-alert scenario could pass through undetected. This change is meant to prove out (and validate) that gating actually fires when etcd is genuinely unhealthy.

Expected outcome

This is expected to fail the etcd-disruption step (the point of this POC). It's a controlled way to confirm:

  1. Krkn's recovery check correctly flags pods that don't recover in time.
  2. CHECK_CRITICAL_ALERTS correctly catches and gates on real critical alerts fired during quorum loss.

NOTE: This is a WIP/POC change to validate gating behavior, not intended to merge into steady-state defaults for this shared step.

Summary by CodeRabbit

Updates the OpenShift 4.22 AWS Krkn hub test configuration to override disruption settings, including the number of disrupted pods, expected pod count, pod label, and wait duration. This increases the etcd failure scenario’s severity to exercise recovery and critical-alert handling.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 22, 2026
@openshift-ci
openshift-ci Bot requested review from mffiedler and paigerube14 July 22, 2026 08:21
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The AWS hub tests job environment now includes disruption count, expected pod count, pod label, and wait duration variables while preserving existing component and telemetry settings.

Changes

AWS hub chaos configuration

Layer / File(s) Summary
Configure AWS hub test expectations
ci-operator/config/redhat-chaos/lp-chaos/...yaml
The job environment adds disruption and pod-wait settings while retaining component and telemetry environment variables.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: mffiedler, paigerube14

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR only changes a CI config YAML env block; no Ginkgo It/Describe/Context/When titles were added or modified.
Test Structure And Quality ✅ Passed Only a ci-operator YAML changed; no Ginkgo test code or assertions were modified, so the test-structure review is not applicable.
Microshift Test Compatibility ✅ Passed PR only changes a ci-operator job YAML env block; no new Ginkgo e2e tests or MicroShift-relevant test code were added, so the check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only a CI config YAML changed; no Ginkgo e2e tests were added or modified, so the SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The only change is chaos test env overrides in ci-operator config; it introduces no pod affinity, node selectors, replicas, or other topology-dependent scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR only edits a ci-operator YAML env block; no Go/binary code, suite setup, or stdout-writing paths were changed.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only changes job env vars in ci-operator YAML; no new Ginkgo tests or IPv4/external-network assumptions were added.
No-Weak-Crypto ✅ Passed The PR only adjusts chaos-job env vars; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons were introduced.
Container-Privileges ✅ Passed PASS: The only modified YAML adjusts job env vars; no privileged/hostPID/hostNetwork/hostIPC/SYS_ADMIN/allowPrivilegeEscalation/root settings were added.
No-Sensitive-Data-In-Logs ✅ Passed PASS: The PR only adjusts ci-operator env values in a YAML config; no logging code or new secrets/PII/token fields were added.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main intent of the change: making the etcd disruption scenario more severe to simulate a real failure.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@oharan2

oharan2 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-redhat-chaos-lp-chaos-main-ocp-4.22-ocp-chaos-cr--ocp--krkn-hub-tests--aws

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@oharan2: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@oharan2, pj-rehearse: unable to determine affected jobs. This could be due to a branch that needs to be rebased. ERROR:

could not determine changed registry steps: could not load step registry: failed to load registry file /var/tmp/gitrepo3320603498/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml: error converting YAML to JSON: yaml: line 40: did not find expected key
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml`:
- Around line 38-39: Fix the WAIT_DURATION entry in the pod scenario reference
by closing its quoted default value, ensuring the YAML parses correctly while
preserving the existing value of 90.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 01becfde-0625-43ae-8883-ad1365030b42

📥 Commits

Reviewing files that changed from the base of the PR and between 4a34420 and 4ee7111.

📒 Files selected for processing (1)
  • ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml

@oharan2

oharan2 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-redhat-chaos-lp-chaos-main-ocp-4.22-ocp-chaos-cr--ocp--krkn-hub-tests--aws

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@oharan2: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@oharan2: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-redhat-chaos-lp-chaos-main-ocp-4.22-ocp-chaos-cr--ocp--krkn-hub-tests--aws N/A periodic Ci-operator config changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: oharan2
Once this PR has been reviewed and has the lgtm label, please assign etirta for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml`:
- Around line 55-60: Remove the intentionally failing POC overrides from the
recurring cr--ocp--krkn-hub-tests--aws job configuration, including the
environment block containing DISRUPTION_COUNT, DR__RP__CR_COMP_NAME,
EXPECTED_POD_COUNT, POD_LABEL, TELEMETRY_GROUP, and WAIT_DURATION. Move them to
a dedicated manual/POC job or gate them so scheduled runs retain only
steady-state defaults.
- Line 58: Update the POD_LABEL setting in the redhat-chaos configuration to
explicitly select etcd pods with the k8s-app=etcd label instead of leaving it
empty. Preserve the existing etcd disruption scenario behavior and ensure the
selector is passed to the pod-scenario step.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b2551d39-37cf-4140-b908-54b46c259e9a

📥 Commits

Reviewing files that changed from the base of the PR and between 12b01e6 and ff9dc0b.

📒 Files selected for processing (1)
  • ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml

Comment on lines +55 to +60
DISRUPTION_COUNT: "6"
DR__RP__CR_COMP_NAME: lp-chaos--OCP
EXPECTED_POD_COUNT: "6"
POD_LABEL: ""
TELEMETRY_GROUP: ocp4.22-nightly--aws
WAIT_DURATION: "15"

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.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Keep the intentionally failing POC out of the recurring job.

This environment block belongs to the twice-daily cr--ocp--krkn-hub-tests--aws job. Since the PR objective says this scenario is expected to fail and is not a steady-state default, these overrides should move to a dedicated manual/POC job or be explicitly gated; otherwise every scheduled run will fail. (github.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml`
around lines 55 - 60, Remove the intentionally failing POC overrides from the
recurring cr--ocp--krkn-hub-tests--aws job configuration, including the
environment block containing DISRUPTION_COUNT, DR__RP__CR_COMP_NAME,
EXPECTED_POD_COUNT, POD_LABEL, TELEMETRY_GROUP, and WAIT_DURATION. Move them to
a dedicated manual/POC job or gate them so scheduled runs retain only
steady-state defaults.

DISRUPTION_COUNT: "6"
DR__RP__CR_COMP_NAME: lp-chaos--OCP
EXPECTED_POD_COUNT: "6"
POD_LABEL: ""

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target CI config and the referenced step-registry ref.
sed -n '1,140p' ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml

printf '\n--- step registry search ---\n'
rg -n "POD_LABEL|NAME_PATTERN|etcd-disruption|k8s-app=etcd" ci-operator/step-registry/redhat-chaos -S

printf '\n--- broader search for Krkn pod label handling ---\n'
rg -n "POD_LABEL|NAME_PATTERN" -S .

Repository: openshift/release

Length of output: 8567


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the relevant step-registry file before reading its contents.
fd -a "redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml" ci-operator/step-registry

Repository: openshift/release

Length of output: 295


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the step-registry file once located.
FILE="$(fd -a "redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml" ci-operator/step-registry | head -n 1)"
echo "FILE=$FILE"
if [ -n "$FILE" ]; then
  wc -l "$FILE"
  sed -n '1,220p' "$FILE"
fi

Repository: openshift/release

Length of output: 2789


🏁 Script executed:

#!/bin/bash
set -euo pipefail
pwd
ls

Repository: openshift/release

Length of output: 336


🌐 Web query:

Krkn POD_LABEL NAME_PATTERN empty falls back to NAME_PATTERN=.* etcd disruption

💡 Result:

In Krkn, the NAME_PATTERN parameter serves as a regex pattern to match pods within a target namespace when a specific POD_LABEL is not provided [1][2]. According to official Krkn documentation and scenario configurations, if NAME_PATTERN is left empty or not explicitly defined, it defaults to., which causes the scenario to target all pods matching the namespace criteria [1][2]. Regarding the context of etcd disruption, Krkn includes predefined scenarios (e.g., scenarios/openshift/etcd.yml) specifically designed to disrupt etcd components [3]. If a user executes a generic pod disruption scenario without specifying a POD_LABEL or a restrictive NAME_PATTERN, the default behavior (NAME_PATTERN=.) will attempt to disrupt all pods in the targeted namespace, which could inadvertently include etcd pods if the namespace is set to one where etcd runs (such as openshift-etcd or kube-system) [1][2][4]. Users should exercise caution when defining the NAMESPACE and NAME_PATTERN parameters to avoid unintended disruption of critical cluster infrastructure [1].

Citations:


Keep the etcd pod selector explicit. POD_LABEL: "" drops the k8s-app=etcd default from redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml, so the step can fall back to a broad pod match and hit non-etcd pods in openshift-etcd.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml`
at line 58, Update the POD_LABEL setting in the redhat-chaos configuration to
explicitly select etcd pods with the k8s-app=etcd label instead of leaving it
empty. Preserve the existing etcd disruption scenario behavior and ensure the
selector is passed to the pod-scenario step.

@oharan2

oharan2 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-redhat-chaos-lp-chaos-main-ocp-4.22-ocp-chaos-cr--ocp--krkn-hub-tests--aws

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@oharan2: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@oharan2: 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/rehearse/periodic-ci-redhat-chaos-lp-chaos-main-ocp-4.22-ocp-chaos-cr--ocp--krkn-hub-tests--aws ff9dc0b link unknown /pj-rehearse periodic-ci-redhat-chaos-lp-chaos-main-ocp-4.22-ocp-chaos-cr--ocp--krkn-hub-tests--aws

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.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant