forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[stable/prometheus-adapter] conditionally register external metrics A…
…PI (helm#13716) (helm#14389) * [stable/prometheus-adapter] conditionally register external metrics API (helm#13716) The prometheus-adapter will NOT serve external metrics API if `externalRules` section is not specified. See this code: https://github.com/DirectXMan12/k8s-prometheus-adapter/blob/v0.5.0/cmd/adapter/adapter.go#L177 In that case, we cannot bindly register the external metrics API. Otherwise, we might see issues described in helm#13716. This patch fixed the issue by conditionally register the external metrics API. Fixes helm#13716 Signed-off-by: Jie Yu <[email protected]> * [stable/prometheus-adapter] bump chart version to 1.0.3 Bump the chart version to 1.0.3 due to the fix of helm#13716. Signed-off-by: Jie Yu <[email protected]> * [stable/prometheus-adapter] use 'and' to combine template directives To address the review comments. Signed-off-by: Jie Yu <[email protected]> * [stable/prometheus-adapter] add ci test values To improve the test coverage. Signed-off-by: Jie Yu <[email protected]>
- Loading branch information
1 parent
fd7ace6
commit 87c90e6
Showing
6 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
rules: | ||
external: | ||
- seriesQuery: '{__name__=~"^some_metric_count$"}' | ||
resources: | ||
template: <<.Resource>> | ||
name: | ||
matches: "" | ||
as: "my_custom_metric" | ||
metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
stable/prometheus-adapter/templates/external-metrics-cluster-role.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
stable/prometheus-adapter/templates/hpa-external-metrics-cluster-role-binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters