Skip to content

[release-5.0] OCPBUGS-125793: Add opt-in kube-rbac-proxy sidecar for pprof endpoint (AWS) - #1556

Open
openshift-cherrypick-robot wants to merge 1 commit into
openshift:release-5.0from
openshift-cherrypick-robot:cherry-pick-1502-to-release-5.0
Open

openshift-cherrypick-robot wants to merge 1 commit into
openshift:release-5.0from
openshift-cherrypick-robot:cherry-pick-1502-to-release-5.0

Conversation

@openshift-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #1502

/assign perdasilva

Add an --enable-pprof flag to machine-api-operator that, when set,
configures the AWS machine controller with a pprof profiling endpoint
and a kube-rbac-proxy sidecar to securely expose it.

When --enable-pprof is passed to MAO and the platform is AWS:
- The machine controller receives --enable-pprof and
  --pprof-bind-address=127.0.0.1:6061 to serve plaintext pprof on
  loopback
- A kube-rbac-proxy-pprof sidecar is added, listening on port 6060
  with centralized TLS, proxying to the upstream pprof server

The flag is off by default and only meaningful on AWS (the only
platform whose machine controller supports pprof). On all other
platforms, the flag is accepted but has no effect.

Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6b370914-44eb-44c0-8b77-612775a439af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: Jira Issue OCPBUGS-66932 has been cloned as Jira Issue OCPBUGS-125793. Will retitle bug to link to clone.
/retitle [release-5.0] OCPBUGS-125793: Add opt-in kube-rbac-proxy sidecar for pprof endpoint (AWS)

Details

In response to this:

This is an automated cherry-pick of #1502

/assign perdasilva

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot changed the title [release-5.0] OCPBUGS-66932: Add opt-in kube-rbac-proxy sidecar for pprof endpoint (AWS) [release-5.0] OCPBUGS-125793: Add opt-in kube-rbac-proxy sidecar for pprof endpoint (AWS) Sep 17, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 17, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-125793, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This is an automated cherry-pick of #1502

/assign perdasilva

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 openshift-eng/jira-lifecycle-plugin repository.

@perdasilva

