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>
Simplify the implementation of the MetricsWriter to avoid code
duplication between single and multi stores scenarios.
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
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>
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>
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>
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>
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.
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>
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>
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>
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>