Commit graph

48 commits

Author SHA1 Message Date
Olivier Lemasle
0ea1c1b8d3 Use Golangci-lint 2022-11-28 23:17:16 +01:00
Olivier Lemasle
e740fee947 Fix segfault when using --prometheus-token-file 2022-11-09 18:06:38 +01:00
Damien Grisonnet
303ac6fd45 cmd/adapter: recover klog flags
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-08-12 18:50:41 +02:00
Kubernetes Prow Robot
dd85956fbf
Merge pull request #509 from ksauzz/feature/query-verb
Add --prometheus-verb to support POST requests to prometheus servers
2022-08-12 05:34:43 -07:00
Kazuhiro Suzuki
65abf73917 Update help about --prometheus-verb option 2022-08-12 12:45:22 +09:00
Damien Grisonnet
cca107d97c *: support new MetricsGetter interface
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-08-11 15:04:45 +02:00
Kazuhiro Suzuki
a8742cff28 Add --prometheus-verb to support POST requests to prometheus servers 2022-06-28 18:23:52 +09:00
Leo Lei
bb4722e38b Fix external metrics provider not respecting metrics-max-age 2021-09-24 18:42:24 +08:00
Damien Grisonnet
4eb6c313a1 go.mod: update custom-metrics-apiserver to v1.22.0
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-08-11 13:56:45 +02:00
Kubernetes Prow Robot
eef6b8fef1
Merge pull request #436 from arajkumar/openapi-for-external-and-custom-metrics
fix: add openapi spec for custom and external metrics types
2021-07-19 07:36:52 -07:00
Arunprasad Rajkumar
6cea5b88ca
fix: add openapi spec for custom and external metrics types
Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-07-19 19:27:43 +05:30
Kubernetes Prow Robot
97236f92ed
Merge pull request #432 from discordianfish/prometheus-request-headers
Support setting headers on requests to Prometheus
2021-07-19 05:34:51 -07:00
Johannes 'fish' Ziemke
d84340cc85 Support setting headers on requests to Prometheus 2021-07-17 14:44:35 +02:00
Arunprasad Rajkumar
aed49ff54f
fix: incorrect type used for openapi spec
Prior to this fix, openapi spec for prometheus-adapter apiextension was based on the type "k8s.io/sample-apiserver/pkg/apiserver" which is incorrect. Due to the incorrect type, `kubectl explain podmetrics` (or nodemetrics) wasn't showing any doc for any resources from metrics.k8s.io/v1beta1.

This changeset fixes the problem by using the right type(sigs.k8s.io/metrics-server/pkg/api) for the openapi generation.