Copy link
Copy Markdown

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Sep 17, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@perdasilva: This pull request references Jira Issue OCPBUGS-125793, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-66932 is in the state MODIFIED, which is one of the valid states (MODIFIED, ON_QA, VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-66932 targets the "5.1.0" version, which is one of the valid target versions: 5.1.0
  • bug has dependents
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@damdo damdo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-operator
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-metal-ipi
/test e2e-metal-ipi-ovn-ipv6
/test e2e-metal-ipi-virtualmedia

@openshift-ci

openshift-ci Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damdo

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2026
@perdasilva

Copy link
Copy Markdown

/retest e2e-metal-ipi-ovn-ipv6

@perdasilva

Copy link
Copy Markdown

/test e2e-metal-ipi-ovn-ipv6

@damdo

damdo commented Sep 18, 2026

Copy link
Copy Markdown
Member

/retest

@perdasilva

Copy link
Copy Markdown

/verified by @perdasilva

  1. Scaled down CVO
  2. Updated the machine-api-operator deployment adding the --enable-pprof flag to the pod template
  3. Observed the pod being updated:
$ kubectl get pods -n openshift-machine-api machine-api-operator-967c47fcf-5rpct -o yaml | grep pprof
    - --enable-pprof
  1. Observed machine-api-controller pod being updated:
$ kubectl get pods -n openshift-machine-api machine-api-controllers-d99668c59-57t5f -o yaml | grep pprof
    - --enable-pprof
    - --pprof-bind-address=127.0.0.1:6061
    name: kube-rbac-proxy-machine-pprof
      name: machine-pprof
    name: kube-rbac-proxy-machine-pprof
  1. Setup port-forward to pprof endpoint using a metrics scrapper identity and setup port-forward
$ oc create token prometheus-k8s -n openshift-monitoring --duration=30m > /tmp/pprof-token.txt && echo "token length: $(wc -c </tmp/pprof-token.txt)"
token length: 1287

$ oc port-forward -n openshift-machine-api pod/machine-api-controllers-d99668c59-57t5f 6060:6060
Forwarding from 127.0.0.1:6060 -> 6060
Forwarding from [::1]:6060 -> 6060
Handling connection for 6060
  1. curl to pprof endpoint
$ curl -sk -H "Authorization: Bearer $(cat /tmp/pprof-token.txt)" https://localhost:6060/debug/pprof/ | head -30
<html>
<head>
<title>/debug/pprof/</title>
<style>
.profile-name{
	display:inline-block;
	width:6rem;
}
</style>
</head>
<body>
/debug/pprof/
<br>
<p>Set debug=1 as a query parameter to export in legacy text format</p>
<br>
Types of profiles available:
<table>
<thead><td>Count</td><td>Profile</td></thead>
<tr><td>170</td><td><a href='allocs?debug=1'>allocs</a></td></tr>
<tr><td>0</td><td><a href='block?debug=1'>block</a></td></tr>
<tr><td>0</td><td><a href='cmdline?debug=1'>cmdline</a></td></tr>
<tr><td>110</td><td><a href='goroutine?debug=1'>goroutine</a></td></tr>
<tr><td>170</td><td><a href='heap?debug=1'>heap</a></td></tr>
<tr><td>0</td><td><a href='mutex?debug=1'>mutex</a></td></tr>
<tr><td>0</td><td><a href='profile?debug=1'>profile</a></td></tr>
<tr><td>0</td><td><a href='symbol?debug=1'>symbol</a></td></tr>
<tr><td>11</td><td><a href='threadcreate?debug=1'>threadcreate</a></td></tr>
<tr><td>0</td><td><a href='trace?debug=1'>trace</a></td></tr>
</table>
<a href="goroutine?debug=2">full goroutine stack dump</a>

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@perdasilva: This PR has been marked as verified by @perdasilva.

Details

In response to this:

/verified by @perdasilva

  1. Scaled down CVO
  2. Updated the machine-api-operator deployment adding the --enable-pprof flag to the pod template
  3. Observed the pod being updated:
$ kubectl get pods -n openshift-machine-api machine-api-operator-967c47fcf-5rpct -o yaml | grep pprof
   - --enable-pprof
  1. Observed machine-api-controller pod being updated:
$ kubectl get pods -n openshift-machine-api machine-api-controllers-d99668c59-57t5f -o yaml | grep pprof
   - --enable-pprof
   - --pprof-bind-address=127.0.0.1:6061
   name: kube-rbac-proxy-machine-pprof
     name: machine-pprof
   name: kube-rbac-proxy-machine-pprof
  1. Setup port-forward to pprof endpoint using a metrics scrapper identity and setup port-forward
$ oc create token prometheus-k8s -n openshift-monitoring --duration=30m > /tmp/pprof-token.txt && echo "token length: $(wc -c </tmp/pprof-token.txt)"
token length: 1287

$ oc port-forward -n openshift-machine-api pod/machine-api-controllers-d99668c59-57t5f 6060:6060
Forwarding from 127.0.0.1:6060 -> 6060
Forwarding from [::1]:6060 -> 6060
Handling connection for 6060
  1. curl to pprof endpoint
$ curl -sk -H "Authorization: Bearer $(cat /tmp/pprof-token.txt)" https://localhost:6060/debug/pprof/ | head -30
<html>
<head>
<title>/debug/pprof/</title>
<style>
.profile-name{
  display:inline-block;
  width:6rem;
}
</style>
</head>
<body>
/debug/pprof/
<br>
<p>Set debug=1 as a query parameter to export in legacy text format</p>
<br>
Types of profiles available:
<table>
<thead><td>Count</td><td>Profile</td></thead>
<tr><td>170</td><td><a href='allocs?debug=1'>allocs</a></td></tr>
<tr><td>0</td><td><a href='block?debug=1'>block</a></td></tr>
<tr><td>0</td><td><a href='cmdline?debug=1'>cmdline</a></td></tr>
<tr><td>110</td><td><a href='goroutine?debug=1'>goroutine</a></td></tr>
<tr><td>170</td><td><a href='heap?debug=1'>heap</a></td></tr>
<tr><td>0</td><td><a href='mutex?debug=1'>mutex</a></td></tr>
<tr><td>0</td><td><a href='profile?debug=1'>profile</a></td></tr>
<tr><td>0</td><td><a href='symbol?debug=1'>symbol</a></td></tr>
<tr><td>11</td><td><a href='threadcreate?debug=1'>threadcreate</a></td></tr>
<tr><td>0</td><td><a href='trace?debug=1'>trace</a></td></tr>
</table>
<a href="goroutine?debug=2">full goroutine stack dump</a>

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: all tests passed!

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants