-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
added --uri_base_prefix option (#2018) #2117
Conversation
Hi @tghosgor. Thanks for your PR. I'm waiting for a google or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super-familiar with this space. Can you go into a little more detail on why you need to add a prefix to all endpoints to work with some proxies?
cadvisor.go
Outdated
@@ -62,6 +62,8 @@ var collectorKey = flag.String("collector_key", "", "Key for the collector's cer | |||
|
|||
var storeContainerLabels = flag.Bool("store_container_labels", true, "convert container labels and environment variables into labels on prometheus metrics for each container. If flag set to false, then only metrics exported are container name, first alias, and image name") | |||
|
|||
var basePrefix = flag.String("base_prefix", "", "prefix path that will be prepended to all paths to support some reverse proxies") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this less generic-sounding? Maybe url_base_prefix
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
Sure. We need to serve cAdvisor behind a reverse proxy on a sub-path, e.g. What is happening is that ServeMux does the redirects with absolute paths to add a trailing slash. This happens quite a lot while navigating around (i.e. I would expect nesting |
Some reverse proxies do not support overriding 'Location' header in 3xx responses. This commit adds a --url_base_prefix option that adds a prefix to all URLs of cAdvisor so that redirects go to the correct places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. This change lgtm
Hi All, is there any timeline when this will make it into a Docker build? We're waiting for this feature to run cAdvisor behind Traefik. Thanks, David. |
You are welcome to run the canary build. We will have a release within the next month that corresponds with the kubernetes 1.14 release |
@dashpole Thanks for the guidance - much appreciated :) |
Added a quick descriptor for the `url_base_prefix` option. Closes: google#2377 Documents: google#2117
Hi. I'm using last version pushed in dockerhub but option --uri_base_prefix is not current available |
Some reverse proxies do not support overriding 'Location' header
in 3xx responses. This commit adds a --uri_base_prefix option
that adds a prefix to all URLs of cAdvisor so that
redirects go to the correct places.