kubernetes / kube-state-metrics

Add-on agent to generate and expose cluster-level metrics.
https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/
Apache License 2.0
5.44k stars 2.02k forks source link

`kube_ingress_tls` produces duplicate metrics for duplicate Ingress hosts #2550

Open mmckeen opened 2 weeks ago

mmckeen commented 2 weeks ago

What happened:

For an Ingress with the following spec:

  ingressClassName: external
  rules:
  - host: foo.com
    http:
      paths:
      - foo
  - host: foo.com
    http:
      paths:
      - bar
  tls:
  - hosts:
    - foo.com
    - foo.com
    secretName: foo-secret

kube-state-metrics produces duplicate kube_ingress_tls metrics resulting in Error on ingesting samples with different value but same timestamp errors when Prometheus scrapes these metrics.

What you expected to happen:

Only a single metric is produced and kube-state-metrics de-duplicates on the tls_host label.

How to reproduce it (as minimally and precisely as possible):

See above.

Anything else we need to know?:

N/A

Environment:

k8s-ci-robot commented 2 weeks ago

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.