Commit Graph

59 Commits

Author SHA1 Message Date
Braxton Schafer f6be9edd01 fix failing lint checks 2022-05-31 11:42:59 -05:00
Braxton Schafer 08ec940c28 Add kube_pod_ips gauge to pod metrics
Add experimental kube_pod_ips metric to show all IPs on a pod.
This is useful for dual-stack clusters where pods will have at least one
IPv4 and one IPv6 address. Current kube_pod_info metric only shows
the single IP exposed by .status.podIP.

Signed-off-by: Braxton Schafer <bschafer@cloudflare.com>
2022-05-31 11:42:56 -05:00
honpey 9f3e368490 internal/store: fix metrics slice length for init containers
In https://github.com/kubernetes/kube-state-metrics/pull/1731,
the dynamic slice was introduced to fix potential panic under
Spec.Containers scenario, however there may be same panic for
Spec.InitContainers scenario.

This patch fix it referring to https://github.com/kubernetes/kube-state-metrics/pull/1731

Signed-off-by: honpey <honpey@gmail.com>
2022-05-30 15:36:09 +08:00
Jan Fajerski 85c6b44237 internal/store: fix metrics slice length
Problem: In https://github.com/kubernetes/kube-state-metrics/pull/1723 a
potential panic in the pod metrics gathering was fixed by working around
a disconnect of `Spec.Containers` and `Status.ContainerStatuses`. The
slice storing the resulting metrics however was still defined based on
the length of the `Status.ContainerStatuses` list.

Solution: Make the slice dynamic and append metrics to it.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
2022-05-09 20:02:09 +02:00
Michal Fojtik 43d374b1cb
internal/store: fix potential panic in pod store 2022-04-25 13:53:50 +02:00
Kubernetes Prow Robot b4c34858cb
Merge pull request #1675 from geojaz/geojaz/add_kube_pod_nodeselector
Adds kube_pod_nodeselector metric
2022-03-01 01:07:51 -08:00
Sherif Abdel-Naby e205fee343
Extract mergeKeyValue logic into a central function 2022-02-10 04:12:35 +02:00
Eric Hole 9a6fae5fc3 kube_pod_nodeselector -> kube_pod_nodeselectors 2022-02-07 11:02:39 -08:00
Eric Hole 90689ccff3 Change kube_pod_nodeselector to be opt-in 2022-02-07 09:13:20 -08:00
Sherif Abdel-Naby 3a600f56c7
Optimize Slice Allocations 2022-02-05 18:53:35 +02:00
Eric Hole 6d1c11f148 Adds kube_pod_nodeselector metric 2022-02-04 15:01:02 -08:00
Min Wang 1b2c05c6c9 Add fieldSelector in listWatchFunc 2021-10-04 18:54:51 -07:00
Kubernetes Prow Robot 03e84f55d6
Merge pull request #1551 from dgrisonnet/revert-init-containers-requests
Revert init containers resource metrics rework
2021-09-30 06:06:08 -07:00
Gabi Davar 5016cca2de
add image_spec to pod (init)container info 2021-09-21 18:26:50 +03:00
Ids van der Molen 69e13ccb74 Add NodeAffinity and Shutdown to podStatusReasons 2021-09-14 20:42:12 +02:00
Damien Grisonnet 1352c476c7 pod: sync container resource metrics improvement
Init container resource metrics diverged from the container ones
although they should be similar.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-08-20 19:07:34 +02:00
Damien Grisonnet 3040c54b8b pod: rm reworked init container resource metrics
These metrics are superseded by the Pod resource metrics initiative in
Kubernetes. In 2.0.0, we removed the reworked container resource
metrics, but omitted the init container ones although they are also
covered by the Kubernetes effort.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-08-20 18:47:34 +02:00
Sylvain Rabot 96d08df5d0
Merge remote-tracking branch 'origin/master' into annotations 2021-08-16 08:50:02 +02:00
Sylvain Rabot 0e045365f4
Factorize some code
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-07-13 11:51:39 +02:00
Harjas 6324b16973 capture start time for containers in terminated state 2021-07-01 22:31:37 +05:30
Sylvain Rabot 65bc62af5c
Add kube_*_annotations metrics
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-04-29 16:04:16 +02:00
Lili Cosic 81ca495c9e Merge remote-tracking branch 'upstream/release-2.0' into bring-release-2.0 2021-03-05 15:14:49 +01:00
Lili Cosic 6e81605114 internal/store/pod.go: Pre-allocate metric slices optimistically 2021-02-25 09:46:36 +01:00
Lili Cosic fa5e260535 internal/store/pod.go: Only create last_terminated containers series if pods are
terminated. This reduces the cardinality of this metric greatly, as it was
one of the highest cardinality metrics pre 2.0.
2021-02-24 16:59:53 +01:00
Lili Cosic 025ae126df internal/store/pod.go: Only create terminated_reason series if pods are
terminated. This reduces the cardinality of this metric greatly, as it was
one of the highest cardinality metrics pre 2.0.
2021-02-09 15:50:38 +01:00
Lili Cosic a1b71c0ef0 internal/store/pod.go: Only create waiting_reason series if pods are
waiting. This reduces the cardinality of this metric greatly, as it was
one of the highest cardinality metrics pre 2.0.
2021-02-08 13:45:03 +01:00
Damien Grisonnet 8e6b214de2 internal/store: refactor pod and node generators
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2020-12-09 10:02:39 +01:00
Illya Chekrygin 4090e8b7aa
Add "uid" label to every pod metric to differentiate between pod instances with the same name.
Signed-off-by: Illya Chekrygin <illya.chekrygin@gmail.com>
2020-11-20 12:26:18 -08:00
Lili Cosic 0b76e7d4f4 internal/store: Rework label allow list for label metrics 2020-11-20 15:31:35 +01:00
Lili Cosic 0f4c5128ec internal/store: Rework label allow list for label metrics 2020-11-18 15:59:19 +01:00
Jimmy K Seto 122f2075c7 fix container resource limits metrics, which got dropped btwn 2.0.0-alpha.1 and 2.0.0-alpha.2 2020-11-03 11:42:57 -05:00
Jimmy K Seto 9078a53265 fix container resource limits metrics, which got dropped btwn 2.0.0-alpha.1 and 2.0.0-alpha.2 2020-11-02 14:48:04 -05:00
Eric Ernst 0cb814f725 pod: add gauge for runtimeclass handler
Add a metric gauge to provide observability for the runtimeclass
used for running a pod.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2020-10-26 08:03:31 -07:00
Lili Cosic df83631c0a internal/store/pod.go: Revert "Rework resource metrics" 2020-10-26 14:04:34 +01:00
Quentin Bisson 7250bc2b5c
Update go module path to k8s.io/kube-state-metrics/v2
Signed-off-by: Quentin Bisson <quentin@giantswarm.io>
2020-09-21 10:58:08 +02:00
Yuiko Mori 49197428ce Add DeprecatedVersion to struct FamilyGenerator 2020-08-06 10:31:29 +00:00
Prabhakar Mishra 0ff5482079 update client-go, k/api, k/apimachinery to v1.18.6 and vertical-pod-autoscaler to commit b7922d74509c
use clientgofix library

