Skip to content

metrics: change the port for metrics-exporter#3733

Merged
openshift-merge-bot[bot] merged 1 commit intored-hat-storage:mainfrom
weirdwiz:fix/dfbugs-5812
Mar 17, 2026
Merged

metrics: change the port for metrics-exporter#3733
openshift-merge-bot[bot] merged 1 commit intored-hat-storage:mainfrom
weirdwiz:fix/dfbugs-5812

Conversation

@weirdwiz
Copy link
Copy Markdown
Contributor

@weirdwiz weirdwiz commented Mar 10, 2026

in host mode, metrics exporter has a bind contention with kubevirt so we
need to change the port to something other than 8080 / 8081

fixes: DFBUGS-5812

@weirdwiz
Copy link
Copy Markdown
Contributor Author

return err
}

// start the exporter service
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.

any specfic reason for changing the position, I dont see any relevant change here

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.

Creating the Service first ensures the endpoints are ready when pods start.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, just extra protection for race conditions

@SanjalKatiyar
Copy link
Copy Markdown
Contributor

SanjalKatiyar commented Mar 11, 2026

@weirdwiz will this change always prevent such port conflicts ??

Example (in case of host networking): say if two different deployments (both using kube-rbac-proxy) are scheduled on the same node, wouldn't they conflict if they expose the same proxy ports (8443 or 9443). Will we then randomly change these ports to something else too ??
Similarly, in this PR, even with the exporter ports changed to new values, other components could still choose to use those ports (just less likely, but still possible).

So, isn't this a wider issue ?? How do other ODF components handle such cases ?? Or is there something I might be missing here ??

Comment thread metrics/main.go Outdated
@weirdwiz
Copy link
Copy Markdown
Contributor Author

weirdwiz commented Mar 11, 2026

@weirdwiz will this change always prevent such port conflicts ??

Example (in case of host networking): say if two different deployments (both using kube-rbac-proxy) are scheduled on the same node, wouldn't they conflict if they expose the same proxy ports (8443 or 9443). Will we then randomly change these ports to something else too ?? Similarly, in this PR, even with the exporter ports changed to new values, other components could still choose to use those ports (just less likely, but still possible).

So, isn't this a wider issue ?? How do other ODF components handle such cases ?? Or is there something I might be missing here ??

this PR isn't trying to solve arbitrary port conflicts. it's fixing a specific, reported conflict (DFBUGS-5812) where kubevirt binds 8080/8081 on the host, and in host networking mode the exporter shares the same network namespace so they collide. other ODF components handle this the same way for example, RGW switches from port 80/443 to 50080/50443 when host networking is enabled

@weirdwiz
Copy link
Copy Markdown
Contributor Author

ptal @Madhu-1

@SanjalKatiyar
Copy link
Copy Markdown
Contributor

this PR isn't trying to solve arbitrary port conflicts. it's fixing a specific, reported conflict (DFBUGS-5812) where kubevirt binds 8080/8081 on the host, and in host networking mode the exporter shares the same network namespace so they collide.

I understand that.
What I was asking, if we encounter a similar issue again (like examples in my previous comment), we would again pick a different/random port and hope it isn't already used on the host, that's somewhat arbitrary.

other ODF components handle this the same way for example, RGW switches from port 80/443 to 50080/50443 when host networking is enabled

That's what I meant by wider issue in my previous comment. But if this is already what we do across ODF components, and it's something we have already discussed and agreed on, then that answers my question.

@weirdwiz
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.21

@openshift-cherrypick-robot
Copy link
Copy Markdown

@weirdwiz: once the present PR merges, I will cherry-pick it on top of release-4.21 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.21

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.

in host mode, metrics exporter has a bind contention with kubevirt so we
need to change the port to something other than 8080 / 8081

Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Mar 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: malayparida2000, weirdwiz

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 Mar 17, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit c5e7217 into red-hat-storage:main Mar 17, 2026
11 checks passed
@weirdwiz
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.21

weirdwiz pushed a commit to weirdwiz/ocs-operator that referenced this pull request Mar 17, 2026
metrics: change the port for metrics-exporter
weirdwiz added a commit to weirdwiz/ocs-operator that referenced this pull request Mar 20, 2026
The --host 127.0.0.1 and --exporter-host 127.0.0.1 flags were added
in PR red-hat-storage#3733 along with the port change to fix the KubeVirt bind
contention in host networking mode. However, these flags are passed
unconditionally, causing the exporter to bind only to the pod's
loopback interface. The kubelet sends liveness/readiness probes to
the pod IP, not localhost, resulting in connection refused and the
container entering CrashLoopBackOff on every upgrade.

Drop the --host and --exporter-host flags so the exporter defaults
to 0.0.0.0. The port change to 18080/18081 (the actual fix for the
KubeVirt conflict) is preserved.

fixes: DFBUGS-5950
Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants