Skip to content

Export BEARER_TOKEN and build kube-burner-ocp from fork for kube-apiserver pprof#82349

Open
redhat-chai-bot wants to merge 1 commit into
openshift:mainfrom
redhat-chai-bot:add-bearer-token-for-apiserver-pprof
Open

Export BEARER_TOKEN and build kube-burner-ocp from fork for kube-apiserver pprof#82349
redhat-chai-bot wants to merge 1 commit into
openshift:mainfrom
redhat-chai-bot:add-bearer-token-for-apiserver-pprof

Conversation

@redhat-chai-bot

@redhat-chai-bot redhat-chai-bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Enable kube-apiserver CPU pprof collection for all PerfScale workloads in the payload-control-plane-6nodes job. This is an investigation aid for PERFSCALE-5323 — a confirmed 11-19% apiserverCPU_avg regression after the Kubernetes 1.36.2 rebase in OCP 5.0.

Problem

Audit log analysis confirmed that the API call volume during node-density-cni is essentially unchanged between pre-rebase (k8s v1.35.3) and post-rebase (k8s v1.36.2) — the regression is caused by each API call being more CPU-expensive, not by more calls. CPU pprof profiles are needed to identify which code paths cost more after the rebase.

The existing PPROF=true setting only collects OVN profiles (ovnkube-controller, ovnk-control-plane). kube-apiserver pprof requires bearer token auth and is not included in the upstream kube-burner-ocp binary.

Changes

All 6 step ref command scripts are updated with:

  1. BEARER_TOKEN setup — creates a kube-burner ServiceAccount in benchmark-operator namespace with cluster-admin ClusterRoleBinding, then generates a 6-hour bearer token. This follows the get_pprof_secrets() pattern from e2e-benchmarking common.sh L134-148.

  2. Custom kube-burner-ocp build — clones the fork branch redhat-chai-bot/kube-burner-ocp:add-kube-apiserver-pprof-targets which adds a kube-apiserver-cpu pprof target to all workload configs. Builds with make build, tarballs the binary, and sets KUBE_BURNER_URL to the local tarball so run.sh uses it instead of downloading from GitHub releases.

  3. Recurring pprof collection — adds --pprof-interval=1m to EXTRA_FLAGS for periodic 30-second CPU profile capture every minute during the workload (instead of the default single collection at end).

Modified scripts

  • cluster-density-v2-commands.sh
  • cudn-density-commands.sh
  • node-density-cni-commands.sh
  • node-density-heavy-commands.sh
  • node-density-commands.sh
  • udn-density-pods-commands.sh

Next steps

Once merged, trigger pre-rebase and post-rebase runs to compare kube-apiserver CPU profiles and identify which code paths regressed in k8s 1.36.2.

Cleanup

After the investigation, the fork build logic should be removed and replaced with the appropriate KUBE_BURNER_VERSION override once upstream kube-burner-ocp includes kube-apiserver pprof targets natively.


@mcornea requested in Slack thread

Summary by CodeRabbit

  • Updates the payload-control-plane-6nodes PerfScale CI job (in ci-operator/config/openshift-eng/ocp-perfscale/...) to adjust the test/chain wiring: it adds an openshift-qe-build-kube-burner-test step and includes openshift-qe-node-density-cni, while removing the prior openshift-qe-control-plane and openshift-qe-orion-consolidated chains from that job section.
  • Enables recurring kube-apiserver CPU pprof capture across the impacted PerfScale workloads by adding --pprof-interval=1m to the workload EXTRA_FLAGS in:
    • cluster-density-v2
    • cudn-density
    • node-density-cni
    • node-density-heavy
    • node-density
    • udn-density-pods
  • Adds kube-apiserver pprof authorization plumbing to those workload command scripts by creating a benchmark-operator namespace, provisioning a kube-burner ServiceAccount with cluster-admin via a ClusterRoleBinding, and exporting a 6-hour BEARER_TOKEN.
  • Switches kube-burner-ocp usage in the workload scripts to a custom binary built from a fork/branch (add-kube-apiserver-pprof-targets), exporting KUBE_BURNER_URL as a local file:///tmp/kube-burner-ocp-custom.tar.gz so the workload run consumes the profiled kube-apiserver-enabled kube-burner-ocp.
  • Introduces a new temporary step-registry step openshift-qe-build-kube-burner-test (plus OWNERS updates) to validate building kube-burner-ocp from the fork in CI.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@redhat-chai-bot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f90cd67-1963-4af8-87eb-158d36b242cf

