-
Notifications
You must be signed in to change notification settings - Fork 551
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
[docs] Config Walkthroughs and FAQs #95
Conversation
The config docs had a find/replace error in the naming section, leading to an erroneus `as` clause. This fixes that.
I like it! Then I would jump into how custom metrics can be configured to expose this exact URL for HPA to be happy. |
README.md
Outdated
and more information about configuring the adapter in the [docs](/docs/config.md). | ||
|
||
Next, check if the discovery information looks right. You should see the metrics showing | ||
up as associated with the resources you expect at. `/apis/custom.metrics.k8s.io/v1beta1/`. |
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.
This could maybe be kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 | jq .
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.
Agree, at least it should mention kubectl get --raw
somewhere here.
- seriesQuery: 'http_requests_total{kubernetes_namespace!="",kubernetes_pod_name!=""}' | ||
resources: | ||
overrides: | ||
kubernetes_namespace: {resource: "namespace"} |
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.
Is there somewhere that lists the available resource types? It might be good to include a link to that around this section.
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.
There is a command, but it can change at any time due to CRDs, aggregated API servers, etc. I'll add a note about it.
docs/config-walkthrough.md
Outdated
kubernetes_pod_name: {resource: "pod"} | ||
``` | ||
|
||
This says that each label represents its corresponding reosurce. Since the |
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.
typo: reosurce
docs/config-walkthrough.md
Outdated
Since we're only working with a single metric anyway, we could replace | ||
`<<.Series>>` with `http_requests_total`. | ||
|
||
Now, if we put run an instance of the Prometheus adapter with this |
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.
if we put run
docs/walkthrough.md
Outdated
the adapter for your particular metrics and labels. | ||
the adapter for your particular metrics and labels. The [configuration | ||
walkthrough](/docs/config-walkthrough.md) gives an end-to-end | ||
configuration tutorial for configure the adapter for a scenario similar to |
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.
for configuring
docs/walkthrough.md
Outdated
### Quantity Values | ||
|
||
Notice that the API uses Kubernetes-style quantities to describe metric | ||
values. These quantities use SI suffixes instead of decimal points. The |
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.
There are two spaces after some periods here
5485817
to
4579fc9
Compare
README.md
Outdated
|
||
First, check your configuration. Does it select your metric? You can find the | ||
[default configuration](/deploy/custom-metrics-config-map.yaml) in the deploy directory, | ||
and more information about configuring the adapter in the [docs](/docs/config.md). |
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.
It would be helpful to have a command to return all metrics. Not only the registered metric names but the actual per pod/object metrics. That would help to validate this.
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 agree. I'm currently struggling with the config and was hoping there's an easy way to list what it can "see".
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.
Ah, never mind ... found what I was looking for in https://github.com/DirectXMan12/k8s-prometheus-adapter/pull/95/files#r208729936.
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.
This only shows what metrics it knows about but you still might not have a metric with the right labels for a particular HPA. In that case it would be useful to have a expression that also returns the per-object/pod metrics.
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.
Yeah, initially I came to the same conclusion eventually. 😅
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 you file a separate issue for that?
Great, that will help a lot! I'd also add some words around using object vs pod metrics. Another thing I haven't figured out (not needing it right now) is how to make the HPA scale down of a metric goes up. |
whichever metrics you want in the `metricsQuery`! The series query can contain | ||
whichever metrics you want, as long as they have the right set of labels. | ||
|
||
For example, if you have two metrics `foo_total` and `foo_count`, you might write |
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.
It could be useful for clarity to say that foo_total
has the label system_name
which represents the actual node
TODO: for me: make sure to add an FAQ entry about flickering metrics |
@DirectXMan12 This is really great, make the configuration clearer. Thank you! 🏆 |
A helful community member rightly pointed out that configuring the adapter was a bit confusing, and a step-by-step example would be useful. This adds such an example, and links to it from relevant places.
Quantities continue to confuse people, so adding concrete examples should help.
This adds some FAQs to the README containing information about certs, labelling, configuration, quantities, and multiple metrics.
This restructures the walkthrough to focus on the goal of scaling an application from the start. We start out with an application and an autoscaler, and then walk through how we can make the autoscaler actually able to function.
4579fc9
to
a1f4aab
Compare
…ncy-openshift-4.15-ose-prometheus-adapter OCPBUGS-24155: Updating ose-prometheus-adapter-container image to be consistent with ART
This adds a more hands-on configuration example, plus a few FAQs.