Skip to content

Add proxy-url command line option #1655

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

Open
kriswuollett opened this issue Sep 13, 2024 · 10 comments
Open

Add proxy-url command line option #1655

kriswuollett opened this issue Sep 13, 2024 · 10 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@kriswuollett
Copy link

What would you like to be added:

Add proxy-url command line option to override cluster setting in selected context config.

Why is this needed:

Golang doesn't support HTTPS_PROXY for localhost addresses as noted in #1653. Avoids the need to statically set proxy urls for each of the clusters defined in a config file.

@kriswuollett kriswuollett added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 13, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 13, 2024
@xyz-li
Copy link

xyz-li commented Sep 13, 2024

/assign

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 17, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 16, 2025
@ardaguclu
Copy link
Member

I think you can use kubectl proxy command for this case or modify your host file from localhost to something else. Because Go probably checks the equality of localhost and using something different will enable HTTPS_PROXY env var.

I think, we'd not prefer adding flag for this;

/close

@k8s-ci-robot
Copy link
Contributor

@ardaguclu: Closing this issue.

In response to this:

I think you can use kubectl proxy command for this case or modify your host file from localhost to something else. Because Go probably checks the equality of localhost and using something different will enable HTTPS_PROXY env var.

I think, we'd not prefer adding flag for this;

/close

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.

@BenTheElder
Copy link
Member

I think you can use kubectl proxy command for this case or modify your host file from localhost to something else. Because Go probably checks the equality of localhost and using something different will enable HTTPS_PROXY env var.

editing /etc/hosts is not portable / generally painful

go specifically checks for localhost hostname or loopback IP addresses
previously reported in #743
https://cs.opensource.google/go/x/net/+/refs/tags/v0.39.0:http/httpproxy/proxy.go;l=178-185

this only happens if you use FromEnvironment() proxy config, which we don't use in the code path where proxy-url is set in kubeconfig

if you set proxy-url in your kubeconfig, then we bypass the go stdlib behavior to ignore proxy for localhost
(kubernetes-sigs/kind#3900 (comment))

it makes sense that the env would continue to use FromEnvironment, but a flag could be treated like setting it in the kubeconfig

this turns out to be annoying for testing kubectl, because kind clusters are on localhost ... kubernetes-sigs/kind#3900

(especially because when testing there may not be a kubeconfig, there may only be --server and related flags, but there is no equivalent for the proxy-url config option)

cc @kubernetes/sig-cli-leads can we reconsider allowing --proxy-url to behave like proxy-url in config in the way that --server does?

I think this is a recurring problem for testing with proxies, some examples:

#1653
#743
kubernetes-sigs/kind#3900

@ardaguclu
Copy link
Member

Makes sense. Let's reopen this and continue discussions
/reopen

@k8s-ci-robot k8s-ci-robot reopened this Apr 25, 2025
@k8s-ci-robot
Copy link
Contributor

@ardaguclu: Reopened this issue.

In response to this:

Makes sense. Let's reopen this and continue discussions
/reopen

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.

@soltysh
Copy link
Contributor

soltysh commented May 15, 2025

cc @kubernetes/sig-cli-leads can we reconsider allowing --proxy-url to behave like proxy-url in config in the way that --server does?

We don't have a --proxy-url flag exposed anywhere, but it seems like a reasonable addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

7 participants