📥 Commits

Reviewing files that changed from the base of the PR and between da19004 and 130cbb4.

📒 Files selected for processing (11)
  • ci-operator/config/openshift-eng/ocp-perfscale/openshift-eng-ocp-perfscale-main__aws-5.0-nightly-x86.yaml
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/OWNERS
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-ref.metadata.json
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-ref.yaml
  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh

Walkthrough

The six density workload scripts now enable fixed-interval pprof polling, provision kube-burner profiling access, build a custom kube-burner binary with kube-apiserver targets, and export the resulting credentials and local artifact URL. Perfscale CI also adds a build-validation step and updates its workload chain.

Changes

Density profiling workflows

Layer / File(s) Summary
Custom kube-burner build step
ci-operator/step-registry/openshift-qe/build-kube-burner-test/*
Adds a registered CI step that installs a pinned Go toolchain, clones and builds the kube-burner-ocp fork, verifies the binary, and defines review ownership.
Profiling runtime configuration
ci-operator/step-registry/openshift-qe/{cluster-density-v2,cudn-density,node-density-cni,node-density-heavy,node-density,udn-density-pods}/*-commands.sh
Workload flags now include --pprof-interval=1m; existing Elasticsearch and profile-related exports remain wired through the affected scripts.
Profiling access and custom binary provisioning
ci-operator/step-registry/openshift-qe/{cluster-density-v2,cudn-density,node-density-cni,node-density-heavy,node-density,udn-density-pods}/*-commands.sh
Scripts create kube-burner RBAC resources, export BEARER_TOKEN, build and package kube-burner-ocp with kube-apiserver pprof targets, and export KUBE_BURNER_URL.
Perfscale CI sequence
ci-operator/config/openshift-eng/ocp-perfscale/openshift-eng-ocp-perfscale-main__aws-5.0-nightly-x86.yaml
Adds the kube-burner build-validation step and changes the configured workload chain to node-density-cni.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: rehearsals-ack

Suggested reviewers: chentex, jtaleric, rsevilla87

Sequence Diagram(s)

sequenceDiagram
  participant DensityScript
  participant OpenShiftCluster
  participant CustomBuild
  participant KubeBurner
  DensityScript->>OpenShiftCluster: Provision profiling RBAC
  OpenShiftCluster-->>DensityScript: Return BEARER_TOKEN
  DensityScript->>CustomBuild: Clone and build kube-burner-ocp
  CustomBuild-->>DensityScript: Return packaged local tarball
  DensityScript->>KubeBurner: Export KUBE_BURNER_URL and pprof flags
  KubeBurner->>OpenShiftCluster: Run workload with authenticated pprof collection
Loading

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error FAIL: these scripts keep set -x on while expanding ES_SERVER from ES_USERNAME/ES_PASSWORD, which can print the ES password in logs. Disable xtrace or mask secrets around ES_SERVER/other secret expansions; keep only the token block under set +x and avoid tracing secret values.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: exporting BEARER_TOKEN and building kube-burner-ocp from a fork for kube-apiserver pprof.
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 No Ginkgo test titles were added or changed in the touched files; the PR only updates shell scripts and YAML.
Test Structure And Quality ✅ Passed PASS: The PR only changes CI shell scripts/YAML and adds no Ginkgo test code, so the test-structure checklist is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes ci-operator shell/YAML step-registry files, so MicroShift compatibility is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests were added; the PR only changes CI shell scripts, YAML, and OWNERS files.
Topology-Aware Scheduling Compatibility ✅ Passed The PR only changes CI job configs and shell scripts; no deployment manifests, controllers, affinity, nodeSelectors, replicas, or topology-based scheduling logic were added.
Ote Binary Stdout Contract ✅ Passed PR only changes CI step-registry shell/YAML files; no OTE binary main/init/TestMain/suite code is touched, so stdout contract isn’t applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The diff only changes ci-operator step scripts/config; no new Ginkgo It/Describe/Context/When tests were added, so this IPv6/disconnected test check is not applicable.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto was added; only unrelated substrings (e.g. etcdencrypt) and normal shell string checks appeared.
Container-Privileges ✅ Passed No changed container/K8s manifests add privileged, host* or allowPrivilegeEscalation settings; the edits are CI refs and shell scripts only.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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: redhat-chai-bot
Once this PR has been reviewed and has the lgtm label, please assign jtaleric 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

@openshift-ci
openshift-ci Bot requested review from chentex and jtaleric July 23, 2026 13:46

@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

🧹 Nitpick comments (2)
ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh (2)

84-95: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

All six scripts build kube-burner-ocp from an unpinned branch on an unofficial fork with a hardcoded bin/amd64/ output path. Cloning add-kube-apiserver-pprof-targets by branch name (not commit SHA) means the build can change or break unexpectedly if the branch is amended/force-pushed, and the hardcoded arch path assumes a fixed Makefile output layout.

  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh#L84-L95: pin FORK_BRANCH/clone to a specific commit SHA and confirm the runner image has git/make/Go available.
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh#L71-L82: same pinning/verification.
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh#L66-L77: same pinning/verification.
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh#L74-L85: same pinning/verification.
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh#L77-L88: same pinning/verification.
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh#L87-L98: same pinning/verification.
🤖 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/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh`
around lines 84 - 95, Pin FORK_BRANCH in the kube-burner-ocp build flow to a
specific commit SHA and clone that immutable revision; replace the hardcoded
bin/amd64/kube-burner-ocp lookup with a validated output path or discovery
compatible with the build. Confirm git, make, and Go are available before
building. Apply the same changes in
ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
lines 84-95, node-density-cni/openshift-qe-node-density-cni-commands.sh lines
71-82, node-density-heavy/openshift-qe-node-density-heavy-commands.sh lines
66-77, node-density/openshift-qe-node-density-commands.sh lines 74-85,
cudn-density/openshift-qe-cudn-density-commands.sh lines 77-88, and
udn-density-pods/openshift-qe-udn-density-pods-commands.sh lines 87-98.

79-81: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Blanket || true on ns/SA/CRB creation masks real failures, not just AlreadyExists, in all six scripts. A genuine RBAC/API failure here silently propagates into a broken/empty BEARER_TOKEN later, making failures much harder to diagnose.

  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh#L79-L81: check for existing resources explicitly (e.g. oc get ... || oc create ...) instead of a blind || true.
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh#L66-L68: same fix.
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh#L61-L63: same fix.
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh#L69-L71: same fix.
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh#L72-L74: same fix.
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh#L82-L84: same fix.
🤖 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/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh`
around lines 79 - 81, Replace the blanket “|| true” handling for namespace,
service account, and cluster role binding creation with explicit existence
checks followed by creation only when absent, while allowing genuine oc/API
failures to propagate. Apply this consistently at the resource-creation blocks
in
ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh:79-81,
ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh:66-68,
ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh:61-63,
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh:69-71,
ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh:72-74,
and
ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh:82-84.
🤖 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/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh`:
- Around line 78-81: The kube-burner service account currently receives
cluster-admin solely for kube-apiserver pprof access. In all six
scripts—ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh:78-81,
node-density-cni/openshift-qe-node-density-cni-commands.sh:65-68,
node-density-heavy/openshift-qe-node-density-heavy-commands.sh:60-63,
node-density/openshift-qe-node-density-commands.sh:68-71,
cudn-density/openshift-qe-cudn-density-commands.sh:71-74, and
udn-density-pods/openshift-qe-udn-density-pods-commands.sh:81-84—replace the
cluster-admin binding with a dedicated ClusterRole granting only get on
nonResourceURLs /debug/pprof/* and a corresponding ClusterRoleBinding for the
kube-burner service account.
- Around line 78-82: The BEARER_TOKEN assignment is exposed by shell tracing and
also violates SC2155. In
ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
lines 78-82, disable tracing before token generation, declare BEARER_TOKEN
separately from the command substitution, then re-enable tracing afterward.
Apply the same set +x/set -x wrapping to the BEARER_TOKEN assignment in
ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh
lines 65-69,
ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh
lines 60-64,
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
lines 68-72,
ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh
lines 71-75, and
ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh
lines 81-85.

---

Nitpick comments:
In
`@ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh`:
- Around line 84-95: Pin FORK_BRANCH in the kube-burner-ocp build flow to a
specific commit SHA and clone that immutable revision; replace the hardcoded
bin/amd64/kube-burner-ocp lookup with a validated output path or discovery
compatible with the build. Confirm git, make, and Go are available before
building. Apply the same changes in
ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
lines 84-95, node-density-cni/openshift-qe-node-density-cni-commands.sh lines
71-82, node-density-heavy/openshift-qe-node-density-heavy-commands.sh lines
66-77, node-density/openshift-qe-node-density-commands.sh lines 74-85,
cudn-density/openshift-qe-cudn-density-commands.sh lines 77-88, and
udn-density-pods/openshift-qe-udn-density-pods-commands.sh lines 87-98.
- Around line 79-81: Replace the blanket “|| true” handling for namespace,
service account, and cluster role binding creation with explicit existence
checks followed by creation only when absent, while allowing genuine oc/API
failures to propagate. Apply this consistently at the resource-creation blocks
in
ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh:79-81,
ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh:66-68,
ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh:61-63,
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh:69-71,
ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh:72-74,
and
ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh:82-84.
🪄 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: Pro Plus

Run ID: 28805ad0-8fd2-4224-b79d-4712c9f28e6e

📥 Commits

Reviewing files that changed from the base of the PR and between 3268e14 and f2e2f7b.

📒 Files selected for processing (6)
  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh

Comment on lines +78 to +81
# Setup pprof secrets for kube-apiserver profiling
oc create ns benchmark-operator || true
oc create serviceaccount kube-burner -n benchmark-operator || true
oc create clusterrolebinding kube-burner-crb --clusterrole=cluster-admin --serviceaccount=benchmark-operator:kube-burner || true

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

All six scripts bind cluster-admin to the kube-burner SA solely to scrape kube-apiserver pprof. A ClusterRole scoped to nonResourceURLs: ["/debug/pprof/*"] with verb: get would be sufficient and avoids granting full cluster-admin to a token that lives in benchmark-operator.

  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh#L78-L81: replace the cluster-admin clusterrolebinding with a scoped pprof ClusterRole/binding.
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh#L65-L68: same replacement.
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh#L60-L63: same replacement.
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh#L68-L71: same replacement.
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh#L71-L74: same replacement.
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh#L81-L84: same replacement.
📍 Affects 6 files
  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh#L78-L81 (this comment)
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh#L65-L68
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh#L60-L63
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh#L68-L71
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh#L71-L74
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh#L81-L84
🤖 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/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh`
around lines 78 - 81, The kube-burner service account currently receives
cluster-admin solely for kube-apiserver pprof access. In all six
scripts—ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh:78-81,
node-density-cni/openshift-qe-node-density-cni-commands.sh:65-68,
node-density-heavy/openshift-qe-node-density-heavy-commands.sh:60-63,
node-density/openshift-qe-node-density-commands.sh:68-71,
cudn-density/openshift-qe-cudn-density-commands.sh:71-74, and
udn-density-pods/openshift-qe-udn-density-pods-commands.sh:81-84—replace the
cluster-admin binding with a dedicated ClusterRole granting only get on
nonResourceURLs /debug/pprof/* and a corresponding ClusterRoleBinding for the
kube-burner service account.

@mcornea

mcornea commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/pj-rehearse periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-payload-control-plane-6nodes

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@redhat-chai-bot
redhat-chai-bot force-pushed the add-bearer-token-for-apiserver-pprof branch from f2e2f7b to 67afbaf Compare July 23, 2026 13:59

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh (1)

108-117: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Point the timeout recovery check at the custom binary path.

The script ships the built binary from /tmp/kube-burner-ocp-bin/kube-burner-ocp into file:///tmp/kube-burner-ocp-custom.tar.gz. If the wrapper leaves that tarball unpacked or extracts to a non-executable location, if /tmp/kube-burner-ocp cluster-health; then silently fails on run.sh exit code 2 and skips the intended health-check fallback. Match the health check to the actual executable path used by KUBE_BURNER_URL.

🤖 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/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh`
around lines 108 - 117, Update the cluster-health invocation in the
RUN_EXIT_CODE 2 recovery block to use the executable path configured through
KUBE_BURNER_URL, specifically the custom binary location used by the shipped
kube-burner artifact, instead of /tmp/kube-burner-ocp. Preserve the existing
health-check fallback and cleanup behavior.
🤖 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.

Outside diff comments:
In
`@ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh`:
- Around line 108-117: Update the cluster-health invocation in the RUN_EXIT_CODE
2 recovery block to use the executable path configured through KUBE_BURNER_URL,
specifically the custom binary location used by the shipped kube-burner
artifact, instead of /tmp/kube-burner-ocp. Preserve the existing health-check
fallback and cleanup behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 859c8ea5-ffd9-4eff-8ca8-093ebf4b7397

📥 Commits

Reviewing files that changed from the base of the PR and between f2e2f7b and 67afbaf.

📒 Files selected for processing (6)
  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh

@mcornea

mcornea commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/pj-rehearse periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-payload-control-plane-6nodes

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@redhat-chai-bot
redhat-chai-bot force-pushed the add-bearer-token-for-apiserver-pprof branch from 67afbaf to 45bbd1f Compare July 23, 2026 15:52
@mcornea

mcornea commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/pj-rehearse periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-payload-control-plane-6nodes

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@mcornea

mcornea commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/pj-rehearse periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-payload-control-plane-6nodes

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@redhat-chai-bot
redhat-chai-bot force-pushed the add-bearer-token-for-apiserver-pprof branch from 45bbd1f to b344ce2 Compare July 24, 2026 07:44
@openshift-ci openshift-ci Bot added the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Jul 24, 2026
@redhat-chai-bot
redhat-chai-bot force-pushed the add-bearer-token-for-apiserver-pprof branch from b344ce2 to da19004 Compare July 24, 2026 07:50
@openshift-ci openshift-ci Bot removed the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Jul 24, 2026
@redhat-chai-bot
redhat-chai-bot force-pushed the add-bearer-token-for-apiserver-pprof branch from da19004 to 7f16348 Compare July 24, 2026 08:00

@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: 5

🤖 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/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh`:
- Around line 8-9: Replace the mutable FORK_BRANCH-based kube-burner fork
references with one immutable commit ref, and use that identical pinned ref in
build-kube-burner-test at
ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh
lines 8-9 and 22-24, plus node-density at
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
lines 78-82. Update the clone/build and workload execution commands consistently
so both use the same pinned source before building and running.
- Around line 13-16: Validate the downloaded Go tarball before extraction in
both
ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh
(lines 13-16) and
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
(lines 84-88). Add download failure handling and verify each archive against the
official checksum before allowing tar to extract it, or centralize the
installation while preserving uniform integrity validation across both
workflows.

In
`@ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh`:
- Around line 68-72: Update the pprof setup near the kube-burner service account
to define and bind a dedicated least-privilege role instead of using the
cluster-admin ClusterRole. Grant only the exact non-resource or proxy
permissions required by the configured custom profiling targets, and update
kube-burner-crb to reference that dedicated role.
- Around line 69-72: Update the benchmark-operator RBAC setup commands around
the kube-burner service account and cluster role binding to stop unconditionally
swallowing errors. Use an idempotent apply approach or explicitly ignore only
expected AlreadyExists responses, while propagating forbidden, API outage, and
other failures so the workload does not start with incomplete RBAC.
- Around line 73-74: Update the BEARER_TOKEN assignment to fall back to oc sa
get-token only when oc create token is genuinely unsupported or unavailable, not
when it fails due to authorization or API errors. Preserve the 6-hour token
semantics whenever oc create token succeeds, propagate other failures so CI
stops, and add an explicit comment documenting the narrowly scoped fallback.
🪄 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: Pro Plus

Run ID: c8e53f34-a1ec-4ca9-8bfb-e04c6002ff7b

📥 Commits

Reviewing files that changed from the base of the PR and between 67afbaf and da19004.

📒 Files selected for processing (10)
  • ci-operator/config/openshift-eng/ocp-perfscale/openshift-eng-ocp-perfscale-main__aws-5.0-nightly-x86.yaml
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/OWNERS
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-ref.yaml
  • ci-operator/step-registry/openshift-qe/cluster-density-v2/openshift-qe-cluster-density-v2-commands.sh
  • ci-operator/step-registry/openshift-qe/cudn-density/openshift-qe-cudn-density-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-cni/openshift-qe-node-density-cni-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density-heavy/openshift-qe-node-density-heavy-commands.sh
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
  • ci-operator/step-registry/openshift-qe/udn-density-pods/openshift-qe-udn-density-pods-commands.sh

Comment on lines +8 to +9
FORK_REPO="https://github.com/redhat-chai-bot/kube-burner_kube-burner-ocp.git"
FORK_BRANCH="add-kube-apiserver-pprof-targets"

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate files =="
fd -a 'openshift-qe-(build-kube-burner-test|node-density)-commands\.sh$' . || true

echo
echo "== relevant build-kube-burner-test lines =="
file1='ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh'
if [ -f "$file1" ]; then
  wc -l "$file1"
  sed -n '1,80p' "$file1" | cat -n | sed -n '1,90p'
fi

echo
echo "== relevant node-density lines =="
file2='ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh'
if [ -f "$file2" ]; then
  wc -l "$file2"
  sed -n '1,140p' "$file2" | cat -n | sed -n '1,150p'
fi

echo
echo "== search kube-burner build variables/usages =="
rg -n "FORK_REPO|FORK_BRANCH|kb.*clone|kube-burner|kube-burner-ocp|Build|GOFLAGS|GOCACHE|mktemp -d|KUBE_BURNER|KB_OCP" ci-operator/step-registry/openshift-qe -S || true

Repository: openshift/release

Length of output: 50373


Pin the kube-burner-o fork at immutable commit refs.

Both test-build and workload execution clone mutable branch refs (--branch "${FORK_BRANCH}") from an external fork. Use the same pinned commit in build-kube-burner-test and node-density, or a shared upstream version before building and running.

📍 Affects 2 files
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh#L8-L9 (this comment)
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh#L22-L24
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh#L78-L82
🤖 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/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh`
around lines 8 - 9, Replace the mutable FORK_BRANCH-based kube-burner fork
references with one immutable commit ref, and use that identical pinned ref in
build-kube-burner-test at
ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh
lines 8-9 and 22-24, plus node-density at
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
lines 78-82. Update the clone/build and workload execution commands consistently
so both use the same pinned source before building and running.

Comment on lines +13 to +16
GO_VERSION="1.25.9"
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -o /tmp/go.tar.gz
mkdir -p /tmp/goroot
tar -C /tmp/goroot -xzf /tmp/go.tar.gz

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -u

echo "== locate scripts =="
git ls-files | grep -F 'ci-operator/step-registry/openshift-qe' | sed -n '1,120p'

echo
echo "== target files around Go download =="
for f in \
  ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh \
  ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
do
  if [ -f "$f" ]; then
    echo "--- $f wc $(wc -l < "$f")"
    sed -n '1,35p' "$f"
    echo "-----"
    sed -n '70,100p' "$f"
    echo
    rg -n 'GO_VERSION|curl .*go\.dev|sha256|sha256sum|go\.tar\.gz|curl_options|set -euo pipefail|set -x' "$f" || true
  else
    echo "MISSING $f"
  fi
done

echo
echo "== same patterns in repo (read-only text search) =="
rg -n 'curl -sL "https://go\.dev/dl/go\$\{GO_VERSION\}\.linux-amd64\.tar\.gz"|sha256sum|go\.dev/dl/go|GO_VERSION' ci-operator/step-registry/openshift-qe || true

echo
echo "== deterministic behavior probe: bash -c 'set -euo pipefail; GO_VERSION=1.25.9; exec curl ...' invalid URL would fail =="
python3 - <<'PY'
import os, pathlib
for path in [
  pathlib.Path('ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh'),
  pathlib.Path('ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh'),
]:
    text = path.read_text()
    print(f"{path}: set_errexit={'set -euo pipefail' in text or 'set -e' in text}")
    print(f"{path}: curl_before_tar={'curl' in text and text.find('curl') < text.find('tar')}")
    print(f"{path}: tar_without_error='&&' not in text[text.find('tar -C /tmp/goroot'):text.find('tar -C /tmp/goroot')+40])")
PY

Repository: openshift/release

Length of output: 18639


Validate the Go toolchain before extracting it.

Both build scripts download go.dev tarballs with unauthenticated curl and then extract them without checksum validation or failure handling. Add a checksum/integrity check in each path, or centralize this installation so both workflows validate the toolchain uniformly.

🧰 Tools
🪛 ast-grep (0.44.1)

[warning] 13-13: Writing to or reading from a hardcoded, predictable path under /tmp is vulnerable to symlink and TOCTOU attacks: a local attacker can pre-create the file (or a symlink pointing elsewhere) and hijack or corrupt the contents. Generate a unique, unpredictable temporary file with mktemp instead, e.g. tmpfile="$(mktemp)" (or mktemp -d for directories) and reference "$tmpfile".
Context: /tmp/go.tar.gz
Note: [CWE-377] Insecure Temporary File.

(predictable-tmp-file-bash)


[warning] 15-15: Writing to or reading from a hardcoded, predictable path under /tmp is vulnerable to symlink and TOCTOU attacks: a local attacker can pre-create the file (or a symlink pointing elsewhere) and hijack or corrupt the contents. Generate a unique, unpredictable temporary file with mktemp instead, e.g. tmpfile="$(mktemp)" (or mktemp -d for directories) and reference "$tmpfile".
Context: /tmp/goroot
Note: [CWE-377] Insecure Temporary File.

(predictable-tmp-file-bash)


[warning] 15-15: Writing to or reading from a hardcoded, predictable path under /tmp is vulnerable to symlink and TOCTOU attacks: a local attacker can pre-create the file (or a symlink pointing elsewhere) and hijack or corrupt the contents. Generate a unique, unpredictable temporary file with mktemp instead, e.g. tmpfile="$(mktemp)" (or mktemp -d for directories) and reference "$tmpfile".
Context: /tmp/go.tar.gz
Note: [CWE-377] Insecure Temporary File.

(predictable-tmp-file-bash)


[warning] 16-16: Writing to or reading from a hardcoded, predictable path under /tmp is vulnerable to symlink and TOCTOU attacks: a local attacker can pre-create the file (or a symlink pointing elsewhere) and hijack or corrupt the contents. Generate a unique, unpredictable temporary file with mktemp instead, e.g. tmpfile="$(mktemp)" (or mktemp -d for directories) and reference "$tmpfile".
Context: /tmp/go.tar.gz
Note: [CWE-377] Insecure Temporary File.

(predictable-tmp-file-bash)

📍 Affects 2 files
  • ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh#L13-L16 (this comment)
  • ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh#L84-L88
🤖 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/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh`
around lines 13 - 16, Validate the downloaded Go tarball before extraction in
both
ci-operator/step-registry/openshift-qe/build-kube-burner-test/openshift-qe-build-kube-burner-test-commands.sh
(lines 13-16) and
ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh
(lines 84-88). Add download failure handling and verify each archive against the
official checksum before allowing tar to extract it, or centralize the
installation while preserving uniform integrity validation across both
workflows.

Comment on lines +68 to +72
# Setup pprof secrets for kube-apiserver profiling
oc create ns benchmark-operator || true
set +x
oc create serviceaccount kube-burner -n benchmark-operator || true
oc create clusterrolebinding kube-burner-crb --clusterrole=cluster-admin --serviceaccount=benchmark-operator:kube-burner || true

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.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Replace cluster-admin with least-privilege pprof access.

The six-hour bearer token is bound to cluster-admin, granting unrestricted cluster access for a profiling operation. Define a dedicated role containing only the exact pprof non-resource or proxy permissions required by the custom targets.

🤖 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/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh`
around lines 68 - 72, Update the pprof setup near the kube-burner service
account to define and bind a dedicated least-privilege role instead of using the
cluster-admin ClusterRole. Grant only the exact non-resource or proxy
permissions required by the configured custom profiling targets, and update
kube-burner-crb to reference that dedicated role.

Comment on lines +69 to +72
oc create ns benchmark-operator || true
set +x
oc create serviceaccount kube-burner -n benchmark-operator || true
oc create clusterrolebinding kube-burner-crb --clusterrole=cluster-admin --serviceaccount=benchmark-operator:kube-burner || true

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 | ⚡ Quick win

Do not swallow RBAC setup failures.

|| true treats “already exists” the same as forbidden, API outage, or another real failure. Use idempotent apply or ignore only an expected AlreadyExists result; otherwise fail before starting the workload.

🤖 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/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh`
around lines 69 - 72, Update the benchmark-operator RBAC setup commands around
the kube-burner service account and cluster role binding to stop unconditionally
swallowing errors. Use an idempotent apply approach or explicitly ignore only
expected AlreadyExists responses, while propagating forbidden, API outage, and
other failures so the workload does not start with incomplete RBAC.

Comment on lines +73 to +74
BEARER_TOKEN=$(oc create token -n benchmark-operator kube-burner --duration=6h || oc sa get-token kube-burner -n benchmark-operator)
export BEARER_TOKEN

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.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -u

FILE="ci-operator/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh"

echo "== file exists and size =="
wc -l "$FILE"

echo "== relevant context =="
sed -n '1,140p' "$FILE" | cat -n

echo "== token usage and related commands =="
rg -n "BEARER_TOKEN|kube-burner|oc create token|oc sa get-token|create token" "$FILE"

Repository: openshift/release

Length of output: 7641


🌐 Web query:

openshift oc create token ServiceAccountToken --duration default behavior oc sa get-token difference

💡 Result:

The command oc create token is the current, recommended method for generating service account tokens in OpenShift, while oc sa get-token is deprecated and subject to removal [1][2][3]. Key differences and behaviors: 1. Deprecation Status: The oc sa get-token command is deprecated [1][3]. It was designed to retrieve existing, long-lived secret-based tokens. In modern OpenShift versions (4.11+), these long-lived secrets are no longer automatically generated for service accounts [4][5][6], which is why oc sa get-token often fails to find a token [1]. 2. Default Behavior of oc create token: When you run oc create token <service_account_name>, it requests a short-lived, projected-style token from the API server [7][3]. If the --duration flag is not specified (or set to 0), the lifetime is determined automatically by the server [7]. In practice, this defaults to a lifetime of one hour [8][3]. Note that the API server reserves the right to return a token with a different lifetime than requested [7][3]. 3. Token Management: If you require a long-lived token (e.g., for legacy CI/CD pipelines that cannot handle token rotation), the recommended approach is to manually create a service account token secret [4][3][6]. Otherwise, for application access, using projected volumes is the standard, secure practice [4][5][6]. Summary of command usage: - Modern/Recommended: oc create token <service_account_name> [--duration=] [7][3] - Deprecated: oc sa get-token <service_account_name> [1][2]

Citations:


Avoid the token fallback for auth/API failures.

The || oc sa get-token fallback also runs on authorization failures and API unavailable errors, and oc sa get-token is deprecated/token-source behavior is not the intended 6h-limited token. Only fall back when oc create token is genuinely unavailable and add an explicit comment; otherwise let non-unsupported errors fail so CI does not continue with a different token semantics.

🤖 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/step-registry/openshift-qe/node-density/openshift-qe-node-density-commands.sh`
around lines 73 - 74, Update the BEARER_TOKEN assignment to fall back to oc sa
get-token only when oc create token is genuinely unsupported or unavailable, not
when it fails due to authorization or API errors. Preserve the 6-hour token
semantics whenever oc create token succeeds, propagate other failures so CI
stops, and add an explicit comment documenting the narrowly scoped fallback.

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: The following tests 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-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-payload-control-plane-6nodes 45bbd1f link unknown /pj-rehearse periodic-ci-openshift-eng-ocp-perfscale-main-aws-5.0-nightly-x86-payload-control-plane-6nodes
ci/prow/step-registry-metadata 7f16348 link true /test step-registry-metadata

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.

…f investigation

- Configure all 6 workload scripts to build kube-burner-ocp from fork
  with kube-apiserver pprof targets and export BEARER_TOKEN
- Install Go to /tmp/goroot (user-writable) instead of /usr/local
- Wrap bearer token creation with set +x/set -x to prevent log redaction
- Change payload-control-plane-6nodes test to run only node-density-cni

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@redhat-chai-bot
redhat-chai-bot force-pushed the add-bearer-token-for-apiserver-pprof branch from 7f16348 to 130cbb4 Compare July 24, 2026 08:11
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@redhat-chai-bot: 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
pull-ci-openshift-ovn-kubernetes-release-4.18-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.18-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.15-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.15-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.14-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.14-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.13-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.13-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.12-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.12-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-sandbox-release-4.16-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-sandbox-release-4.16-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-sandbox-release-4.17-qe-perfscale-aws-ovn-medium-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-sandbox-release-4.17-qe-perfscale-aws-ovn-small-cluster-density openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-main-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-5.1-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-5.0-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.23-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.22-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.21-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.20-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.19-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.18-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.17-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed
pull-ci-openshift-ovn-kubernetes-release-4.16-perfscale-aws-ovn-small-cluster-density-v2 openshift/ovn-kubernetes presubmit Registry content changed

A total of 737 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs.

A full list of affected jobs can be found here

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.

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