add context parameter in verticalpodautoscaler

rename PodDisruptionsAllowed to DisruptionsAllowed because of PR 85863 in k8s repo

lint fixes and rename PodDisruptionsAllowed to DisruptionsAllowed in test file

run go mod tidy
2020-07-30 01:54:34 +02:00
vikkyomkar b2fc4e1bab added new metric kube_pod_container_state_started 2020-07-26 11:35:37 +05:30
Frederic Branczyk cd42164e42
internal/store: Add named resource pod overhead metrics
This patch turns the generic pod overhead metrics into one metric per
resource as per Prometheus best practices.
2020-07-16 10:34:52 +02:00
Frederic Branczyk 98572212e8
internal/store: Add named init container resource request/limit metrics
This patch returns named resource request and limit metrics for well
known resources for init containers, but keeps the generic metric as an
extension mechanism.
2020-07-15 15:38:13 +02:00
Frederic Branczyk 4129feb3cc
internal/store: Add named resource limit metrics
This patch returns named resource request metrics for well known
resources, but keeps the generic metric as an extension mechanism.
2020-07-15 15:09:31 +02:00
Frederic Branczyk 584f7de830
internal/store: Add named resource request metrics
This patch returns named resource request metrics for well known
resources, but keeps the generic metric as an extension mechanism.
2020-07-15 14:59:19 +02:00
qw1mb0 bdb2e9284e add UnexpectedAdmissionError to kube_pod_status_reason metric 2020-05-16 21:19:25 +03:00
Frederic Branczyk 1610b64df8
pod: Add init container requests 2020-04-15 22:03:27 +02:00
Rustam Zagirov b61a3b320a add host_network to kube_pod_info 2020-03-18 21:23:37 +03:00
Olivier Lemasle 6fac7a2ddd Rename kube_pod_deleted to kube_pod_deletion_timestamp 2020-02-24 11:32:59 +01:00
Kubernetes Prow Robot 9216f8bb15
Merge pull request #1050 from clamoriniere/feature/removeKubectlLogic
[Pod] remove kubctl logic in kube_pod_status_phase
2020-02-12 10:48:52 -08:00
Kubernetes Prow Robot a618eab33d
Merge pull request #1053 from egernst/overhead
pod: add gauges for pod overhead
2020-02-10 11:11:54 -08:00
Eric Ernst c1895cdec3 pod: add gauges for pod overhead
Add a metric guage to provide observability for the overhead associated
with running a pod.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2020-02-07 22:15:36 -08:00
Philip Gough 58e7c50270
store: Remove non-identifying labels from pod metrics
Fixes #979

test:store - Updates unit test to reflect removal of 'node' name from labels

test: Update main_test for removal of node label from pod metrics
2020-02-07 14:00:16 +00:00