Commit Graph

89 Commits

Author SHA1 Message Date
Fabian Heib e4d2bd48c8 Support filtering annotations allowlist by "*"
Resolves: add-wilcard-allowlist-annotations
2023-11-02 17:22:02 +01:00
Kubernetes Prow Robot 535085e412
Merge pull request #2154 from chrischdi/pr-custom-metrics-missing-header
fix: custommetrics: always extract the headers but only write it when we have metrics
2023-08-28 09:43:42 -07:00
opeco17 634c04ef90 feat: enable metric-annotations-allowlist and metric-labels-allowlist for ResourceQuota 2023-08-28 13:59:14 +00:00
Christian Schlotter e57a28af2f
feat(custommetrics) always extract the metric headers but only write them when we have metrics 2023-08-18 17:42:47 +02:00
Pranshu Srivastava 25a1d8da05
Add support for variable VKs in CRS config
Add support for variable VKs in CRS config, while maintaining a cache
of discovered GVKs in the cluster, and updating it every 30s.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-05-20 01:26:02 +05:30
Manuel Rüger cef8c1fa4c feat!: Remove VerticalPodAutoscaler
BREAKING CHANGE: VPA is now supported only via Custom Resource Metrics

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-03-16 14:37:44 +01:00
Manuel Rüger fa5346405a Use structured logging 2023-01-27 17:35:26 +01:00
Kubernetes Prow Robot 4e30f4e319
Merge pull request #1921 from dgrisonnet/simplify-metricswriter
Remove duplicated MetricsWriter implementation
2022-12-06 23:32:38 -08:00
Damien Grisonnet e355c48da1 Remove duplicated MetricsWriter implementation
Simplify the implementation of the MetricsWriter to avoid code
duplication between single and multi stores scenarios.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-12-06 21:02:19 +01:00
Manuel Rüger b4b8c23b97 Add Metrics for EndpointSlices
Implements https://pkg.go.dev/k8s.io/api/discovery/v1#EndpointSlice

This resourcetype is disabled by default as they are very verbose and
have a high cardinality.
Metrics from endpointslices can be used to identify if specific pods are
part of an endpoint and thus discoverable through a service.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-11-26 01:44:29 +01:00
Kubernetes Prow Robot 3cf1b16f03
Merge pull request #1905 from kaitoii11/ingressclass
Add ingress class metrics
2022-11-24 07:40:04 -08:00
Kaito Ii 991857ccb5
Update internal/store/builder.go
Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>
2022-11-24 22:29:01 +09:00
JoaoBraveCoding 8f27e70760
autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+
Issue: https://github.com/kubernetes/kube-state-metrics/issues/1711

Problem: kube-state-metrics supports up to (latest k8s release - 3) k8s
version. Since v1.25 has been release we can update it to start using
autoscaler/v2.