This also helped to remove the sample-apiserver dependency from
prometheus-adapter.

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-07-15 19:39:59 +05:30
Damien Grisonnet
152cf3bbaa cmd: run pod informer
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-06-07 16:10:13 +02:00
Damien Grisonnet
cf45915a4a pkg: only account for Pods in running state
Create the pod lister based on a filtered informer factory that will
filter non-running pods so that prometheus-adapter don't expect metrics
from them.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-06-02 11:38:09 +02:00
Damien Grisonnet
9dfbca09ca go.mod: move to sigs.k8s.io golang package
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-06-01 17:35:45 +02:00
Damien Grisonnet
c67e8f5956 go.mod: bump dependencies
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-06-01 15:25:56 +02:00
Damien Grisonnet
9db8d2f731 cmd/adapter: add signal handler
Add a signal handler stopping the adapter if it receives a SIGINT or
SIGTERM signal. This prevent the prometheus-adapter pod from being stuck
in "Terminating" state.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-03-29 17:24:49 +02:00
Kubernetes Prow Robot
019a27f200
Merge pull request #354 from iyalang/feature/add-cert-auth
add TLS auth for accessing Prometheus
2021-03-01 05:18:42 -08:00
Iya Lang
808bd76c5a add TLS auth for accessing Prometheus 2021-02-22 21:39:58 +01:00
paulfantom
cd55a67b89
*: move all imports to github.com/kubernetes-sigs/prometheus-adapter
Signed-off-by: paulfantom <pawel@krupa.net.pl>
2021-02-22 15:49:03 +01:00
Sergiusz Urbaniak
752ce84723 cmd/*,pkg/*,docs,go.mod: bump custom-metrics-apiserver, metrics-server 2020-10-28 15:52:12 +01:00
Sergiusz Urbaniak
a858d53495 pkg/*,cmd/*: move to k8s.io/klog/v2 2020-10-28 15:48:05 +01:00
Johannes Würbach
1d44cbbbb8
Serve openapi spec 2020-10-23 11:06:41 +02:00
Sergiusz Urbaniak
2678f90c5e
Merge pull request #230 from weibeld/master
Set --metrics-max-age default value equal to relist interval
2020-09-04 10:02:56 +02:00
Clayton Coleman
c6ac5cbc87
*: Update to sigs.k8s.io/metrics-server latest
Pick up changes to 1.17 to custom-metrics-apiserver and the latest
changes in metrics-server to allow us to show table results for
podmetrics and nodemetrics. Fix import and interface changes as
necessary.

The localvendor directory is an artifact of a change in sigs.k8s.io:

sigs.k8s.io/metrics-server now requires this dependency in order to
resolve, even though we do not use the scraper package.

go: sigs.k8s.io/metrics-server@v0.3.7 requires
    k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1@v0.0.0: reading k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1/pkg/kubelet/apis/stats/v1alpha1/go.mod at revision pkg/kubelet/apis/stats/v1alpha1/v0.0.0: unknown revision pkg/kubelet/apis/stats/v1alpha1/v0.0.0
2020-04-08 11:47:25 -04:00
Daniel Weibel
4788770bf6 Fix formatting 2019-08-14 19:40:37 +02:00
Daniel Weibel
8d8bfc7c33 Set default value of --metrics-max-age equal to --metrics-relist-interval 2019-08-14 18:47:54 +02:00
Sergiusz Urbaniak
f18b6fd370 *: replace glog with klog 2019-04-24 11:04:42 +02:00
Sergiusz Urbaniak
f69586b71c cmd/adapter: fix logs package
... as it moved.

https://github.com/kubernetes/kubernetes/pull/72890
2019-04-24 11:04:42 +02:00
John Delivuk
ff409a0994
Refactoring external to leverage naming 2019-03-26 18:57:02 -04:00
John Delivuk
3f7f249cb8
Removing RestMapper, cleaning up notification hanlder 2019-03-08 13:29:36 -05:00
John Delivuk
ed9eb31b3a
CustomProvider needed to have references updated as well 2019-02-10 19:12:29 -05:00
Solly Ross
c2e176bb23
Merge pull request #158 from linux-on-ibm-z/cross-compile
Edited Makefile to add cross build support for s390x.

Adding External Metrics Provider
2019-02-10 15:59:11 -05:00
Sergiusz Urbaniak
326bf3c276 cmd/adapter: add prometheus bearer token configuration
Often prometheus is gated by some proxy requiring an auth bearer
token. Currently there is no possibility to configure one except for
providing a full-fledged kubeconfig.

This fixes it by adding a new flag pointing to an optional file
containing the auth bearer for prometheus communication.
2018-12-05 11:45:48 +01:00
Solly Ross
99104cba2a
Merge pull request #136 from nilebox/start-flag
Add a separate flag for 'start' parameter
2018-12-04 12:23:26 -08:00
Matthias Loibl
9fb46c3c55
Create a NewCertPool for custom CA certificate 2018-12-03 19:47:37 +01:00
Matthias Loibl
4a16ae6d9a
Log info when successfully loading certificates 2018-12-03 17:57:19 +01:00
Matthias Loibl
bef034e699
Improve error handling in adapter.go 2018-12-03 17:18:53 +01:00
Nail Islamov
88c0ad0b6a
Add validation 2018-11-28 12:20:09 +11:00
Nail Islamov
3f1b120eda
Add a flag metrics-start-duration 2018-11-28 12:13:07 +11:00
Matthias Loibl
5d837a29dd
Add --prometheus-ca-file flag for specific ca 2018-11-23 17:25:22 +01:00
Solly Ross
5f52b29d47 Disable the custom metrics API with no rules
This disables the custom metrics API when no custom metrics rules are
given (the resource metrics API acts equivalently).  This allows a given
adapter to serve only one of the APIs, if desired.
2018-10-03 11:05:43 -04:00
Solly Ross
c5801455ec Introduce support for the resource metrics API
This introduces support for the resource metrics in the adapter.
The individual queries and window sizes are fully customizable via a new
config section.  This uses just the generic machinery from
metrics-server to serve the API.
2018-10-03 11:05:43 -04:00
Solly Ross
d02384477a Upgrade boilerplate to latest
The latest boilerplate comes with a lot of simplifications and helpers
that let us reduce the amount of code written.
2018-10-02 16:57:55 -04:00
Solly Ross
756ff0941e gofmt all files
Some of the files were not appropriately formatted.  Now that we run
`verify` in Travis, these'll need to be.
2017-06-27 19:01:39 -04:00
Lucas Käldström
a4aac78cca
Move the adapter binary to a separate subdir 2017-06-26 22:09:22 +03:00
Renamed from cmd/adapter.go (Browse further)