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.
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
As explained in the doc: "kube-state-metrics exposes raw data
unmodified from the Kubernetes API".
The goal of this change was to remove the kubctl logic introduced to
get the `Unknown` phase in `kube_pod_status_phase` metric.
With the introduction of `kube_pod_deleted` metric, it is now possible
to get the same result with a promQL query. (more info in this #1013).
Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
Aim of this PullRequest is to add several new pod metrics:
- kube_pod_deleted: Unix deletion timestamp
- kube_pod_status_reason: The pod status reasons (NodeLost, Evicted)
These new metrics can be used to determine the `pod.status.phase`
displayed by `kubectl`: Running, Terminated, Unknown…
It will allow removing the `kubectl` display logic added previously
to compute the “Unknown” phase.
Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
- To allow other external Stores, remove the `FamilyByteSlicer` interface
and give access directly to `metric.Family`.
- Move functions present in `pkg/metric/generator.go` to a dedicated package
`generator` in `pkg/metric_generator/generator.go`.
Signed-off-by: cedric lamoriniere <cedric.lamoriniere@datadoghq.com>
Report pod_restart_policy{...,type="Always|OnFailure|Never"} 1 for the
pod.spec.restartPolicy which allows an admin to know how many batch vs
service workload pods are running on the cluster.
Since the removal of collector, this introduces both the concept of the
store and the resources instead of collectors that the user passes in.
The user facing logs and flags were not changed as that would be a
regression.