Solution: update packages to start using autoscaler/v2

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2022-11-24 11:30:20 +00:00
Kaito Ii 4abefe268a add ingress class metrics 2022-11-23 23:16:36 +09:00
Kubernetes Prow Robot d5bd2c8274
Merge pull request #1823 from rexagod/1815
Support filtering label allowlist by "*"
2022-11-08 03:42:22 -08:00
Pranshu Srivastava d982bbc9c9
Support filtering label allowlist by "*"
Support filtering label allowlist by "*", which will expand to the
enabled resources, while infering their values based on its value(s).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-07 23:59:36 +05:30
Catherine Fang f9d29ba761 Refactoring 2022-11-04 08:44:00 -04:00
Catherine Fang d523f8e0e4 Move merging fieldselectors into app/server.go and replace namespaceFitler with fieldSelectorFilter 2022-11-04 08:44:00 -04:00
Catherine Fang 87a7793c7f Clean 2022-11-04 08:44:00 -04:00
Catherine Fang 2c0c8d2e51 Sharding per node 2022-11-04 08:44:00 -04:00
Pranshu Srivastava 052f572ae7
Handle singular labels in allowlist
Handle singular labels in allowlist failing when such a label is
supplied, in order to keep the behaviour in sync with --resources.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-09-26 12:17:32 +05:30
Kubernetes Prow Robot 3532203e8f
Merge pull request #1799 from kaitoii11/rolebinding
Add support for rolebindings
2022-08-18 12:22:12 -07:00
Kubernetes Prow Robot 4bb1b38397
Merge pull request #1807 from dmpe/strcuturedlogging_part1
feat(logging): migration to structure logging for main.go, pkg/ & internal/ folders
2022-08-16 00:17:07 -07:00
Manuel Rüger 2f20203c09 Replace pkg/errors with stdlib errors
github.com/pkg/errors is archived and not maintained anymore.
Replace it with stdlib functions.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-08-15 20:25:09 +02:00
dmpe f406c1aa1d feat(logging): migrate to structured logging
Signed-off-by: dmpe <John Malc> <cincenko@outlook.com>
2022-08-13 14:18:56 +02:00
Kaito Ii de8b1b40d2 fix typo 2022-08-07 02:03:09 +09:00
Kaito Ii 51df8fe763 add rolebinding metrics 2022-08-07 01:32:57 +09:00
Kaito Ii 3c9908d0b3 add role and cluster role
Signed-off-by: Kaito Ii <kaitoii1111@gmail.com>
2022-06-30 20:55:25 +09:00
Julian van den Berkmortel 6a24f639f8
Add support for the ServiceAccount resource (Ref: #1717) 2022-06-29 23:58:01 +02:00
Brad Ison d01ad03ae6
Use v1 PodDisruptionBudget and CronJob resources
Both the PodDisruptionBudget and CronJob resources have been promoted
to v1 as of Kubernetes v1.21 release.  The previous v1beta1 versions
are now deprecated, and will be removed in v1.25 and above.  This
updates all references to the new v1 versions.
2022-01-04 14:47:41 +01:00
Kubernetes Prow Robot 081cc3c0f1
Merge pull request #1644 from Garrybest/pr_crd
Extend kube-state-metrics to support Custom Resource metrics
2022-01-04 02:07:00 -08:00
Arunprasad Rajkumar 6d7780e2ee
pdb: use plural form of resource name in allowlist key
All other allowlist selectors are using plural form of resource name
except PDB. Actually it is a typo introduced by PR[1].

[1] https://github.com/kubernetes/kube-state-metrics/pull/1623

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-12-17 20:29:49 +05:30
Garrybest 3ca06c2692 Reform Builder to adapt custom resource registry
Signed-off-by: Garrybest <garrybest@foxmail.com>
2021-12-14 21:31:26 +08:00
Julian van den Berkmortel d767e99c98
Add FamilyGeneratorFilter interface and use it for the allow- / denylist 2021-11-16 17:49:13 +01:00
Arunprasad Rajkumar b5e78331cc
Implement kube_*_labels and kube_*_annotations metrics for pdb
This commit introduces kube_*_labels and kube_*_annotations metrics to
poddisruptionbudget to keep in consistency with other k8s objects.

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-10-26 21:19:40 +05:30
Min Wang c6ec339eea
address comments 2021-10-19 11:20:18 -07:00
Ahmed Mezghani 73d15e3b6c
Fix BuilderInterface 2021-10-11 18:11:57 +02:00
Min Wang 1b2c05c6c9 Add fieldSelector in listWatchFunc 2021-10-04 18:54:51 -07:00
Gabi Davar 58559bf0cf
put all arguments into one line. 2021-09-21 14:53:23 +03:00
Gabi Davar 443c91ae40
Expose configmap labels and annotations 2021-09-21 12:52:40 +03:00
Philip Gough 69f1af4834 internal: Migrate HPA API version to autoscaling/v2beta2
autoscaling/v2beta1 HorizontalPodAutoscaler is deprecated in v1.22+ and becomes
unavailable in v1.25+

This change updates the client to use autoscaling/v2beta2

Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
2021-08-31 13:01:23 +01:00
Sylvain Rabot 0e45534441
Merge remote-tracking branch 'origin/master' into annotations 2021-08-19 16:31:20 +02:00
Lan Liang 185687e6ad Change useApiServerCache to useAPIServerCache 2021-08-16 22:16:24 +08:00
Sylvain Rabot 96d08df5d0
Merge remote-tracking branch 'origin/master' into annotations 2021-08-16 08:50:02 +02:00
Lan Liang 3bbd8d5a88 Add arg use-api-server-cache to set resourceVersion=0 for ListWatch 2021-08-13 13:12:36 +08:00
Sylvain Rabot 754aeb786b
Merge remote-tracking branch 'origin/master' into annotations 2021-07-07 09:31:49 +02:00
fpetkovski a6eb25e3c6 rename buildStore to buildStores 2021-06-29 13:30:46 +02:00
fpetkovski 83887f1611 Replace multiListerWatcher with independent listWatchers per namespace
The multiListerWatcher is a composite object encapsulating multiple
ListerWatchers and implements the ListerWatcher interface.
With the current implementation, when an individual lister fails, the
entire List operation fails. This causes no metrics to be shown when KSM
has no permissions to a single namespace.

In addition to this, the multiListerWatcher takes advantage of internal
implementation details if the client-go library by modifiying and
relying on the ResourceVersion metadata field. This introduces a bug
where reconnecting to the API server will break the multiListerWatcher
completely.

This commit replaces the multiListerWatcher with individual
ListerWatchers per each configured namespace, resolving both issues.

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
2021-06-29 13:27:57 +02:00
Ahmed Mezghani 10460d749d
Make sure Builder implements BuilderInterface 2021-06-28 14:39:43 +02:00
Sylvain Rabot 65bc62af5c
Add kube_*_annotations metrics
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-04-29 16:04:16 +02:00