Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MON-3991: set noProxy for Prometheus remote-write via the CR. #2453

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

machine424
Copy link
Contributor

this is a 'permanent' fix for https://issues.redhat.com/browse/OCPBUGS-38289

  • I added CHANGELOG entry for this change.
  • No user facing changes, so no entry in CHANGELOG was needed.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 2, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Sep 2, 2024

@machine424: This pull request references MON-3991 which is a valid jira issue.

In response to this:

this is a 'permanent' fix for https://issues.redhat.com/browse/OCPBUGS-38289

  • I added CHANGELOG entry for this change.
  • No user facing changes, so no entry in CHANGELOG was needed.

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.

Copy link
Contributor

openshift-ci bot commented Sep 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: machine424

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

The pull request process is described here

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 2, 2024
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Shouldn't we rather set rw.ProxyFromEnvironment = true and inject the proxy variables? This way Prometheus would select the correct proxy based on HTTP/HTTPS.

Copy link
Contributor

openshift-ci bot commented Sep 2, 2024

@machine424: all tests passed!

Full PR test history. Your PR dashboard.

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.

@machine424
Copy link
Contributor Author

machine424 commented Sep 6, 2024

Shouldn't we rather set rw.ProxyFromEnvironment = true and inject the proxy variables? This way Prometheus would select the correct proxy based on HTTP/HTTPS.

TBH, given the latest regression, I don't want to touch/change the logic: CMO gives priority to HTTPS proxy and set it. And no body is complaining about that for now.

Plus, given all the possible places in Prometheus where proxying can be set (scraping, remote wr, read etc) and even though prometheus operator isn't exposing all of that for now, I think it's better to be explicit (set the proxy in the CR) especially that users may need to have a different proxy for each part.

@simonpasquier
Copy link
Contributor

Fair enough but in this case, CMO should look at the scheme of the remote-write URL to decide whether it needs to set proxy_url to HTTProxy() or HTTPSProxy().

@machine424
Copy link
Contributor Author

Fair enough but in this case, CMO should look at the scheme of the remote-write URL to decide whether it needs to set proxy_url to HTTProxy() or HTTPSProxy().

Actually that's the behavior I'm avoiding to change: maybe some users are expecting/relying on the fact that the httpsproxy is always prioritized... That's why I think it's safer to keep it like this until someone complains about it.
(We could mention that here

| proxyUrl | string | Defines an optional proxy URL. It is superseded by the cluster-wide proxy, if enabled. |
)

@simonpasquier
Copy link
Contributor

maybe some users are expecting/relying on the fact that the httpsproxy is always prioritized

Hmm I'm not sure that it would make sense but indeed it can be tackled with another JIRA ticket.

cc @jan--f for another view point :)

@jan--f
Copy link
Contributor

jan--f commented Sep 20, 2024

Afaiu http proxies work very differently from https proxies and generally one can't assume the url scheme corresponds to the the proxy to be used. E.g. sending https to an http proxy is a valid setup.
Not changing behavior seems like a good strategy here, maybe with a log message to make this behavior more visible if anyone cares to look?

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-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants