Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDiscover k8s ingress #3071
Comments
This comment has been minimized.
This comment has been minimized.
|
A Ingress object does not carry any information on how to actually reach
the hostnames it declares, especially since there are many ways to
implement and run an ingress controller.
How would you resolve the ingress you posted to a set of IP/port pairs?
/MR
…On Mon, Aug 14, 2017, 20:10 Arnold Bechtoldt ***@***.***> wrote:
It'd be great to have automatic discovery of ingress resources based on
annotations like for services, pods, endpoints, etc. for blackbox checks
and similar:
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myservice
annotations:
prometheus.io/probe: 'true'
prometheus.io/module: http_4xx_ssl
spec:
tls:
...
Right now ingress doesn't seem to be implemented yet at all.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3071>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAICBmce_cBR01mpfxUp_lCKBN5z9M-oks5sYI13gaJpZM4O2tO0>
.
|
This comment has been minimized.
This comment has been minimized.
|
hmm, are you sure? does prometheus need to know how the hostnames/etc. are implemented? If this information isn't available via API yet, why not provide that via (ingress) annotations? The following example is valid and contains the data you mentioned:
|
This comment has been minimized.
This comment has been minimized.
|
As you already mentioned this specifically requires the blackbox exporter as well, which makes me feel like a higher level abstraction needs to come into play here. FWIW we have plans of integrating blackbox exporter support into the Prometheus Operator for exactly this reason. |
This comment has been minimized.
This comment has been minimized.
|
Prometheus tries to be more specific than "this hostname, just pick any IP". You can still do it (just directly configure it as an endpoint). However, as @brancz says this is stringing quite a lot of things together. Even if Prometheus were to ingest the ingress host names as a target, it also needs to know how you set up the blackbox exporter and a way to pass the module on to the exporter, so this spans many more layers than "just" adding a service discovery. It would also need to be dangerously complex so it works for everyone. What you want to achieve is already possible with a little scripting and tying things together:
Building this into Prometheus for all cases would need so many knobs that configuring it would be just as complex as integrating this way for your case, so I would rather not go down this route. |
This comment has been minimized.
This comment has been minimized.
Would you be so kind to give me a code example?
what? what do you mean with "set up"?
relabelling, using an annotation as source label?
I'd totally agree if you were right. For now I don't see that complexity. I might be overlooking something.
Actually I am looking for autodiscovery instead of static target configuration :) |
This comment has been minimized.
This comment has been minimized.
You can use a static config or a file sd config where the
Where is blackbox exporter running? what port is it on? which modules are configured? Actually, going back, maybe I misread what you want. If the ingress discovery were to emit one target per rule, with appropriate meta-labels, you could then do all the relabelling on top. Nevertheless, in the absence of a built-in discovery you can run a little sidecar that queries the Kubernetes API (or calls out to kubectl) and emits these targets-per-rule. This could also help flesh out the interface (label names and such) and help come up with a good configuration example. |
This comment has been minimized.
This comment has been minimized.
|
I really like the idea to expose the ingress. There wouldn't be much to set up, that could be done with relabling like it is for other 'roles'. This can both be used for configuring any kind of exporter that take URLs as parameters, not only the blackbox-exporter. You might even just want to use that to access something behind an internal LB for some weird enterprisy reasons. |
This comment has been minimized.
This comment has been minimized.
|
Sure, as long as describe the use case for ingress discovery clearly in the
docs, I don't see a good argument against such a contribution.
…On Mon, Aug 21, 2017 at 9:20 PM discordianfish ***@***.***> wrote:
I really like the idea to expose the ingress. There wouldn't be much to
set up, that could be done with relabling like it is for other 'roles'.
This can both be used for configuring any kind of exporter that take URLs
as parameters, not only the blackbox-exporter. You might even just want to
use that to access something behind an internal LB for some weird
enterprisy reasons.
I'm happy to provide a full example how configuration and relabling would
look like if you're open to discuss that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3071 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAANaIb9l6nwNILl4A22v_9e2XDhxt_Jks5sadh9gaJpZM4O2tO0>
.
|
This comment has been minimized.
This comment has been minimized.
|
SGTM, I retract my objections. |
grobie
removed
the
not-as-easy-as-it-looks
label
Aug 22, 2017
This comment has been minimized.
This comment has been minimized.
User case
Implementation
Config example
|
This comment has been minimized.
This comment has been minimized.
|
That's how I imaging it. Should be straight forward to implement. Will submit a PR if you agree this is the way to go. |
This comment has been minimized.
This comment has been minimized.
What's a legitimate use case for that? I can't see one at the moment, Prometheus should be configured toscrape metrics with as few steps between itself and the target. Even if there is a valid edge case, I'd not mention this anywhere in the docs to avoid pointing people down the wrong path. We should even consider actively warning to use it instead of scraping targets directly. |
This comment has been minimized.
This comment has been minimized.
|
@grobie for example, kube-state-metrics from a Prometheus that is not part of the overlay. Additionally this would avoid issues with many-to-many matching and aggregations if there is more than one instance of it. Not the way I would recommend doing it but I can see the need. @discordianfish LGTM, thank you! |
This comment has been minimized.
This comment has been minimized.
|
It's one of those things that doesn't make sense until you have to because the alternative would be a month-long cross team project to refactor your infrastructure. Either way, I believe even without this point exposing the ingresses make sense. I assume you agree? |
This comment has been minimized.
This comment has been minimized.
|
I think ingress discovery would be a great addition. My point is more about
the documentation, I think I'd only list the first of your use case, and
leave the rest to the reader.
…On Thu, Aug 24, 2017 at 11:00 AM discordianfish ***@***.***> wrote:
It's one of those things that doesn't make sense until you have to because
the alternative would be a month-long cross team project to refactor your
infrastructure. Either way, I believe even without this point exposing the
ingresses make sense. I assume you agree?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3071 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAANaJgYPAvypdB8Lu0ZQlXFsfNkVIucks5sbTujgaJpZM4O2tO0>
.
|
This comment has been minimized.
This comment has been minimized.
|
That sounds reasonable |
This comment has been minimized.
This comment has been minimized.
|
The |
discordianfish
closed this
in
#3111
Sep 4, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
arnisoph commentedAug 14, 2017
It'd be great to have automatic discovery of ingress resources based on annotations like for services, pods, endpoints, etc. for blackbox checks and similar:
Right now ingress doesn't seem to be implemented yet at all.