Compare commits

...

1297 Commits
v2.2.2 ... main

Author SHA1 Message Date
Kubernetes Prow Robot bc45a49c9b
Merge pull request #2719 from Rishab87/reason-label
feat: include reason label to `kube_deployment_status_condition`
2025-08-14 08:27:09 -07:00
Rishab87 012b46d220 adding empty string in reasons 2025-08-14 18:32:48 +05:30
Kubernetes Prow Robot 1556ac589f
Merge pull request #2723 from ydFu/patch-1
docs: Update metrics-store-performance-optimization.md
2025-08-13 10:53:09 -07:00
Rishab87 547afad282 adding reasons from deployment_utils.go 2025-08-13 22:35:44 +05:30
Kubernetes Prow Robot 997272f779
Merge pull request #2731 from kubernetes/dependabot/github_actions/actions/checkout-5.0.0
build(deps): Bump actions/checkout from 4.2.2 to 5.0.0
2025-08-11 12:55:07 -07:00
dependabot[bot] bd174abd54
build(deps): Bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 19:45:26 +00:00
Rishab87 b5820387c0 adding empty reason in allowedList 2025-08-11 20:50:42 +05:30
Rishab87 bc1e7f8965 fixing empty reasons and adding tests 2025-08-11 20:16:08 +05:30
Rishab87 b30335fa54 changing empty reasons to unkown 2025-08-08 21:46:48 +05:30
Ader Fu 9222ba465f
Update metrics-store-performance-optimization.md 2025-08-08 16:54:27 +08:00
Kubernetes Prow Robot 95b29ac8a9
Merge pull request #2714 from Rishab87/fix-md-format
fix: Fixed the format of Markdown files
2025-08-07 06:05:43 -07:00
Rishab87 f8f39bc9fc disabling md041 in PR template 2025-08-07 17:40:54 +05:30
Kubernetes Prow Robot 3a0eec4626
Merge pull request #2720 from mrueg/k8s-1.33
chore: Build with k8s 1.33
2025-08-07 01:07:41 -07:00
Kubernetes Prow Robot d680e8c991
Merge pull request #2705 from rashmichandrashekar/rashmi/ksm-config-override
fix: Config file overrides apply to some fields but not other
2025-08-06 01:09:26 -07:00
Rashmi Chandrashekar 921147623e support overrides 2025-08-05 19:30:00 -07:00
Rishab87 5de7a63748 addressing reviews 2025-08-05 17:23:48 +05:30
Rishab87 0a50cabaf9 added reason label 2025-08-05 16:35:42 +05:30
Manuel Rüger 72ed667151 chore: Build with k8s 1.33 2025-08-04 23:16:39 +02:00
Kubernetes Prow Robot 9add5df58e
Merge pull request #2716 from taraspos/patch-1
fix(customresourcestate): fix index out of range
2025-08-04 11:51:39 -07:00
Kubernetes Prow Robot 61cb551bb5
Merge pull request #2717 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.23.0
build(deps): Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0
2025-08-04 07:33:40 -07:00
Rishab87 fc6ab5bf65 addressing reviews & fixing CI errors 2025-08-04 19:58:37 +05:30
Rishab Kumar Jha c309d3a00f
Update README.md
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2025-08-04 19:53:32 +05:30
dependabot[bot] cb6bdd2046
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 13:29:57 +00:00
Taras dc54dc6580
customresourcestate: fix panic 2025-08-04 14:07:41 +01:00
Rishab87 63a0298d5a fixed md024, md036, md040, md041, md033 rules 2025-08-02 23:42:45 +05:30
Kubernetes Prow Robot 61be81fa1f
Merge pull request #2712 from kubernetes/dependabot/go_modules/sigs.k8s.io/yaml-1.6.0
build(deps): Bump sigs.k8s.io/yaml from 1.5.0 to 1.6.0
2025-07-27 16:14:27 -07:00
dependabot[bot] c106a38fab
build(deps): Bump sigs.k8s.io/yaml from 1.5.0 to 1.6.0
Bumps [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/kubernetes-sigs/yaml/releases)
- [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/yaml/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/yaml
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-27 23:06:40 +00:00
Kubernetes Prow Robot 104c83fb9f
Merge pull request #2710 from CatherineF-dev/master
chore: Add CatherineF-dev into SECURITY_CONTACTS
2025-07-24 10:00:27 -07:00
CatherineF-dev 9f6f1cd762
Add CatherineF-dev into SECURITY_CONTACTS 2025-07-21 15:25:25 -04:00
Kubernetes Prow Robot f421b9a69a
Merge pull request #2707 from kubernetes/dependabot/go_modules/github.com/KimMachineGun/automemlimit-0.7.4
build(deps): Bump github.com/KimMachineGun/automemlimit from 0.7.3 to 0.7.4
2025-07-14 05:22:23 -07:00
dependabot[bot] dd2ca7b09b
build(deps): Bump github.com/KimMachineGun/automemlimit
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.7.3 to 0.7.4.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.7.3...v0.7.4)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-version: 0.7.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-14 11:37:51 +00:00
Kubernetes Prow Robot 6942640a45
Merge pull request #2699 from yshngg/feature/pod-metrics/unscheduled-time
feat(pod): Add new metric for pod unscheduled time tracking
2025-07-11 17:09:31 -07:00
yshngg a483701408 feat(pod): add new metric for pod unscheduled time tracking
The changes introduce a new metric generator `kube_pod_status_unscheduled_time` to record the Unix timestamp when pods transition to unscheduled status. This enhances monitoring capabilities for scheduling issues by capturing exact transition times during `PodScheduled` condition changes.
2025-07-01 16:06:28 +08:00
Kubernetes Prow Robot 56d3b561e6
Merge pull request #2696 from kubernetes/dependabot/go_modules/github.com/oklog/run-1.2.0
build(deps): Bump github.com/oklog/run from 1.1.0 to 1.2.0
2025-06-30 05:14:32 -07:00
Kubernetes Prow Robot dff9a1e8f5
Merge pull request #2697 from kubernetes/release-2.16
chore: Merge v2.16 back into `main`
2025-06-30 05:12:32 -07:00
dependabot[bot] a0889d56c8
build(deps): Bump github.com/oklog/run from 1.1.0 to 1.2.0
Bumps [github.com/oklog/run](https://github.com/oklog/run) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/oklog/run/releases)
- [Commits](https://github.com/oklog/run/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/oklog/run
  dependency-version: 1.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-30 11:32:37 +00:00
Kubernetes Prow Robot edc9db4649
Merge pull request #2694 from kubernetes/dependabot/go_modules/sigs.k8s.io/yaml-1.5.0
build(deps): Bump sigs.k8s.io/yaml from 1.4.0 to 1.5.0
2025-06-30 04:32:32 -07:00
dependabot[bot] 0a8f32ff12
build(deps): Bump sigs.k8s.io/yaml from 1.4.0 to 1.5.0
Bumps [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/kubernetes-sigs/yaml/releases)
- [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/yaml/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/yaml
  dependency-version: 1.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-30 11:16:25 +00:00
Kubernetes Prow Robot 291a962840
Merge pull request #2692 from rexagod/prep-216
chore: Prep `v2.16` release
2025-06-25 05:52:30 -07:00
Pranshu Srivastava c6ae6f53f7
chore: Prep `v2.16` release
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-06-24 17:04:39 +05:30
Kubernetes Prow Robot 9576360078
Merge pull request #2693 from rexagod/make-examples-fix
fix: Fix `examples` target
2025-06-23 09:19:56 -07:00
Pranshu Srivastava 8b2aa61c70
fix: Fix `examples` target
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-06-23 19:27:58 +05:30
Kubernetes Prow Robot d59fe58df9
Merge pull request #2686 from mrueg/authfilter
feat: Add AuthFilter
2025-06-23 06:18:54 -07:00
Manuel Rüger 5e8e4fffa6
Update tests/e2e/auth-filter_test.go
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2025-06-23 14:18:44 +02:00
Manuel Rüger 301240eccc
Update tests/e2e/auth-filter_test.go
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2025-06-23 14:18:35 +02:00
Manuel Rüger a5789613f1 feat: Add AuthFilter
This adds an Authentication/Authorization filter through Kubernetes'
TokenReview / SubjectAccessReview resources.

The client config for kube-state-metrics needs a clusterrole for

* apiGroups: authentication.k8s.io, resources: tokenreviews, verbs: create
* apiGroups: authorization.k8s.io, resources: subjectaccessreviews, verbs: create

The Prometheus client needs a clusterrole for

* nonResourceURLs: "/metrics", verbs: get
2025-06-23 14:17:52 +02:00
Kubernetes Prow Robot 15e6171c37
Merge pull request #2691 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.65.0
build(deps): Bump github.com/prometheus/common from 0.64.0 to 0.65.0
2025-06-23 04:50:54 -07:00
dependabot[bot] 873c140040
build(deps): Bump github.com/prometheus/common from 0.64.0 to 0.65.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.64.0 to 0.65.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.64.0...v0.65.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.65.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-23 10:30:43 +00:00
Kubernetes Prow Robot 5c130dadad
Merge pull request #2689 from mrueg/k8s-1.32.6
chore: Bump to k8s 1.32.6
2025-06-23 02:26:59 -07:00
Manuel Rüger 2258ba71e8 chore: Bump to k8s 1.32.6 2025-06-19 21:04:03 +02:00
Kubernetes Prow Robot 55d2a7cfac
Merge pull request #2672 from rexagod/sync-caches
fix: Clean up CR reflectors after parent CRD deletion
2025-06-19 09:26:54 -07:00
Kubernetes Prow Robot 97bfa326ab
Merge pull request #2687 from mrueg/makefile-fix-typo
fix: Fix typo in Makefile
2025-06-19 00:48:52 -07:00
Pranshu Srivastava ea6b123caf
fix: close reflectors once their corresponding CRDs are dropped
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-06-19 03:07:45 +05:30
Manuel Rüger b9068888d0 Makefile: Fix typo 2025-06-18 22:22:55 +02:00
Kubernetes Prow Robot dbf6e9b4e2
Merge pull request #2677 from mrueg/bump-kind
chore: Bump kind
2025-06-17 06:30:59 -07:00
Kubernetes Prow Robot d84b10a125
Merge pull request #2626 from mrueg/limit-list
feat: Introduce object limits
2025-06-17 06:29:00 -07:00
Kubernetes Prow Robot 775e4586ad
Merge pull request #2683 from kubernetes/dependabot/go_modules/github.com/KimMachineGun/automemlimit-0.7.3
build(deps): Bump github.com/KimMachineGun/automemlimit from 0.7.2 to 0.7.3
2025-06-15 11:52:57 -07:00
dependabot[bot] bea09e59f0
build(deps): Bump github.com/KimMachineGun/automemlimit
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.7.2...v0.7.3)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-version: 0.7.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-15 18:44:43 +00:00
Manuel Rüger 4519b2848b feat: Introduce object limits
This change allows user-controlled limits on how many objects KSM will
list from the API. This is helpful to prevent resource exhaustion on
KSM, in case the API creates too many resources.

The object limit it set globally and applied per resource watched.
2025-05-31 23:29:41 +02:00
Manuel Rüger 99224f2c29 chore: Bump kind 2025-05-31 22:16:44 +02:00
Kubernetes Prow Robot 84e2d8fe69
Merge pull request #2670 from rexagod/add-pathtype-to-ingress-path
feat: add `pathType` to `ingress_path`
2025-05-31 11:44:12 -07:00
Kubernetes Prow Robot 6beab20acd
Merge pull request #2676 from kubernetes/dependabot/go_modules/github.com/go-logr/logr-1.4.3
build(deps): Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
2025-05-31 11:34:11 -07:00
dependabot[bot] bb2ad9d2ea
build(deps): Bump github.com/go-logr/logr from 1.4.2 to 1.4.3
Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.4.2...v1.4.3)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-version: 1.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-31 18:24:54 +00:00
Kubernetes Prow Robot 28bf0e817d
Merge pull request #2644 from carlosmorenokm1/fix-pod-status-reason
fix: report correct reason in kube_pod_status_reason metric
2025-05-25 21:02:36 -07:00
Kubernetes Prow Robot 1018969872
Merge pull request #2673 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.64.0
build(deps): Bump github.com/prometheus/common from 0.63.0 to 0.64.0
2025-05-18 14:15:14 -07:00
dependabot[bot] 043b59ab08
build(deps): Bump github.com/prometheus/common from 0.63.0 to 0.64.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.63.0 to 0.64.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.63.0...v0.64.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.64.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-18 21:06:57 +00:00
Kubernetes Prow Robot 8ec1fb3c15
Merge pull request #2669 from kubernetes/dependabot/github_actions/actions/setup-go-5.5.0
build(deps): Bump actions/setup-go from 5.4.0 to 5.5.0
2025-05-12 03:27:15 -07:00
Pranshu Srivastava e178d8e582
enhancement: add `pathType` to `ingress_path`
This avoids duplicate metrics (and thus, `PrometheusDuplicateTimestamps`) for schemas such as:
```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx-example
  rules:
  - http:
      paths:
      - backend:
          service:
            name: cart
            port:
              number: 3000
        path: /nvc/cart
        pathType: Prefix
      - backend:
          service:
            name: cart
            port:
              number: 3000
        path: /nvc/cart
        pathType: Exact
```

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-05-12 15:34:00 +05:30
dependabot[bot] 20af6bac6d
build(deps): Bump actions/setup-go from 5.4.0 to 5.5.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0aaccfd150...d35c59abb0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 5.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-12 09:41:04 +00:00
Kubernetes Prow Robot 9ea1495953
Merge pull request #2656 from mrueg/port-away-gopkg.yamlv3
chore: Port away from gopkg.in/yaml.v3
2025-05-07 09:21:24 -07:00
Kubernetes Prow Robot 090535fcd2
Merge pull request #2667 from kubernetes/dependabot/go_modules/github.com/KimMachineGun/automemlimit-0.7.2
build(deps): Bump github.com/KimMachineGun/automemlimit from 0.7.1 to 0.7.2
2025-05-05 02:43:58 -07:00
dependabot[bot] d45250dec2
build(deps): Bump github.com/KimMachineGun/automemlimit
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.7.1...v0.7.2)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-version: 0.7.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 09:36:26 +00:00
Manuel Rüger 3b21633bee chore: Port away from gopkg.in/yaml.v3
This is deprecated by upstream and we can use sigs.k8s.io/yaml now.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2025-04-22 10:58:08 +02:00
Kubernetes Prow Robot 0b01e3abce
Merge pull request #2654 from kubernetes/dependabot/github_actions/kubernetes-sigs/release-actions-0.3.1
build(deps): Bump kubernetes-sigs/release-actions from 0.3.0 to 0.3.1
2025-04-21 03:29:00 -07:00
dependabot[bot] 012b785665
build(deps): Bump kubernetes-sigs/release-actions from 0.3.0 to 0.3.1
Bumps [kubernetes-sigs/release-actions](https://github.com/kubernetes-sigs/release-actions) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/kubernetes-sigs/release-actions/releases)
- [Changelog](https://github.com/kubernetes-sigs/release-actions/blob/main/RELEASE.md)
- [Commits](a69972745f...a30d93cf2a)

---
updated-dependencies:
- dependency-name: kubernetes-sigs/release-actions
  dependency-version: 0.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-21 10:08:57 +00:00
Kubernetes Prow Robot 209f3ab5fa
Merge pull request #2652 from kubernetes/dependabot/go_modules/github.com/prometheus/client_model-0.6.2
build(deps): Bump github.com/prometheus/client_model from 0.6.1 to 0.6.2
2025-04-12 16:54:41 -07:00
Kubernetes Prow Robot d060e4f32c
Merge pull request #2639 from kubernetes/dependabot/go_modules/github.com/spf13/viper-1.20.1
build(deps): Bump github.com/spf13/viper from 1.20.0 to 1.20.1
2025-04-12 16:52:41 -07:00
dependabot[bot] aab32a9e1a
build(deps): Bump github.com/spf13/viper from 1.20.0 to 1.20.1
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.20.0 to 1.20.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.20.0...v1.20.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-12 23:44:47 +00:00
dependabot[bot] e204ab31cb
build(deps): Bump github.com/prometheus/client_model from 0.6.1 to 0.6.2
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.6.1 to 0.6.2.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.6.1...v0.6.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-version: 0.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-12 23:44:02 +00:00
Kubernetes Prow Robot 38e2fa6e53
Merge pull request #2650 from dgrisonnet/catherine-approver
chore: add CatherineF-dev as an approver
2025-04-10 11:24:51 -07:00
Damien Grisonnet f6e2b5fbda chore: add CatherineF-dev as an approver
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2025-04-10 19:04:43 +02:00
Kubernetes Prow Robot 3aee5ff2bb
Merge pull request #2648 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.22.0
build(deps): Bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0
2025-04-09 04:34:39 -07:00
dependabot[bot] 55e124f509
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.21.1 to 1.22.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.21.1...v1.22.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-08 08:19:21 +00:00
Kubernetes Prow Robot f0f9898fa1
Merge pull request #2643 from mrueg/golangci-v2
chore: Migrate to golangci-lint v2
2025-04-07 22:18:39 -07:00
Kubernetes Prow Robot a0d9835e78
Merge pull request #2647 from kubernetes/dependabot/go_modules/github.com/fsnotify/fsnotify-1.9.0
build(deps): Bump github.com/fsnotify/fsnotify from 1.8.0 to 1.9.0
2025-04-07 05:40:38 -07:00
dependabot[bot] a09d690396
build(deps): Bump github.com/fsnotify/fsnotify from 1.8.0 to 1.9.0
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 10:22:23 +00:00
Carlos Moreno 05187b47e2 fix: report correct values in kube_pod_status_reason metric (added tests) 2025-04-01 18:32:26 -05:00
Carlos Moreno 518db3d3cd fix: report correct values in kube_pod_status_reason metric 2025-03-31 23:01:45 -05:00
Manuel Rüger 0c029b690e chore: Migrate to golangci-lint v2 2025-03-31 14:52:47 +02:00
Kubernetes Prow Robot ffd8f41131
Merge pull request #2641 from ricardbejarano/main
fix: bump golang.org/x/net to v0.38.0 (fixes CVE-2025-22870 & CVE-2025-22872)
2025-03-31 04:22:40 -07:00
Ricard Bejarano 4f62f0fde4
go mod tidy
Signed-off-by: Ricard Bejarano <ricard@bejarano.io>
2025-03-31 11:38:34 +02:00
Ricard Bejarano 1c923dc83b
fix: bump golang.org/x/net to v0.38.0 (fixes CVE-2025-22872) 2025-03-30 11:49:41 +02:00
Ricard Bejarano a6ff8ae41c
fix: bump golang.org/x/net to v0.36.0 (fixes CVE-2025-22870) 2025-03-29 10:17:12 +01:00
Kubernetes Prow Robot b528c28f7e
Merge pull request #2634 from kubernetes/dependabot/github_actions/actions/setup-go-5.4.0
build(deps): Bump actions/setup-go from 5.3.0 to 5.4.0
2025-03-24 03:00:34 -07:00
dependabot[bot] bc2a57140c
build(deps): Bump actions/setup-go from 5.3.0 to 5.4.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](f111f3307d...0aaccfd150)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 09:52:08 +00:00
Kubernetes Prow Robot 5f116914f1
Merge pull request #2616 from rexagod/2594
feat: Use `dlclark/regexp2` over standard library's package
2025-03-19 01:10:31 -07:00
Pranshu Srivastava 8b631bbff4
feat: Use `dlclark/regexp2` over standard library's package
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-03-18 18:57:25 +05:30
Kubernetes Prow Robot bc60722ddd
Merge pull request #2630 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.63.0
build(deps): Bump github.com/prometheus/common from 0.62.0 to 0.63.0
2025-03-17 18:07:49 -07:00
Kubernetes Prow Robot 456ac8f2e8
Merge pull request #2629 from kubernetes/dependabot/go_modules/github.com/spf13/viper-1.20.0
build(deps): Bump github.com/spf13/viper from 1.19.0 to 1.20.0
2025-03-17 18:05:49 -07:00
dependabot[bot] aa6e88c2d5
build(deps): Bump github.com/spf13/viper from 1.19.0 to 1.20.0
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.19.0...v1.20.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-18 00:51:07 +00:00
dependabot[bot] b3d26f7a9f
build(deps): Bump github.com/prometheus/common from 0.62.0 to 0.63.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.62.0 to 0.63.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.62.0...v0.63.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-18 00:51:05 +00:00
Kubernetes Prow Robot 40602cb3e3
Merge pull request #2611 from mrueg/go-1.24
chore: Bump to go-1.24, use go tools
2025-03-17 17:49:49 -07:00
Manuel Rüger a3972f90ab chore: Bump to go-1.24, use go tools 2025-03-16 21:41:32 +01:00
Kubernetes Prow Robot dab65d7cb4
Merge pull request #2628 from kubernetes/dependabot/go_modules/k8s-dependencies-8005f85eb9
build(deps): Bump the k8s-dependencies group with 5 updates
2025-03-12 02:01:46 -07:00
dependabot[bot] 05e45869ff
build(deps): Bump the k8s-dependencies group with 5 updates
Bumps the k8s-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.32.2` | `0.32.3` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.32.2` | `0.32.3` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.32.2` | `0.32.3` |
| [k8s.io/component-base](https://github.com/kubernetes/component-base) | `0.32.2` | `0.32.3` |
| [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) | `0.32.2` | `0.32.3` |


Updates `k8s.io/api` from 0.32.2 to 0.32.3
- [Commits](https://github.com/kubernetes/api/compare/v0.32.2...v0.32.3)

Updates `k8s.io/apimachinery` from 0.32.2 to 0.32.3
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.32.2...v0.32.3)

Updates `k8s.io/client-go` from 0.32.2 to 0.32.3
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.32.2...v0.32.3)

Updates `k8s.io/component-base` from 0.32.2 to 0.32.3
- [Commits](https://github.com/kubernetes/component-base/compare/v0.32.2...v0.32.3)

Updates `k8s.io/sample-controller` from 0.32.2 to 0.32.3
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.32.2...v0.32.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-12 08:40:29 +00:00
Kubernetes Prow Robot 3d73ddbd09
Merge pull request #2624 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.21.1
build(deps): Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1
2025-03-06 14:19:44 -08:00
dependabot[bot] 5906b6dc9e
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.21.0 to 1.21.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.21.0...v1.21.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 22:10:30 +00:00
Kubernetes Prow Robot c853e41fee
Merge pull request #2618 from kubernetes/dependabot/go_modules/github.com/google/go-cmp-0.7.0
build(deps): Bump github.com/google/go-cmp from 0.6.0 to 0.7.0
2025-02-24 01:08:29 -08:00
Kubernetes Prow Robot 2c423907a3
Merge pull request #2617 from kubernetes/dependabot/go_modules/github.com/KimMachineGun/automemlimit-0.7.1
build(deps): Bump github.com/KimMachineGun/automemlimit from 0.7.0 to 0.7.1
2025-02-24 01:06:29 -08:00
dependabot[bot] 0129759430
build(deps): Bump github.com/google/go-cmp from 0.6.0 to 0.7.0
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 08:57:49 +00:00
dependabot[bot] c405dcf1f3
build(deps): Bump github.com/KimMachineGun/automemlimit
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 08:57:44 +00:00
Kubernetes Prow Robot 7f9b0d1189
Merge pull request #2615 from SuperQ/superq/reclaim
feat: Add PersistentVolume Reclaim Policy into info metric
2025-02-22 13:56:26 -08:00
SuperQ a775fe3458
feat: Add PersistentVolume Reclaim Policy metric
In order to monitor for PVs with different reclaim policies add a
`reclaim_policy` label to the `kube_persistentvolume_info` metric.

Signed-off-by: SuperQ <superq@gmail.com>
2025-02-20 10:37:13 +01:00
Kubernetes Prow Robot 3527ceb4d5
Merge pull request #2613 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.21.0
build(deps): Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0
2025-02-19 03:42:26 -08:00
dependabot[bot] 9ce7e6b771
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.5 to 1.21.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.21.0/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.5...v1.21.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 11:13:44 +00:00
Kubernetes Prow Robot cd49aeac35
Merge pull request #2610 from kubernetes/dependabot/go_modules/github.com/spf13/cobra-1.9.1
build(deps): Bump github.com/spf13/cobra from 1.8.1 to 1.9.1
2025-02-17 04:40:22 -08:00
dependabot[bot] 16db8b7368
build(deps): Bump github.com/spf13/cobra from 1.8.1 to 1.9.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 09:34:11 +00:00
Kubernetes Prow Robot 350a7c472e
Merge pull request #2609 from kubernetes/dependabot/go_modules/k8s-dependencies-648f52ad64
build(deps): Bump the k8s-dependencies group with 5 updates
2025-02-15 00:32:20 -08:00
dependabot[bot] 919ce06ec7
build(deps): Bump the k8s-dependencies group with 5 updates
Bumps the k8s-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.32.1` | `0.32.2` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.32.1` | `0.32.2` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.32.1` | `0.32.2` |
| [k8s.io/component-base](https://github.com/kubernetes/component-base) | `0.32.1` | `0.32.2` |
| [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) | `0.32.1` | `0.32.2` |


Updates `k8s.io/api` from 0.32.1 to 0.32.2
- [Commits](https://github.com/kubernetes/api/compare/v0.32.1...v0.32.2)

Updates `k8s.io/apimachinery` from 0.32.1 to 0.32.2
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.32.1...v0.32.2)

Updates `k8s.io/client-go` from 0.32.1 to 0.32.2
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.32.1...v0.32.2)

Updates `k8s.io/component-base` from 0.32.1 to 0.32.2
- [Commits](https://github.com/kubernetes/component-base/compare/v0.32.1...v0.32.2)

Updates `k8s.io/sample-controller` from 0.32.1 to 0.32.2
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.32.1...v0.32.2)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-15 08:17:23 +00:00
Kubernetes Prow Robot 2a95d4649b
Merge pull request #2606 from kubernetes/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.14.0
build(deps): Bump github.com/prometheus/exporter-toolkit from 0.13.2 to 0.14.0
2025-02-06 12:17:56 -08:00
dependabot[bot] dc60c09548
build(deps): Bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.13.2 to 0.14.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.13.2...v0.14.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-06 20:09:02 +00:00
Kubernetes Prow Robot 4fa35209c1
Merge pull request #2600 from kubernetes/release-2.15
chore: Merge release 2.15 back to main
2025-02-03 22:14:58 -08:00
Kubernetes Prow Robot 4a585c91be
Merge pull request #2599 from mrueg/prep-v2.15.0
chore: Cut v2.15.0
2025-02-03 00:14:57 -08:00
Manuel Rüger 25eda406ea chore: Cut v2.15.0 2025-02-02 23:01:10 +01:00
Kubernetes Prow Robot c7caee60c9
Merge pull request #2553 from L3n41c/fix_gvrfromtype
fix: panic in `util.GVRFromType` for structured types
2025-01-29 04:43:26 -08:00
Kubernetes Prow Robot b6305cb93b
Merge pull request #2598 from mrueg/fix-jsonnet
fix(jsonnet): Fix NoNodePod naming
2025-01-29 04:39:22 -08:00
Kubernetes Prow Robot faf377ea13
Merge pull request #2572 from rexagod/fix-v
fix: make `$VERSION` 3rd-party independant
2025-01-29 04:11:23 -08:00
Manuel Rüger 33250c57f5 jsonnet: Fix NoNodePod naming 2025-01-29 13:05:25 +01:00
Lénaïc Huard c3b1afe61c
Handle the cases where GVRFromType returns neither a GVR nor an error 2025-01-28 21:30:58 +01:00
Kubernetes Prow Robot d4f79cbe7f
Merge pull request #2580 from clavinjune/main
docs(customresourcestate): add example to expose same metrics with different label
2025-01-27 06:31:24 -08:00
Clavianus Juneardo 9cf257a9b3
Merge branch 'kubernetes:main' into main 2025-01-27 19:51:46 +07:00
Clavianus Juneardo afc7bbcd01
docs(customresourcestate): add VPA labels and annotations 2025-01-27 19:50:46 +07:00
Kubernetes Prow Robot 662afca405
Merge pull request #2596 from kubernetes/dependabot/github_actions/actions/setup-go-5.3.0
build(deps): Bump actions/setup-go from 5.2.0 to 5.3.0
2025-01-27 02:07:25 -08:00
dependabot[bot] 21df5706ea
build(deps): Bump actions/setup-go from 5.2.0 to 5.3.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](3041bf56c9...f111f3307d)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-27 09:16:39 +00:00
Lénaïc Huard 61134a08b6
Return an error instead of only logging 2025-01-23 15:55:11 +01:00
Clavianus Juneardo 0c69b3567a
docs(customresourcestate): fix naming discrepancies on VPA 2025-01-21 11:04:13 +07:00
Kubernetes Prow Robot 288b3cf855
Merge pull request #2559 from RiRa12621/main
fix(kube_pod_tolerations): deduplicate tolerations before creating metric
2025-01-19 23:58:35 -08:00
Kubernetes Prow Robot 88ef004119
Merge pull request #2593 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.62.0
build(deps): Bump github.com/prometheus/common from 0.61.0 to 0.62.0
2025-01-17 05:54:34 -08:00
dependabot[bot] 9f3ebac101
build(deps): Bump github.com/prometheus/common from 0.61.0 to 0.62.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.61.0 to 0.62.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.61.0...v0.62.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-17 13:45:33 +00:00
Kubernetes Prow Robot 3b72e1943b
Merge pull request #2592 from kubernetes/dependabot/go_modules/k8s-dependencies-e08fda7a5c
build(deps): Bump the k8s-dependencies group across 1 directory with 4 updates
2025-01-16 11:46:34 -08:00
Manuel Rüger ee0d05d15a docs: Add k8s 1.32 2025-01-16 19:02:07 +01:00
dependabot[bot] ecf94572bf
build(deps): Bump the k8s-dependencies group across 1 directory with 4 updates
Bumps the k8s-dependencies group with 4 updates in the / directory: [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery), [k8s.io/client-go](https://github.com/kubernetes/client-go), [k8s.io/component-base](https://github.com/kubernetes/component-base) and [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller).


Updates `k8s.io/apimachinery` from 0.31.3 to 0.32.1
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.31.3...v0.32.1)

Updates `k8s.io/client-go` from 0.31.3 to 0.32.1
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.31.3...v0.32.1)

Updates `k8s.io/component-base` from 0.31.3 to 0.32.1
- [Commits](https://github.com/kubernetes/component-base/compare/v0.31.3...v0.32.1)

Updates `k8s.io/sample-controller` from 0.31.3 to 0.32.1
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.31.3...v0.32.1)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-16 08:57:40 +00:00
Kubernetes Prow Robot c198a18d28
Merge pull request #2588 from kubernetes/dependabot/go_modules/github.com/KimMachineGun/automemlimit-0.7.0
build(deps): Bump github.com/KimMachineGun/automemlimit from 0.6.1 to 0.7.0
2025-01-08 04:12:30 -08:00
dependabot[bot] 4955306dfa
build(deps): Bump github.com/KimMachineGun/automemlimit
Bumps [github.com/KimMachineGun/automemlimit](https://github.com/KimMachineGun/automemlimit) from 0.6.1 to 0.7.0.
- [Release notes](https://github.com/KimMachineGun/automemlimit/releases)
- [Commits](https://github.com/KimMachineGun/automemlimit/compare/v0.6.1...v0.7.0)

---
updated-dependencies:
- dependency-name: github.com/KimMachineGun/automemlimit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 12:03:37 +00:00
Kubernetes Prow Robot 1e06e16967
Merge pull request #2584 from jahantech/ksm-traffic-policy-metrics-cla
feat: Add External traffic policy to kube_service_info
2025-01-07 11:16:29 -08:00
clavinjune 387bd8b244
docs(customresourestate): fix All VerticalPodAutoscaler Metrics section
Signed-off-by: clavinjune <24659468+clavinjune@users.noreply.github.com>
2025-01-07 16:54:54 +07:00
clavinjune ae38bc4e67
docs(customresourestate): fix All VerticalPodAutoscaler Metrics section
Signed-off-by: clavinjune <24659468+clavinjune@users.noreply.github.com>
2025-01-07 16:53:54 +07:00
clavinjune 89f8110d61
docs(customresourestate): add example to re-expose all VPA metrics
Signed-off-by: clavinjune <24659468+clavinjune@users.noreply.github.com>
2025-01-07 16:51:46 +07:00
jahantech 0591d0bd71 feat: Add External traffic policy to kube_service_info 2025-01-02 14:41:08 +00:00
jahantech 279f84b095 feat: Add External traffic policy to kube_service_info 2025-01-02 14:38:47 +00:00
clavinjune 1412eaa183
docs(customresourestate): add kind on the example
Signed-off-by: clavinjune <24659468+clavinjune@users.noreply.github.com>
2024-12-23 17:07:39 +07:00
clavinjune a4d64fb993
docs(customresourestate): add example to expose same metrics with different label
Signed-off-by: clavinjune <24659468+clavinjune@users.noreply.github.com>
2024-12-23 17:02:00 +07:00
Kubernetes Prow Robot d3f0c1853f
Merge pull request #2577 from dashpole/update_om_links
docs: update links to openmetrics to reference the v1.0.0 release
2024-12-16 21:50:52 +01:00
David Ashpole 6cfc844ca0
update links to openmetrics to reference the v1.0.0 release
Signed-off-by: David Ashpole <dashpole@google.com>
2024-12-16 20:24:02 +00:00
Kubernetes Prow Robot b5abea9294
Merge pull request #2576 from kubernetes/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.13.2
build(deps): Bump github.com/prometheus/exporter-toolkit from 0.13.1 to 0.13.2
2024-12-15 23:34:43 +01:00
Kubernetes Prow Robot 543738ba62
Merge pull request #2574 from kubernetes/dependabot/github_actions/actions/setup-go-5.2.0
build(deps): Bump actions/setup-go from 5.1.0 to 5.2.0
2024-12-15 23:32:43 +01:00
dependabot[bot] 7c2b8b5c09
build(deps): Bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.13.1 to 0.13.2.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.13.1...v0.13.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-15 22:26:06 +00:00
dependabot[bot] ace5a4b236
build(deps): Bump actions/setup-go from 5.1.0 to 5.2.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](41dfa10bad...3041bf56c9)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-15 22:25:29 +00:00
Kubernetes Prow Robot 36318bb970
Merge pull request #2573 from davidxia/patch-1
style: fix warning during docker build
2024-12-12 23:02:26 +01:00
David Xia ea3f5fac90
style: fix warning during docker build
by addressing the warning below.

```
make container
...

 2 warnings found (use --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 3)
```
2024-12-12 14:19:33 -05:00
Kubernetes Prow Robot fb28420d3c
Merge pull request #2556 from mrueg/housekeeping
chore: Bump versions
2024-12-11 16:14:04 +00:00
Pranshu Srivastava 4bce5ea4bd
regression: make `$VERSION` 3rd-party independant
3rd-party dependencies cannot be installed pre-build since Makefile
variables are initialized earlier than that.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-12-11 20:24:38 +05:30
Lénaïc Huard 4a96a782fc
Log an error instead of panicking 2024-12-10 17:49:40 +01:00
Kubernetes Prow Robot 5e332b307a
Merge pull request #2570 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.61.0
build(deps): Bump github.com/prometheus/common from 0.60.1 to 0.61.0
2024-12-09 09:58:03 +00:00
dependabot[bot] 69ce9757f5
build(deps): Bump github.com/prometheus/common from 0.60.1 to 0.61.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.60.1 to 0.61.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.60.1...v0.61.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 09:22:54 +00:00
Kubernetes Prow Robot ca0df61115
Merge pull request #2567 from chelseychen/fix-ResolveGVKToGVKPs
fix: Fix CR cache for GVK all specified case
2024-12-05 08:38:00 +00:00
Chelsey Chen 56316019cd Fix CR cache for GVK all specified case 2024-12-05 03:23:04 +00:00
Kubernetes Prow Robot 32e7727ff4
Merge pull request #2528 from mrueg/metrics-best-practices
docs: Add best practices for metrics
2024-11-27 15:48:57 +00:00
Kubernetes Prow Robot 9652811b2f
Merge pull request #2415 from pwschuurman/kep-3335-stable-metrics
feat: Promote kube_statefulset_ordinals_start from ALPHA -> STABLE
2024-11-25 20:51:01 +00:00
Peter Schuurman 098e785d08 Promote kube_statefulset_ordinals_start from ALPHA -> STABLE 2024-11-25 10:55:34 -08:00
Kubernetes Prow Robot c4565c44b9
Merge pull request #2562 from kubernetes/dependabot/go_modules/github.com/stretchr/testify-1.10.0
build(deps): Bump github.com/stretchr/testify from 1.9.0 to 1.10.0
2024-11-25 11:34:56 +00:00
dependabot[bot] ce98457f1b
build(deps): Bump github.com/stretchr/testify from 1.9.0 to 1.10.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 10:02:51 +00:00
Kubernetes Prow Robot 76308fc8b8
Merge pull request #2561 from kubernetes/dependabot/go_modules/k8s-dependencies-58b4af6dfc
build(deps): Bump the k8s-dependencies group with 5 updates
2024-11-22 10:28:58 +00:00
dependabot[bot] b3ac231a32
build(deps): Bump the k8s-dependencies group with 5 updates
Bumps the k8s-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.31.2` | `0.31.3` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.31.2` | `0.31.3` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.31.2` | `0.31.3` |
| [k8s.io/component-base](https://github.com/kubernetes/component-base) | `0.31.2` | `0.31.3` |
| [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) | `0.31.2` | `0.31.3` |


Updates `k8s.io/api` from 0.31.2 to 0.31.3
- [Commits](https://github.com/kubernetes/api/compare/v0.31.2...v0.31.3)

Updates `k8s.io/apimachinery` from 0.31.2 to 0.31.3
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.31.2...v0.31.3)

Updates `k8s.io/client-go` from 0.31.2 to 0.31.3
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.31.2...v0.31.3)

Updates `k8s.io/component-base` from 0.31.2 to 0.31.3
- [Commits](https://github.com/kubernetes/component-base/compare/v0.31.2...v0.31.3)

Updates `k8s.io/sample-controller` from 0.31.2 to 0.31.3
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.31.2...v0.31.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-22 10:20:23 +00:00
Rick Rackow 20f30233bd
fix(kube_pod_tolerations): test duplicate toleration 2024-11-21 17:49:07 +01:00
Rick Rackow 170bbd4c62
fix(kube_pod_tolerations): deduplicate tolerations before creating metric 2024-11-21 17:41:18 +01:00
Kubernetes Prow Robot ea5826a92c
Merge pull request #2376 from mrueg/cronjob-add-timezone
feat: Add timezone to kube_cronjob_info / Make kube_cronjob_next_schedule_time timezone-aware
2024-11-14 14:25:17 +00:00
Manuel Rüger dcfaae9890 Add some info about 1:1/1:n relationships 2024-11-14 10:22:03 +01:00
Manuel Rüger 0ee2640bb9 chore: Bump kind to 0.25.0 2024-11-14 10:10:52 +01:00
Manuel Rüger 7657b02cd2 chore: Bump markdown linter to v0.15.0 2024-11-14 10:10:21 +01:00
Manuel Rüger f09d015f43 chore: Dockerfile - Switch to supported distroless image
https://github.com/GoogleContainerTools/distroless says:
Any other tags are considered deprecated and are no longer updated
2024-11-14 10:09:45 +01:00
Manuel Rüger acbf6d390b chore: Update cloudbuild image
and extend timeout to 45m
2024-11-14 10:07:57 +01:00
Manuel Rüger 7ac99685c1 Update docs/design/metrics-best-practices.md
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-11-14 09:57:19 +01:00
Manuel Rüger 690b9627f5 Include more comments from the review 2024-11-14 09:57:19 +01:00
Manuel Rüger 7677b414e0 Update docs/design/metrics-best-practices.md
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-11-14 09:57:19 +01:00
Manuel Rüger cacc980de3 Update docs/design/metrics-best-practices.md
Co-authored-by: Ben Kochie <superq@gmail.com>
2024-11-14 09:57:19 +01:00
Manuel Rüger 3736c9aa82 docs: Add best practices for metrics 2024-11-14 09:57:19 +01:00
Lénaïc Huard 8859a4289d
Fix a panic in GVRFromType for structured types 2024-11-08 20:20:07 +01:00
Kubernetes Prow Robot 17151aca65
Merge pull request #2552 from kubernetes/release-2.14
chore: Merge Release 2.14 back to main
2024-11-08 13:08:43 +00:00
Kubernetes Prow Robot e763ea2aa3
Merge pull request #2538 from mrueg/prep-2.14.0
chore: Cut v2.14.0
2024-11-08 09:52:43 +00:00
Manuel Rüger b4d98d7b40 chore: Cut v2.14.0 2024-11-08 10:44:20 +01:00
Kubernetes Prow Robot 77e564ba5d
Merge pull request #2536 from Haleygo/fix-custom-metric-value-conversion
fix(custom resource state metrics): correctly convert status condition `Unknown` to a valid value
2024-11-08 09:40:43 +00:00
Manuel Rüger cad704d488
Update pkg/customresourcestate/registry_factory.go 2024-11-08 10:32:59 +01:00
Manuel Rüger d7d2d89017
Update docs/metrics/extend/customresourcestate-metrics.md 2024-11-08 10:32:47 +01:00
Kubernetes Prow Robot 0bcfd5bba5
Merge pull request #2548 from mrueg/go-1.23.3
chore: Bump versions
2024-11-08 09:20:43 +00:00
Kubernetes Prow Robot b6499c9af7
Merge pull request #2547 from Henrywu573/myfeature
fix: Remove redundant factories array since it is not written after
2024-11-07 20:02:44 +00:00
Kubernetes Prow Robot 5e7d0f4523
Merge pull request #2542 from Indresh2410/add-kube-job-status-suspended-metric
feat: Add new metric kube_job_status_suspended
2024-11-07 19:56:44 +00:00
Manuel Rüger c5665b69bf chore: Bump versions 2024-11-07 20:00:33 +01:00
Indresh2410 7a54a8ebf0
Add new line 2024-11-07 05:52:47 +00:00
Indresh2410 b2c8fa7837 Address Review Comments 2024-11-07 04:36:30 +00:00
Indresh2410 ba7ff1a0e5 Address Review Comments 2024-11-07 04:36:30 +00:00
Indresh2410 34abbcf202 Address Review Comments 2024-11-07 04:36:30 +00:00
Indresh-Prakash 076987a505 Add kube_job_status_suspended metric 2024-11-07 04:36:30 +00:00
Henry Wu 1734bd8403 Remove redundant factories array since it is not written after
construction.
2024-11-07 00:07:36 +00:00
Kubernetes Prow Robot c87b507116
Merge pull request #2546 from mrueg/fix-ci
chore: Fix broken CI
2024-11-06 19:17:30 +00:00
Manuel Rüger 9c61d7ea81 chore: Fix broken CI 2024-11-06 17:43:35 +01:00
Kubernetes Prow Robot c804368d08
Merge pull request #2545 from mrueg/fix-benchmarks
chore: Improve benchmarks
2024-11-06 11:23:32 +00:00
Manuel Rüger fa27721993
Update .github/workflows/ci.yml
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2024-11-06 11:35:23 +01:00
Manuel Rüger 0303532851 chore: Integrate benchmark output in GHA
The code comes from ivanvc in https://github.com/etcd-io/bbolt/pull/750
2024-11-06 10:29:43 +01:00
Manuel Rüger 02b6a214c6 chore: Run the benchmark for two rounds 2024-11-06 09:43:00 +01:00
Manuel Rüger b0e9be550b fix: Remove log output from benchmark
Without this change Info logs appear in the benchmark

ok      k8s.io/kube-state-metrics/v2/pkg/allowdenylist  0.005s
I1106 08:50:22.006480  144965 builder.go:280] "Active resources" activeStoreNames="certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments"
goos: linux
goarch: amd64
pkg: k8s.io/kube-state-metrics/v2/pkg/app
cpu: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
BenchmarkKubeStateMetrics/GenerateMetrics-8                    1        1001291639 ns/op        67578008 B/op     582810 allocs/op
2024-11-06 09:43:00 +01:00
Manuel Rüger fac6119d43 chore: Allow setting rounds in benchmark 2024-11-05 23:06:10 +01:00
Kubernetes Prow Robot 0738de0be2
Merge pull request #2539 from mrueg/expose-empty-labels
fix: expose empty labels
2024-11-05 20:41:30 +00:00
Kubernetes Prow Robot dfb688c966
Merge pull request #2510 from rarruda/fix/reduce_locking
perf: use concurrent map when storing metrics
2024-11-05 19:47:30 +00:00
Kubernetes Prow Robot 61a1993fdc
Merge pull request #2540 from leiwingqueen/fix-value-overflow
fix: big memory overflow
2024-11-05 10:07:29 +00:00
Manuel Rüger c67f02f0f3
Apply suggestions from code review 2024-11-05 10:58:10 +01:00
leiwingqueen 7980f03c52 fix convert float64 error 2024-11-05 00:02:19 +08:00
leiwingqueen 37f10f0602 fix lint 2024-11-04 23:33:53 +08:00
Kubernetes Prow Robot ca66c9d344
Merge pull request #2543 from kubernetes/dependabot/go_modules/github.com/fsnotify/fsnotify-1.8.0
build(deps): Bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0
2024-11-04 12:47:29 +00:00
dependabot[bot] ea648da9c6
build(deps): Bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 09:08:25 +00:00
Haley Wang 70088ed1ea
apply review comment 2024-11-04 16:38:57 +08:00
leiwingqueen f94ef65cc7 fix overflow in other occasion 2024-11-04 10:09:18 +08:00
leiwingqueen e5eb2ed132 fix lint error 2024-11-02 22:16:15 +08:00
leiwingqueen 2c346763cf change convertValueToFloat64 function name 2024-11-02 09:55:35 +08:00
leiwingqueen 31f793129f fix big memory overflow 2024-11-01 16:16:08 +08:00
Manuel Rüger 2aa766ee03 serviceaccounts: Expose empty labels 2024-10-31 17:40:32 +01:00
Manuel Rüger 9f15cc1c8c pods: Expose empty labels 2024-10-31 17:40:10 +01:00
Manuel Rüger 63749c5d15 endpoints: Expose empty labels 2024-10-31 14:30:49 +01:00
Manuel Rüger 75e7841c10 endpointslices: Expose empty labels 2024-10-31 14:30:49 +01:00
Kubernetes Prow Robot 3c6bc83911
Merge pull request #2537 from kubernetes/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.13.1
build(deps): Bump github.com/prometheus/exporter-toolkit from 0.13.0 to 0.13.1
2024-10-30 11:39:25 +00:00
dependabot[bot] c24e50d042
build(deps): Bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.13.0...v0.13.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-30 11:29:29 +00:00
Haley Wang 17c69692c4
fix(custom resource state metrics): corrctly convert status condition `Unknown` to a valid value 2024-10-29 13:55:40 +08:00
Kubernetes Prow Robot eb5e34701d
Merge pull request #2535 from L3n41c/fix_gvrfromtype
fix: panic in `util.GVRFromType` for core objects
2024-10-27 12:02:54 +00:00
Lénaïc Huard 110f03d733
Fix a panic in GVRFromType for core objects 2024-10-25 14:11:56 +02:00
Kubernetes Prow Robot 45b7e20ee3
Merge pull request #2531 from kubernetes/dependabot/github_actions/actions/setup-go-5.1.0
build(deps): Bump actions/setup-go from 5.0.2 to 5.1.0
2024-10-25 01:22:52 +01:00
Kubernetes Prow Robot 2db568c4fc
Merge pull request #2533 from kubernetes/dependabot/go_modules/k8s-dependencies-61858d65be
build(deps): Bump the k8s-dependencies group with 5 updates
2024-10-25 01:14:52 +01:00
dependabot[bot] 3b5c6240a9
build(deps): Bump actions/setup-go from 5.0.2 to 5.1.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0a12ed9d6a...41dfa10bad)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-25 00:13:02 +00:00
Kubernetes Prow Robot 32d5ab5ac5
Merge pull request #2534 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.60.1
build(deps): Bump github.com/prometheus/common from 0.60.0 to 0.60.1
2024-10-25 01:12:52 +01:00
Kubernetes Prow Robot 7574addd80
Merge pull request #2532 from kubernetes/dependabot/github_actions/actions/checkout-4.2.2
build(deps): Bump actions/checkout from 4.2.1 to 4.2.2
2024-10-25 01:10:52 +01:00
dependabot[bot] 51f854f305
build(deps): Bump github.com/prometheus/common from 0.60.0 to 0.60.1
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.60.0 to 0.60.1.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.60.0...v0.60.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-25 00:03:46 +00:00
dependabot[bot] 2dacb29426
build(deps): Bump the k8s-dependencies group with 5 updates
Bumps the k8s-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.31.1` | `0.31.2` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.31.1` | `0.31.2` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.31.1` | `0.31.2` |
| [k8s.io/component-base](https://github.com/kubernetes/component-base) | `0.31.1` | `0.31.2` |
| [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) | `0.31.1` | `0.31.2` |


Updates `k8s.io/api` from 0.31.1 to 0.31.2
- [Commits](https://github.com/kubernetes/api/compare/v0.31.1...v0.31.2)

Updates `k8s.io/apimachinery` from 0.31.1 to 0.31.2
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.31.1...v0.31.2)

Updates `k8s.io/client-go` from 0.31.1 to 0.31.2
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.31.1...v0.31.2)

Updates `k8s.io/component-base` from 0.31.1 to 0.31.2
- [Commits](https://github.com/kubernetes/component-base/compare/v0.31.1...v0.31.2)

Updates `k8s.io/sample-controller` from 0.31.1 to 0.31.2
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.31.1...v0.31.2)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-25 00:03:39 +00:00
dependabot[bot] f3ff773d31
build(deps): Bump actions/checkout from 4.2.1 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](eef61447b9...11bd71901b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-25 00:03:10 +00:00
Kubernetes Prow Robot 9652c29fe6
Merge pull request #2529 from kubernetes/dependabot/github_actions/kubernetes-sigs/release-actions-0.3.0
build(deps): Bump kubernetes-sigs/release-actions from 0.2.0 to 0.3.0
2024-10-21 11:41:05 +01:00
Kubernetes Prow Robot 5c43e10fa0
Merge pull request #2530 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.20.5
build(deps): Bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5
2024-10-21 11:39:05 +01:00
dependabot[bot] f9c945aef5
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.4 to 1.20.5.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.4...v1.20.5)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 10:03:28 +00:00
dependabot[bot] 0a331e1a60
build(deps): Bump kubernetes-sigs/release-actions from 0.2.0 to 0.3.0
Bumps [kubernetes-sigs/release-actions](https://github.com/kubernetes-sigs/release-actions) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/kubernetes-sigs/release-actions/releases)
- [Changelog](https://github.com/kubernetes-sigs/release-actions/blob/main/RELEASE.md)
- [Commits](2f8b9ec22a...a69972745f)

---
updated-dependencies:
- dependency-name: kubernetes-sigs/release-actions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 09:12:08 +00:00
Kubernetes Prow Robot e14a9d771c
Merge pull request #2503 from mrueg/issue-2408
feat: Move endpoint ports into address metric
2024-10-20 11:23:03 +01:00
Manuel Rüger ea7034553f feat(endpoints): Move ports into address metric
This marks kube_endpoint_ports as deprecated
2024-10-17 23:45:01 +02:00
Kubernetes Prow Robot 75fba81cf3
Merge pull request #2527 from mrueg/rm-deprecated-metric
chore: Remove deprecated endpoint address metric
2024-10-16 13:29:05 +01:00
Manuel Rüger 28129e4d6d chore: Remove deprecated endpoint address metric
This was deprecated in 2022 in https://github.com/kubernetes/kube-state-metrics/pull/1761
2024-10-16 09:42:33 +02:00
Kubernetes Prow Robot e29519112d
Merge pull request #2526 from mrueg/fix-govulncheck
fix: update govulncheck's go version to 1.23
2024-10-16 06:29:03 +01:00
Manuel Rüger d7f7bd5297 fix: Add missed go 1.23 updates 2024-10-15 23:20:19 +02:00
Manuel Rüger 90e7e1178c fix: update govulncheck's go version to 1.23 2024-10-15 23:18:19 +02:00
Kubernetes Prow Robot f3b7593031
Merge pull request #2478 from wallee94/remove-shard-validation-on-sts-create
fix(discovery): configure sharding every time MetricsHandler.Run runs
2024-10-15 09:20:22 +01:00
Kubernetes Prow Robot 77a99a52c5
Merge pull request #2502 from bartlettc22/cr-duplication-fix
fix: de-duplication of custom resource metrics
2024-10-15 09:18:22 +01:00
Manuel Rüger bd6beed33b
Update internal/store/builder_test.go 2024-10-15 09:52:29 +02:00
Kubernetes Prow Robot 0013d73987
Merge pull request #2524 from kubernetes/dependabot/github_actions/actions/checkout-4.2.1
build(deps): Bump actions/checkout from 4.2.0 to 4.2.1
2024-10-14 10:46:21 +01:00
dependabot[bot] 4356a0f66e
build(deps): Bump actions/checkout from 4.2.0 to 4.2.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](d632683dd7...eef61447b9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 09:28:56 +00:00
Kubernetes Prow Robot a936341496
Merge pull request #2519 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.60.0
build(deps): Bump github.com/prometheus/common from 0.59.1 to 0.60.0
2024-10-07 12:44:21 +01:00
dependabot[bot] cd29fabd66
build(deps): Bump github.com/prometheus/common from 0.59.1 to 0.60.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.59.1 to 0.60.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.59.1...v0.60.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 09:15:51 +00:00
Chris Bartlett de58db2ed4
restructure testing logic
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2024-10-01 13:35:32 -06:00
Walther Lee 166921b797 fix typo in comments 2024-09-30 10:46:42 -07:00
Walther Lee 7b375e9ef4 undo changes in internal/store/builder.go 2024-09-30 09:21:42 -07:00
Kubernetes Prow Robot 2c5a2499f0
Merge pull request #2509 from kevinwangcn/fix-security-issue
chore: Fix the security issue about sirupsen/logrus
2024-09-30 15:34:04 +01:00
Kubernetes Prow Robot 49b25a87b9
Merge pull request #2515 from kubernetes/dependabot/github_actions/actions/checkout-4.2.0
build(deps): Bump actions/checkout from 4.1.7 to 4.2.0
2024-09-30 15:26:02 +01:00
Kubernetes Prow Robot f7ac762056
Merge pull request #2492 from mrueg/k8s-1.31
chore: Bump to kubernetes 1.31.0
2024-09-30 15:24:04 +01:00
dependabot[bot] ecbb910841
build(deps): Bump actions/checkout from 4.1.7 to 4.2.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](692973e3d9...d632683dd7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 09:55:48 +00:00
Renato Arruda f2a76390e1 lint 2024-09-26 14:02:08 +02:00
Renato Arruda 3e2d1e9d9a perf: use concurrent map when storing metrics
In busy/large clusters, will prevent timeouts from long living
locks/concurrency issues, as the writing to the map takes overly long,
blocking the metrics-reading thread and as the lock doesn't get released
in a timely manner, timing out the request.

Inpired by previous PR at https://github.com/kubernetes/kube-state-metrics/pull/1028
2024-09-25 12:02:36 +02:00
Kevin Wang ba9eb94f51
chore: Fix the security issue about sirupsen/logrus 2024-09-24 18:27:24 -04:00
Walther Lee 294163d5d6 Merge branch 'main' into remove-shard-validation-on-sts-create 2024-09-24 12:18:42 -07:00
Walther Lee fb46163add fix ciclomatic complexity lint in TestVariableVKsDiscoveryAndResolution 2024-09-24 12:17:58 -07:00
Manuel Rüger f7ec4da618 chore: Bump to kubernetes 1.31
Breaking change for node metrics, as kube-proxy field is deprecated and
contains invalid information.

See also
https://kubernetes.io/blog/2024/07/19/kubernetes-1-31-upcoming-changes/#deprecation-of-status-nodeinfo-kubeproxyversion-field-for-nodes-kep-4004-https-github-com-kubernetes-enhancements-issues-4004
2024-09-24 13:25:41 +02:00
Kubernetes Prow Robot f50205a4df
Merge pull request #2508 from mrueg/switch-to-slog
chore: Migrate to slog for exporter-toolkit
2024-09-24 11:56:03 +01:00
Manuel Rüger 4b420cb6f7 chore: Migrate to slog 2024-09-23 22:12:23 +02:00
Kubernetes Prow Robot 826134a3ff
Merge pull request #2506 from kubernetes/dependabot/go_modules/github.com/gobuffalo/flect-1.0.3
build(deps): Bump github.com/gobuffalo/flect from 1.0.2 to 1.0.3
2024-09-23 12:28:00 +01:00
dependabot[bot] 9322447ced
build(deps): Bump github.com/gobuffalo/flect from 1.0.2 to 1.0.3
Bumps [github.com/gobuffalo/flect](https://github.com/gobuffalo/flect) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/gobuffalo/flect/releases)
- [Commits](https://github.com/gobuffalo/flect/compare/v1.0.2...v1.0.3)

---
updated-dependencies:
- dependency-name: github.com/gobuffalo/flect
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 11:04:56 +00:00
Kubernetes Prow Robot 0b64d71e6b
Merge pull request #2505 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.20.4
build(deps): Bump github.com/prometheus/client_golang from 1.20.3 to 1.20.4
2024-09-23 12:04:00 +01:00
dependabot[bot] f2ab628d2b
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.3 to 1.20.4.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 09:23:49 +00:00
Chris Bartlett 24c2194e7e fix: deduplication of cr enabled resources 2024-09-18 17:22:38 -06:00
Walther Lee 9aad0c02f3 fix resource duplication in store builder
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
2024-09-13 12:30:56 -07:00
Walther Lee 012121e50e update func docstring
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
2024-09-12 12:39:53 -07:00
Walther Lee 1a1ca73eca decouple BuildWriters from ConfigureSharding
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
2024-09-12 12:38:08 -07:00
Walther Lee 8195dbe969 Merge branch 'main' into remove-shard-validation-on-sts-create 2024-09-12 10:45:56 -07:00
Kubernetes Prow Robot 3d969c5ce9
Merge pull request #2493 from mrueg/bump-go
chore: Bump go to 1.23.1
2024-09-12 11:19:12 +01:00
Kubernetes Prow Robot 76ef24190d
Merge pull request #2485 from richabanker/no-job-conditions-fix
fix: set kube_job_status_failed metric even when there are no job.Status.Conditions present
2024-09-12 08:55:13 +01:00
Manuel Rüger f34cd69cee chore: Bump go to 1.23.1 2024-09-09 20:15:30 +02:00
Kubernetes Prow Robot aebbb39082
Merge pull request #2498 from SamuAlfageme/fix-readme-codeblocks
docs: fix unformatted code blocks in README
2024-09-09 17:44:45 +01:00
Samuel Alfageme Sainz 3a10a4ee2e Fix unformatted code blocks in README 2024-09-09 18:32:14 +02:00
Kubernetes Prow Robot 52ae178b7d
Merge pull request #2497 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.59.1
build(deps): Bump github.com/prometheus/common from 0.58.0 to 0.59.1
2024-09-09 10:46:28 +01:00
dependabot[bot] 3dced14afe
build(deps): Bump github.com/prometheus/common from 0.58.0 to 0.59.1
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.58.0 to 0.59.1.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.58.0...v0.59.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 09:37:14 +00:00
Kubernetes Prow Robot 24b0f7fffa
Merge pull request #2496 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.20.3
build(deps): Bump github.com/prometheus/client_golang from 1.20.2 to 1.20.3
2024-09-09 10:36:27 +01:00
dependabot[bot] 12a2291287
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.2 to 1.20.3.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.3/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 09:27:47 +00:00
Walther Lee 4aced25f69 fix race condition in metrics handler
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
2024-09-05 14:02:13 -07:00
Kubernetes Prow Robot db01d3eb02
Merge pull request #2494 from kubernetes/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.12.0
build(deps): Bump github.com/prometheus/exporter-toolkit from 0.11.0 to 0.12.0
2024-09-03 21:36:26 +01:00
dependabot[bot] 805b70a086
build(deps): Bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-03 20:26:09 +00:00
Kubernetes Prow Robot e6f359db36
Merge pull request #2491 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.57.0
build(deps): Bump github.com/prometheus/common from 0.55.0 to 0.57.0
2024-08-30 21:10:44 +01:00
dependabot[bot] 218f051024
build(deps): Bump github.com/prometheus/common from 0.55.0 to 0.57.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.55.0 to 0.57.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.55.0...v0.57.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-30 19:54:52 +00:00
Richa Banker 643739d04a Add unit test 2024-08-28 15:42:48 -07:00
Richa Banker 20589ac310 Set metric even when there are no job.Status.Conditions present 2024-08-28 15:40:09 -07:00
Walther Lee 082aba26c0 update discovery to reconfigure sharding
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
2024-08-27 14:14:07 -07:00
Kubernetes Prow Robot c864c93606
Merge pull request #2486 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.20.2
build(deps): Bump github.com/prometheus/client_golang from 1.20.1 to 1.20.2
2024-08-26 10:46:27 +01:00
dependabot[bot] 4d82424e9e
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.1 to 1.20.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.1...v1.20.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26 09:25:58 +00:00
Kubernetes Prow Robot 8e4a2ec7c9
Merge pull request #2470 from mrueg/better-align
chore: Memory align structs
2024-08-25 08:22:08 +01:00
Kubernetes Prow Robot 518a39aae1
Merge pull request #2469 from mrueg/bump-e2e-k8s
chore: Bump e2e kind node to 1.30
2024-08-24 23:32:08 +01:00
Kubernetes Prow Robot 029b6d3a97
Merge pull request #2484 from kubernetes/dependabot/go_modules/tools/github.com/jsonnet-bundler/jsonnet-bundler-0.6.0
build(deps): Bump github.com/jsonnet-bundler/jsonnet-bundler from 0.5.1 to 0.6.0 in /tools
2024-08-23 19:04:23 +01:00
dependabot[bot] 1e8fd2c107
build(deps): Bump github.com/jsonnet-bundler/jsonnet-bundler in /tools
Bumps [github.com/jsonnet-bundler/jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) from 0.5.1 to 0.6.0.
- [Release notes](https://github.com/jsonnet-bundler/jsonnet-bundler/releases)
- [Changelog](https://github.com/jsonnet-bundler/jsonnet-bundler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsonnet-bundler/jsonnet-bundler/compare/v0.5.1...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/jsonnet-bundler/jsonnet-bundler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-23 17:56:28 +00:00
Kubernetes Prow Robot 48ade3d36b
Merge pull request #2481 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.20.1
build(deps): Bump github.com/prometheus/client_golang from 1.20.0 to 1.20.1
2024-08-21 22:04:29 +01:00
dependabot[bot] 1408e45721
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.0 to 1.20.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.1/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.0...v1.20.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-21 20:55:13 +00:00
Kubernetes Prow Robot f7304dc8d8
Merge pull request #2479 from Daividao/fix-outdated-registryfactory-comments
docs: Fix outdated RegistryFactory.MetricFamilyGenerators comments
2024-08-19 09:09:56 -07:00
Daividao 8359c102fa Fix outdated RegistryFactory.MetricFamilyGenerators comments 2024-08-17 16:21:24 -07:00
Walther Lee dec7a1b93e fix(discovery): configure sharding every time MetricsHandler.Run runs
Signed-off-by: Walther Lee <walthere.lee@gmail.com>
2024-08-16 10:16:09 -07:00
Kubernetes Prow Robot 2762759041
Merge pull request #2477 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.20.0
build(deps): Bump github.com/prometheus/client_golang from 1.19.1 to 1.20.0
2024-08-14 14:07:17 -07:00
dependabot[bot] 894862eb6a
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.19.1 to 1.20.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.20.0/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.20.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-14 15:52:12 +00:00
Manuel Rüger 0a86b24b08 chore: Memory align structs
pkg/metric_generator/generator.go:32:22: 16 bytes saved: struct with 96 pointer bytes could be 80
pkg/metrics_store/metrics_store.go:31:19: 40 bytes saved: struct with 64 pointer bytes could be 24
pkg/options/options.go:42:14: 24 bytes saved: struct of size 384 could be 360
internal/store/builder.go:67:14: 8 bytes saved: struct of size 200 could be 192
internal/store/pod.go:1351:16: 8 bytes saved: struct with 16 pointer bytes could be 8
internal/store/pod.go:1477:20: 8 bytes saved: struct with 16 pointer bytes could be 8
internal/store/testutils.go:32:30: 16 bytes saved: struct with 136 pointer bytes could be 120
pkg/metricshandler/metrics_handler.go:46:21: 8 bytes saved: struct of size 104 could be 96
internal/discovery/types.go:39:19: 32 bytes saved: struct with 88 pointer bytes could be 56
pkg/customresourcestate/config.go:51:15: 16 bytes saved: struct with 112 pointer bytes could be 96
pkg/customresourcestate/config.go:134:16: 8 bytes saved: struct with 88 pointer bytes could be 80
pkg/customresourcestate/config.go:150:13: 8 bytes saved: struct with 40 pointer bytes could be 32
pkg/customresourcestate/config_metrics_types.go:29:18: 8 bytes saved: struct with 64 pointer bytes could be 56
pkg/customresourcestate/config_metrics_types.go:42:17: 8 bytes saved: struct with 40 pointer bytes could be 32
pkg/customresourcestate/registry_factory.go:125:21: 8 bytes saved: struct with 40 pointer bytes could be 32
pkg/customresourcestate/registry_factory.go:212:20: 16 bytes saved: struct with 88 pointer bytes could be 72
pkg/customresourcestate/registry_factory.go:377:23: 8 bytes saved: struct with 104 pointer bytes could be 96
pkg/customresourcestate/registry_factory.go:497:21: 8 bytes saved: struct with 64 pointer bytes could be 56
pkg/customresourcestate/registry_factory.go:549:13: 8 bytes saved: struct with 24 pointer bytes could be 16
2024-08-08 19:03:28 +02:00
Manuel Rüger 089ed4551f chore: Bump e2e kind node to 1.30 2024-08-08 18:55:08 +02:00
Kubernetes Prow Robot f8aa7d9bb9
Merge pull request #2466 from mrueg/drop-dynamic-client
chore: Add unused linter
2024-08-06 00:36:50 -07:00
Manuel Rüger ab06f81c00 chore: Remove further unused 2024-08-05 19:35:51 +02:00
Manuel Rüger 2548615cd7 chore: Add unused linter to golangci 2024-08-05 18:28:11 +02:00
Manuel Rüger a652104dec chore: Remove unused dynamicClient 2024-08-05 18:27:27 +02:00
Kubernetes Prow Robot b1c2e0c1cf
Merge pull request #2467 from CatherineF-dev/patch-12
fix: e2e test failure
2024-08-05 09:26:59 -07:00
CatherineF-dev b43702ed14
Update e2e.sh 2024-08-05 12:17:18 -04:00
CatherineF-dev cdce0e3278
Rename deployment-no-node-pods.yaml to deployment-unscheduled-pods-fetching.yaml 2024-08-05 12:06:35 -04:00
CatherineF-dev 311d3f749a
Rename deployment-no-node-pods-service.yaml to deployment-unscheduled-pods-fetching-service.yaml 2024-08-05 12:06:22 -04:00
CatherineF-dev 720ea8cd89
Update deployment-no-node-pods-service.yaml 2024-08-05 12:05:51 -04:00
CatherineF-dev aeade61698
Update kube-state-metrics.libsonnet 2024-08-05 12:05:17 -04:00
CatherineF-dev f44bafd9af
Fix e2e test failure 2024-08-05 11:52:04 -04:00
Kubernetes Prow Robot 312b298239
Merge pull request #2454 from jeffmccune/jeff/kp
fix: syntax errors in kube-state-metrics.libsonnet
2024-08-05 08:44:59 -07:00
Jeff McCune 3aebcf71a9
fix: syntax errors in kube-state-metrics.libsonnet
Previously customizing kube-prometheus [1] failed with the following
error.

    ❯ ./build.sh example.jsonnet
    + set -o pipefail
    + rm -rf manifests
    + mkdir -p manifests/setup
    + jsonnet -J vendor -m manifests example.jsonnet
    + xargs '-I{}' sh -c 'cat {} | gojsontoyaml > {}.yaml' -- '{}'
    RUNTIME ERROR: vendor/github.com/kubernetes/kube-state-metrics/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet:392:21-22 Expected token OPERATOR but got "{"
            vendor/kube-prometheus/components/kube-state-metrics.libsonnet:51:19-124        function <anonymous>
            vendor/kube-prometheus/main.libsonnet:136:21-64 object <anonymous>
            vendor/kube-prometheus/platforms/platforms.libsonnet:37:22-40   +:
            example.jsonnet:33:90-109       thunk from <$>
            <std>:1539:24-25        thunk from <function <anonymous>>
            <std>:1539:5-33 function <anonymous>
            example.jsonnet:33:73-110       $
            example.jsonnet:33:1-112
            example.jsonnet:33:1-112
            During evaluation

With this patch, the build succeeds:

    ❯ bash build.sh example.jsonnet ; echo $?
    + set -o pipefail
    + rm -rf manifests
    + mkdir -p manifests/setup
    + jsonnet -J vendor -m manifests example.jsonnet
    + xargs '-I{}' sh -c 'cat {} | gojsontoyaml > {}.yaml' -- '{}'
    + find manifests -type f '!' -name '*.yaml' -delete
    + rm -f kustomization
    0

[1]: https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md
2024-08-05 08:41:49 -07:00
Kubernetes Prow Robot 45b5a26c3e
Merge pull request #2465 from mrueg/newreflectorwithoptions
chore: Replace NewReflector with NewReflectorWithOptions func
2024-08-05 08:09:00 -07:00
Kubernetes Prow Robot 5878458d97
Merge pull request #2464 from mrueg/avoid-naked-return
chore: Avoid naked return
2024-08-05 08:06:59 -07:00
Manuel Rüger 74d226ccf0 chore: Replace NewReflector with NewReflectorWithOptions func 2024-08-05 16:44:43 +02:00
Manuel Rüger cc79a58411 chore: Avoid naked return 2024-08-05 16:34:30 +02:00
Kubernetes Prow Robot d1e717911b
Merge pull request #2456 from mrueg/dockerfile
fix(Dockerfile): Install tools so VERSION gets set
2024-07-27 10:30:24 -07:00
Manuel Rüger 0dd960eb31 Dockerfile: Install tools so VERSION gets set 2024-07-26 13:56:17 +02:00
Kubernetes Prow Robot e96dfc0a39
Merge pull request #2388 from CatherineF-dev/patch-11
fix: use --track-unscheduled-pods to select unscheduled pods in Daemonset sharding
2024-07-24 10:16:50 -07:00
Catherine Fang aeb9e355b5 Fix Nodetype 2024-07-24 10:01:05 -04:00
CatherineF-dev e18b5573ac format 2024-07-23 20:21:17 -04:00
Catherine Fang eda1984438 Rename --enable-unscheduled-pods-fetching to --track-unscheduled-pods 2024-07-23 20:21:17 -04:00
Catherine Fang 19a0544f44 update doc 2024-07-23 20:20:18 -04:00
CatherineF-dev c9ceded724 Update docs/developer/cli-arguments.md
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2024-07-23 20:19:09 -04:00
CatherineF-dev bb5a37c6e9 Update jsonnet/kube-state-metrics/kube-state-metrics.libsonnet
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2024-07-23 20:19:09 -04:00
CatherineF-dev 4a524950f1 Update pkg/options/types.go
Co-authored-by: Alex Kennedy <alexzanderkennedy@gmail.com>
2024-07-23 20:19:09 -04:00
Catherine Fang 85f8a2c4cc rename to --enable-unscheduled-pods-fetching 2024-07-23 20:19:09 -04:00
Catherine Fang 49e1170f67 rename to --fetch-unscheduled-pods 2024-07-23 20:18:53 -04:00
CatherineF-dev b27845d535 use --enable-no-node-scrape
Co-authored-by: Alex Kennedy <alexzanderkennedy@gmail.com>
2024-07-23 20:18:35 -04:00
Catherine Fang 8f3c5c432b Add e2e test 2024-07-23 20:18:00 -04:00
Catherine Fang b45913db59 Fix --nodeName= doesn't select unscheduable pods
pods
2024-07-23 20:17:48 -04:00
Kubernetes Prow Robot a3e9266c8f
Merge pull request #2451 from ricardoapl/generate-sbom-command-not-found
ci: missing line break escape on sbom workflow
2024-07-19 09:29:57 -07:00
Kubernetes Prow Robot 38c2689093
Merge pull request #2450 from kubernetes/release-2.13
chore: Merge release branch back to main
2024-07-19 08:21:06 -07:00
Ricardo Lopes 8753dfd5b7 Fix missing line break escape on sbom workflow
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-07-19 16:08:44 +01:00
Kubernetes Prow Robot 76c5888e34
Merge pull request #2419 from mrueg/prep-2.13.0
chore: Prep release v2.13.0
2024-07-19 06:21:55 -07:00
Manuel Rüger b8c1166153 *: Cut 2.13.0 2024-07-18 12:56:53 +02:00
Manuel Rüger b4f4dff5c5 Bump dependencies 2024-07-18 12:55:12 +02:00
Kubernetes Prow Robot 7104d579e9
Merge pull request #2444 from sanadhis/chore-add-kustomization
chore: add kustomization to standard example
2024-07-16 08:23:48 -07:00
sanadhis 2e4b3e4965
chore: add kustomization to standard example 2024-07-16 16:16:19 +02:00
Kubernetes Prow Robot 5972617294
Merge pull request #2447 from SuperQ/auto_memlimit
perf: Add automatic detection of memory limits
2024-07-16 05:50:59 -07:00
SuperQ eea0524d54
Add automatic detection of memory limits
Add automatic detection of container and system memory limits to control
the Go `GOMEMLIMIT` garbage collector feature. This helps reduced OOMs
by triggering GC when the process approaches system limits.

Signed-off-by: SuperQ <superq@gmail.com>
2024-07-16 12:09:22 +02:00
Kubernetes Prow Robot f7618dfc32
Merge pull request #2442 from rexagod/readyz
fix: add `readyz` endpoint
2024-07-15 05:15:10 -07:00
Pranshu Srivastava dbb0276a42
fixup! fixup! fix: add `readyz` endpoint 2024-07-15 17:32:22 +05:30
Kubernetes Prow Robot a1fb0ce267
Merge pull request #2448 from kubernetes/dependabot/github_actions/actions/setup-go-5.0.2
build(deps): Bump actions/setup-go from 5.0.1 to 5.0.2
2024-07-15 02:55:09 -07:00
dependabot[bot] b954ff66f6
build(deps): Bump actions/setup-go from 5.0.1 to 5.0.2
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](cdcb360436...0a12ed9d6a)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 09:48:21 +00:00
Pranshu Srivastava b980579e08
fixup! fix: add `readyz` endpoint 2024-07-05 18:27:48 +05:30
Pranshu Srivastava dae1f062c0
fix: add `readyz` endpoint
Discourage the usage of `/metrics` for any probe, and use `/readyz` in
place of the earlier telemetry metrics endpoint to secure the exposition
data.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-07-04 01:10:28 +05:30
Kubernetes Prow Robot 85d1423b5b
Merge pull request #2438 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.55.0
build(deps): Bump github.com/prometheus/common from 0.54.0 to 0.55.0
2024-07-01 03:43:50 -07:00
Kubernetes Prow Robot 6e1ca9923d
Merge pull request #2437 from kubernetes/dependabot/github_actions/amannn/action-semantic-pull-request-5.5.3
build(deps): Bump amannn/action-semantic-pull-request from 5.5.2 to 5.5.3
2024-07-01 03:41:39 -07:00
dependabot[bot] d01ed2f8de
build(deps): Bump github.com/prometheus/common from 0.54.0 to 0.55.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.54.0 to 0.55.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.54.0...v0.55.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 09:27:22 +00:00
dependabot[bot] f6c5a4bb2c
build(deps): Bump amannn/action-semantic-pull-request
Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 5.5.2 to 5.5.3.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](cfb60706e1...0723387faa)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 09:23:40 +00:00
Kubernetes Prow Robot dc86adec12
Merge pull request #2411 from mrueg/clomonitor-readme
docs: Add SSF Best practices badge and community section
2024-06-28 08:10:05 -07:00
Kubernetes Prow Robot d862cacaa6
Merge pull request #2418 from rexagod/livez
feat: add `livez` endpoint
2024-06-25 03:13:41 -07:00
Pranshu Srivastava 6f8f7d1f7b
fixup! enhancement: add `livez` endpoint 2024-06-25 15:00:20 +05:30
Pranshu Srivastava eb80c09755
enhancement: add `livez` endpoint
Add a `livez` endpoint to identify network outages. This helps in
restarting the binary if such as case is observed.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-06-25 14:35:16 +05:30
Kubernetes Prow Robot f4ab888d57
Merge pull request #2430 from kubernetes/dependabot/go_modules/k8s-dependencies-f351cbf957
build(deps): Bump k8s.io/klog/v2 from 2.130.0 to 2.130.1 in the k8s-dependencies group
2024-06-24 22:17:40 -07:00
dependabot[bot] 1483f22ce4
build(deps): Bump k8s.io/klog/v2 in the k8s-dependencies group
Bumps the k8s-dependencies group with 1 update: [k8s.io/klog/v2](https://github.com/kubernetes/klog).


Updates `k8s.io/klog/v2` from 2.130.0 to 2.130.1
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.130.0...v2.130.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 09:54:21 +00:00
Kubernetes Prow Robot 086af0cbaf
Merge pull request #2398 from ricardoapl/publish-openvex-on-release
ci: publish openvex on release
2024-06-18 07:32:39 -07:00
Kubernetes Prow Robot 2aa41eef9a
Merge pull request #2426 from kubernetes/dependabot/github_actions/kubernetes-sigs/release-actions-0.2.0
build(deps): Bump kubernetes-sigs/release-actions from 0.1.4 to 0.2.0
2024-06-18 07:28:38 -07:00
Ricardo Lopes 4269ab10ab Apply consistent format across workflow files
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-06-18 09:16:02 +01:00
Ricardo Lopes fba4a75753 Fix permissions for uploading to release
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-06-18 09:16:02 +01:00
Ricardo Lopes 2bd0b60b5a Avoid trigger OpenVEX on pre-release
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-06-18 09:16:02 +01:00
Ricardo Lopes 9dfddac86a Publish OpenVEX data on release
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-06-18 09:16:02 +01:00
dependabot[bot] 5ac3eff94b
build(deps): Bump kubernetes-sigs/release-actions from 0.1.4 to 0.2.0
Bumps [kubernetes-sigs/release-actions](https://github.com/kubernetes-sigs/release-actions) from 0.1.4 to 0.2.0.
- [Release notes](https://github.com/kubernetes-sigs/release-actions/releases)
- [Changelog](https://github.com/kubernetes-sigs/release-actions/blob/main/RELEASE.md)
- [Commits](841d76a188...2f8b9ec22a)

---
updated-dependencies:
- dependency-name: kubernetes-sigs/release-actions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 10:26:19 +00:00
Kubernetes Prow Robot c99e26a229
Merge pull request #2425 from kubernetes/dependabot/github_actions/actions/checkout-4.1.7
build(deps): Bump actions/checkout from 4.1.3 to 4.1.7
2024-06-17 03:25:43 -07:00
Kubernetes Prow Robot f954f30419
Merge pull request #2423 from kubernetes/dependabot/go_modules/github.com/spf13/cobra-1.8.1
build(deps): Bump github.com/spf13/cobra from 1.8.0 to 1.8.1
2024-06-17 03:23:28 -07:00
Kubernetes Prow Robot 124117ff27
Merge pull request #2412 from grafana/fix/add-server-timeouts
fix(server): Add read and write timeouts
2024-06-17 03:21:13 -07:00
Kubernetes Prow Robot 5d387b0f89
Merge pull request #2422 from kubernetes/dependabot/go_modules/k8s-dependencies-8f95eb128b
build(deps): Bump the k8s-dependencies group with 6 updates
2024-06-17 03:18:53 -07:00
dependabot[bot] dba6d4d7e4
build(deps): Bump actions/checkout from 4.1.3 to 4.1.7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.3...692973e3d937129bcbf40652eb9f2f61becf3332)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 09:41:29 +00:00
dependabot[bot] 9f61037781
build(deps): Bump github.com/spf13/cobra from 1.8.0 to 1.8.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 09:12:47 +00:00
dependabot[bot] 8760088b49
build(deps): Bump the k8s-dependencies group with 6 updates
Bumps the k8s-dependencies group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.30.1` | `0.30.2` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.30.1` | `0.30.2` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.30.1` | `0.30.2` |
| [k8s.io/component-base](https://github.com/kubernetes/component-base) | `0.30.1` | `0.30.2` |
| [k8s.io/klog/v2](https://github.com/kubernetes/klog) | `2.120.1` | `2.130.0` |
| [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) | `0.30.1` | `0.30.2` |


Updates `k8s.io/api` from 0.30.1 to 0.30.2
- [Commits](https://github.com/kubernetes/api/compare/v0.30.1...v0.30.2)

Updates `k8s.io/apimachinery` from 0.30.1 to 0.30.2
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.30.1...v0.30.2)

Updates `k8s.io/client-go` from 0.30.1 to 0.30.2
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.30.1...v0.30.2)

Updates `k8s.io/component-base` from 0.30.1 to 0.30.2
- [Commits](https://github.com/kubernetes/component-base/compare/v0.30.1...v0.30.2)

Updates `k8s.io/klog/v2` from 2.120.1 to 2.130.0
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.120.1...v2.130.0)

Updates `k8s.io/sample-controller` from 0.30.1 to 0.30.2
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.30.1...v0.30.2)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 09:12:42 +00:00
Kubernetes Prow Robot 89f0db6dd2
Merge pull request #2395 from ricardoapl/fix-github-token-permissions
ci: least privileged GITHUB_TOKEN permissions
2024-06-14 03:13:26 -07:00
pokom cd460fef29 Update cli-arguments.md 2024-06-11 06:48:22 -04:00
Kubernetes Prow Robot 669b5018f2
Merge pull request #2381 from ricardoapl/generate-sbom-workflow
ci: generate sbom on release
2024-06-10 09:01:52 -07:00
Kubernetes Prow Robot 3a81bf3528
Merge pull request #2416 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.54.0
build(deps): Bump github.com/prometheus/common from 0.53.0 to 0.54.0
2024-06-10 04:17:55 -07:00
dependabot[bot] 698f76a8d5
build(deps): Bump github.com/prometheus/common from 0.53.0 to 0.54.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.53.0 to 0.54.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.53.0...v0.54.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 10:01:12 +00:00
Mark ee3913967e
Update docs/developer/cli-arguments.md
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2024-06-07 14:13:44 -04:00
pokom 28dbd26540 Create variables for default values of new flags 2024-06-07 13:14:57 -04:00
pokom b4f032ecfd Add additional flags for IdleTimeouts 2024-06-06 13:11:00 -04:00
pokom e97933bcb9 fix(server): Add read and write timeouts
There are a few documented scenarios where `kube-state-metrics` will
lock up(#995, #1028). I believe a much simpler solution to ensure
`kube-state-metrics` doesn't lock up and require a restart to server
`/metrics` requests is to add default read and write timeouts and to
allow them to be configurable. At Grafana, we've experienced a few
scenarios where `kube-state-metrics` running in larger clusters falls
behind and starts getting scraped multiple times. When this occurs,
`kube-state-metrics` becomes completely unresponsive and requires a
reboot. This is somewhat easily reproduceable(I'll provide a script in
an issue) and causes other critical workloads(KEDA, VPA) to fail in
weird ways.

Adds two flags:
- `server-read-timeout`
- `server-write-timeout`

Updates the metrics http server to set the `ReadTimeout` and
`WriteTimeout` to the configured values.
2024-06-05 14:18:43 -04:00
Manuel Rüger 738e6befae Add SSF Best practices badge and community section 2024-06-04 19:54:21 +02:00
Kubernetes Prow Robot 7995d5fd23
Merge pull request #2402 from ricardoapl/add-dependencies-policy
docs: add policy for consuming and upgrading dependencies
2024-06-04 09:33:40 -07:00
Kubernetes Prow Robot f28abc9258
Merge pull request #2347 from pkoutsovasilis/pkoutsovasilis/autosharding_field_selector
fix(pod autosharding): transition from labelselector to fieldselector
2024-06-04 05:23:23 -07:00
Kubernetes Prow Robot a4ddfe6ed9
Merge pull request #2410 from kubernetes/dependabot/go_modules/github.com/spf13/viper-1.19.0
build(deps): Bump github.com/spf13/viper from 1.18.2 to 1.19.0
2024-06-03 03:39:35 -07:00
Kubernetes Prow Robot ab03a29d46
Merge pull request #2409 from kubernetes/dependabot/go_modules/tools/github.com/hairyhenderson/gomplate/v3-3.11.8
build(deps): Bump github.com/hairyhenderson/gomplate/v3 from 3.11.7 to 3.11.8 in /tools
2024-06-03 03:37:16 -07:00
dependabot[bot] c38f24b2aa
build(deps): Bump github.com/spf13/viper from 1.18.2 to 1.19.0
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.18.2 to 1.19.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.18.2...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 09:58:53 +00:00
dependabot[bot] bb0a33c7a6
build(deps): Bump github.com/hairyhenderson/gomplate/v3 in /tools
Bumps [github.com/hairyhenderson/gomplate/v3](https://github.com/hairyhenderson/gomplate) from 3.11.7 to 3.11.8.
- [Release notes](https://github.com/hairyhenderson/gomplate/releases)
- [Changelog](https://github.com/hairyhenderson/gomplate/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hairyhenderson/gomplate/compare/v3.11.7...v3.11.8)

---
updated-dependencies:
- dependency-name: github.com/hairyhenderson/gomplate/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 09:44:31 +00:00
Ricardo Lopes 9917008f7e docs: lint markdown
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-05-28 10:31:31 +01:00
Ricardo Lopes 8c75a8b589 docs: add policy for consuming and upgrading dependencies
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-05-27 11:52:06 +01:00
Kubernetes Prow Robot 85762cdf97
Merge pull request #2401 from kubernetes/dependabot/github_actions/amannn/action-semantic-pull-request-5.5.2
build(deps): Bump amannn/action-semantic-pull-request from 5.4.0 to 5.5.2
2024-05-27 03:35:54 -07:00
dependabot[bot] d01fb796da
build(deps): Bump amannn/action-semantic-pull-request
Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 5.4.0 to 5.5.2.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](e9fabac35e...cfb60706e1)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-27 09:16:49 +00:00
Kubernetes Prow Robot d8dd6e0704
Merge pull request #2396 from ricardoapl/pin-github-actions
chore: pin dependencies in GitHub Actions by hash
2024-05-24 07:55:10 -07:00
Ricardo Lopes b6697e5166 ci: rename asset to pass CLOMonitor checks
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-05-24 09:18:22 +01:00
Ricardo Lopes b983ed5f42 Pin dependencies in GitHub Actions by hash
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-05-22 17:14:24 +01:00
Ricardo Lopes 8867e6ece9 Restrict permissions for GITHUB_TOKEN
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-05-22 15:49:26 +01:00
Kubernetes Prow Robot 7caed2384c
Merge pull request #2394 from kubernetes/dependabot/go_modules/k8s-dependencies-ac34a464a8
build(deps): Bump the k8s-dependencies group with 5 updates
2024-05-20 04:17:27 -07:00
dependabot[bot] 2b2d1dc133
build(deps): Bump the k8s-dependencies group with 5 updates
Bumps the k8s-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.30.0` | `0.30.1` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.30.0` | `0.30.1` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.30.0` | `0.30.1` |
| [k8s.io/component-base](https://github.com/kubernetes/component-base) | `0.30.0` | `0.30.1` |
| [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) | `0.30.0` | `0.30.1` |


Updates `k8s.io/api` from 0.30.0 to 0.30.1
- [Commits](https://github.com/kubernetes/api/compare/v0.30.0...v0.30.1)

Updates `k8s.io/apimachinery` from 0.30.0 to 0.30.1
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.30.0...v0.30.1)

Updates `k8s.io/client-go` from 0.30.0 to 0.30.1
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.30.0...v0.30.1)

Updates `k8s.io/component-base` from 0.30.0 to 0.30.1
- [Commits](https://github.com/kubernetes/component-base/compare/v0.30.0...v0.30.1)

Updates `k8s.io/sample-controller` from 0.30.0 to 0.30.1
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.30.0...v0.30.1)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 09:15:39 +00:00
Kubernetes Prow Robot fa083b53d0
Merge pull request #2385 from jwilder/jwilder/cves
build: bump deps to fix CVEs
2024-05-13 08:26:30 -07:00
Kubernetes Prow Robot 63a7bc9bc7
Merge pull request #2389 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.19.1
build(deps): Bump github.com/prometheus/client_golang from 1.19.0 to 1.19.1
2024-05-13 03:04:58 -07:00
dependabot[bot] 93e8d99a7d
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.19.0 to 1.19.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.0...v1.19.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 09:07:30 +00:00
Jason Wilder a5e168f269 build: bump deps to fix CVEs
Updates all deps flagging for fixed CVEs and updates go to 1.22.2.

Fixes CVE-2022-21698 CVE-2022-46146 CVE-2021-43565 CVE-2022-27191
    CVE-2023-48795 CVE-2022-27664 CVE-2022-41723 CVE-2023-39325
    CVE-2023-3978 CVE-2023-44487 CVE-2023-45288 CVE-2022-29526
    CVE-2021-38561 CVE-2022-32149 CVE-2024-24786 CVE-2022-28948
2024-05-02 14:38:13 -06:00
Kubernetes Prow Robot 2b8eea4e27
Merge pull request #2379 from mrueg/k8s-1.30.0
feat: Support k8s 1.30
2024-05-02 11:47:13 -07:00
Ricardo Lopes 2a23510019 ci: trigger on release but not on pre-release
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-25 16:22:16 +01:00
Ricardo Lopes 7fc6c5dd2e ci: fetch tag name on release
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-25 15:44:33 +01:00
Ricardo Lopes a0f5ebef42 ci: generate sbom on release
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-24 17:17:59 +01:00
Kubernetes Prow Robot 9e6e70d328
Merge pull request #2370 from ricardoapl/kube_persistentvolume_volume_mode
feat: add kube_persistentvolume_volume_mode metric
2024-04-22 14:23:52 -07:00
Manuel Rüger 569e820c65 feat: Make cronjob timezone aware 2024-04-22 23:16:49 +02:00
Manuel Rüger 6d8f7573aa feat: Support k8s 1.30 2024-04-22 20:16:33 +02:00
Kubernetes Prow Robot 8b8c93c62a
Merge pull request #2378 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.53.0
build(deps): Bump github.com/prometheus/common from 0.52.3 to 0.53.0
2024-04-22 02:39:33 -07:00
dependabot[bot] 86846679a3
build(deps): Bump github.com/prometheus/common from 0.52.3 to 0.53.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.52.3 to 0.53.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.52.3...v0.53.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 09:27:11 +00:00
Manuel Rüger be6fc00d98 feat: Add timezone to kube_cronjob_info 2024-04-22 10:16:59 +02:00
Ricardo Lopes b1b8d24cbf refactor: remove unused var
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-17 09:52:05 +01:00
Ricardo Lopes ef4fceac06 refactor: reduce cyclomatic complexity
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-17 09:51:05 +01:00
Ricardo Lopes 610918ea24 fixup! feat: add kube_persistentvolume_volume_mode metric
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-15 17:32:12 +01:00
Ricardo Lopes a40944b47b feat: add kube_persistentvolume_volume_mode metric
Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
2024-04-15 17:26:55 +01:00
Kubernetes Prow Robot ba23b77203
Merge pull request #2369 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.52.3
build(deps): Bump github.com/prometheus/common from 0.52.2 to 0.52.3
2024-04-15 06:05:57 -07:00
dependabot[bot] ff78ed0f07
build(deps): Bump github.com/prometheus/common from 0.52.2 to 0.52.3
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.52.2 to 0.52.3.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.52.2...v0.52.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 09:56:36 +00:00
Kubernetes Prow Robot 9e855147a2
Merge pull request #2362 from mrueg/go-1.22
chore: Build with go 1.22
2024-04-08 08:48:28 -07:00
Kubernetes Prow Robot 1be8dafc30
Merge pull request #2365 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.52.2
build(deps): Bump github.com/prometheus/common from 0.51.1 to 0.52.2
2024-04-08 03:05:43 -07:00
dependabot[bot] e8a9bcfed9
build(deps): Bump github.com/prometheus/common from 0.51.1 to 0.52.2
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.51.1 to 0.52.2.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.51.1...v0.52.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 09:44:16 +00:00
Kubernetes Prow Robot 623952925d
Merge pull request #2364 from kubernetes/dependabot/go_modules/github.com/prometheus/client_model-0.6.1
build(deps): Bump github.com/prometheus/client_model from 0.6.0 to 0.6.1
2024-04-08 02:43:31 -07:00
dependabot[bot] 07364ba2c1
build(deps): Bump github.com/prometheus/client_model from 0.6.0 to 0.6.1
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.6.0...v0.6.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 09:08:20 +00:00
Manuel Rüger 0c030421ca chore: Update prometheus to 2.51.1 2024-04-05 00:20:04 +02:00
Manuel Rüger 851c01d0fd chore: Bump markdownlint-cli2 to 0.13.0 2024-04-05 00:20:04 +02:00
Manuel Rüger fd2a1f83f3 chore: Build with go 1.22 2024-04-05 00:20:04 +02:00
Manuel Rüger d7d561f999
Merge pull request #2363 from ovidiutirla/fix-ci-after-docs-reorg
chore: use string verb to format logging messages in tests
2024-04-04 22:33:39 +02:00
Ovidiu Tirla b72faf3af9 chore: use string verb to format logging messages in tests
The %w makes the CI to fail, replacing it back to %s
2024-04-04 18:41:47 +00:00
Kubernetes Prow Robot ea8a7f8c33
Merge pull request #2358 from ovidiutirla/reorg-docs
docs: reorganize documentation directory structure
2024-04-04 10:40:51 -07:00
Ovidiu Tirla 071c523e20
chore: update log message
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2024-04-04 19:25:02 +02:00
Kubernetes Prow Robot 20895032eb
Merge pull request #2361 from mrueg/template-more
chore: Replace VERSION file with data.yaml
2024-04-03 19:22:10 -07:00
Manuel Rüger 7aa1659a35 chore: Replace VERSION file with data.yaml 2024-04-04 00:54:23 +02:00
Kubernetes Prow Robot d4ae486023
Merge pull request #2360 from kubernetes/release-2.12
chore: Sync `release-2.12` with `main`
2024-04-03 05:54:06 -07:00
Ovidiu Tirla 1669ae6c77 test: lookup recursively for docs in e2e test 2024-04-03 12:32:14 +00:00
Ovidiu Tirla 66601c2be4 chore: fix doccheck to lookup recursively 2024-04-03 12:32:14 +00:00
Ovidiu Tirla 3fc953561f docs: reorganize documentation directory structure 2024-04-03 12:32:14 +00:00
Kubernetes Prow Robot 1e8b837eb1
Merge pull request #2335 from rexagod/release-2.12
chore: Cut v2.12.0
2024-04-02 08:08:11 -07:00
Pranshu Srivastava 48050aea65
chore: Cut v2.12 2024-04-02 15:32:28 +05:30
Kubernetes Prow Robot 3478fe9ddd
Merge pull request #2352 from mrueg/prom-common-0.51
chore: Bump prometheus/common library
2024-04-01 17:13:53 -07:00
Kubernetes Prow Robot 3f44ad0f7b
Merge pull request #2344 from mrueg/template-readme
docs: Template the README file
2024-03-31 18:17:33 -07:00
Manuel Rüger 97b10ea5e7 docs: Template the README file 2024-03-31 20:11:46 +02:00
Manuel Rüger 768a0a4338 chore: Bump prometheus/common library 2024-03-28 20:45:36 +01:00
Kubernetes Prow Robot fa5eb67feb
Merge pull request #2270 from rexagod/2248
fix: fallback to `gauge` for `protofmt`-based negotiations
2024-03-27 11:30:53 -07:00
Pranshu Srivastava 2a06c45061
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-03-27 23:53:23 +05:30
Kubernetes Prow Robot 0a8b3b4aad
Merge pull request #2350 from kubernetes/dependabot/go_modules/github.com/stretchr/testify-1.9.0
build(deps): Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
2024-03-26 11:46:35 -07:00
Pranshu Srivastava 8e7b38d516
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-03-26 23:47:53 +05:30
dependabot[bot] f9f1d5036a
build(deps): Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-26 14:56:34 +00:00
Kubernetes Prow Robot fea5dfd26d
Merge pull request #2343 from mrueg/bump-1.29
chore: Bump kubernetes 1.29 deps
2024-03-26 07:55:20 -07:00
Kubernetes Prow Robot a3489c0ace
Merge pull request #2052 from rexagod/prefixed-star-paths
feat: Allow prefixing wildcard `labelsFromPath`
2024-03-26 07:51:19 -07:00
Kubernetes Prow Robot 97c710b40d
Merge pull request #2291 from tetianakravchenko/add_metric_kube_pod_container_status_last_terminated_timestamp
feat: add kube_pod_container_status_last_terminated_timestamp metric
2024-03-25 07:12:39 -07:00
Panos Koutsovasilis 097ae84c0c feat: [pod autosharding] transition from labelselector to fieldselector 2024-03-22 00:00:05 +02:00
Manuel Rüger 9ba2547ca7 chore: Fix test 2024-03-18 16:39:06 +01:00
Manuel Rüger 3cf239076f chore: Group k8s deps on dependabot 2024-03-18 16:39:06 +01:00
Manuel Rüger 0cb296564b chore: Bump to kubernetes 1.29 2024-03-18 16:12:17 +01:00
Kubernetes Prow Robot 9ba1c37021
Merge pull request #2334 from rexagod/release-2.11-sync
chore: Sync `release-2.11`
2024-03-14 05:31:25 -07:00
Pranshu Srivastava ce23b82cd8
*: Cut v2.11.0
Blocked by #2316.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-03-07 13:23:10 +05:30
Tetiana Kravchenko 393430ed86 fix the description of the 'kube_pod_container_status_last_terminated_timestamp' metric
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
2024-03-04 11:40:34 +01:00
Kubernetes Prow Robot 44c65d2723
Merge pull request #2332 from yosshi825/fix/broken-markdown-format
style: fix broken markdown format
2024-02-29 04:12:05 -08:00
Shota Yoshimura 195d277259
Update docs/lease-metrics.md
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2024-02-29 17:36:54 +09:00
yosshi825 e74428eb1e fix broken markdown format 2024-02-29 16:08:45 +09:00
Kubernetes Prow Robot c92541d2bd
Merge pull request #2298 from jrcichra/kube_secret_owner
feat: add kube_secret_owner metric
2024-02-25 11:23:27 -08:00
Kubernetes Prow Robot a1329c1d22
Merge pull request #2322 from kubernetes/dependabot/go_modules/github.com/prometheus/client_model-0.6.0
build(deps): Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0
2024-02-23 09:52:12 -08:00
dependabot[bot] 8f2224ec37
build(deps): Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-23 16:38:25 +00:00
Kubernetes Prow Robot 8481b06a25
Merge pull request #2318 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.47.0
build(deps): Bump github.com/prometheus/common from 0.46.0 to 0.47.0
2024-02-23 08:27:18 -08:00
dependabot[bot] 42a499930a
build(deps): Bump github.com/prometheus/common from 0.46.0 to 0.47.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.46.0 to 0.47.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.46.0...v0.47.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 09:35:04 +00:00
Justin Cichra 01507af984 feat: add kube_secret_owner metric
Add the kube_secret_owner metric for Secrets.

This metric already exists for several other Kubernetes primitives (Jobs, Pods, etc).

Cluster operators will often use external secret stores with a controller
to reconcile those secrets into Kubernetes Secrets.

Cluster operators may wish to discourage manually managed secrets.

Having the secret owner data in kube-state-metrics allows graphing and alerting on unmanaged secrets.
2024-02-05 10:55:58 -05:00
Kubernetes Prow Robot 122e5e8999
Merge pull request #2312 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.46.0
build(deps): Bump github.com/prometheus/common from 0.45.0 to 0.46.0
2024-01-29 05:46:44 -08:00
dependabot[bot] e52dcc8695
build(deps): Bump github.com/prometheus/common from 0.45.0 to 0.46.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.45.0...v0.46.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 09:37:48 +00:00
Kubernetes Prow Robot 0fb6eee2af
Merge pull request #2309 from kubernetes/dependabot/go_modules/k8s.io/klog/v2-2.120.1
build(deps): Bump k8s.io/klog/v2 from 2.110.1 to 2.120.1
2024-01-24 15:29:03 +01:00
Tetiana Kravchenko dbdb77c920 fix benchmark test; add missing kube_pod_container_status_last_terminated_timestamp in pod tests
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
2024-01-22 16:32:52 +01:00
Tetiana Kravchenko 8876d40ecd add kube_pod_container_status_last_terminated_timestamp to the unit tests
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
2024-01-22 15:36:58 +01:00
dependabot[bot] e9435887d5
build(deps): Bump k8s.io/klog/v2 from 2.110.1 to 2.120.1
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.110.1 to 2.120.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.110.1...v2.120.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 09:55:16 +00:00
Pranshu Srivastava e0c3e8384a
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 02:09:52 +05:30
Pranshu Srivastava b6496c7fb4
fixup! fixup! fixup! fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 00:04:41 +05:30
Pranshu Srivastava 883296e946
fixup! fixup! fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 00:04:41 +05:30
Pranshu Srivastava 0e23fdbe5a
fixup! fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 00:04:41 +05:30
Pranshu Srivastava 67f184cb13
fixup! fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 00:04:40 +05:30
Pranshu Srivastava bfa611dc51
fixup! fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 00:04:40 +05:30
Pranshu Srivastava 4be2ddf3f7
fixup! fix: fallback to `gauge` for `protofmt`-based negotiations 2024-01-15 00:04:40 +05:30
Pranshu Srivastava ee2f53a2f1
fix: fallback to `gauge` for `protofmt`-based negotiations
Fallback to `gauge` metric type when the negotiated content-type is
`protofmt`-based, since Prometheus' protobuf machinery does not
recognize all OpenMetrics types (`info` and `statesets` in this
context).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-01-15 00:04:39 +05:30
Kubernetes Prow Robot 90bd24f27c
Merge pull request #2292 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.18.0
build(deps): Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0
2024-01-02 16:13:57 +01:00
dependabot[bot] a04bba69ca
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 09:37:09 +00:00
Tetiana Kravchenko 51ccb665c4 feat: add kube_pod_container_status_last_terminated_timestamp metric
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
2023-12-28 15:04:49 +01:00
Kubernetes Prow Robot fde27ece8a
Merge pull request #2240 from changhyuni/add_label_init_cotainter_metric
feat: add restartPolicy to `kube_pod_init_container_info` metric
2023-12-19 20:02:39 +01:00
Kubernetes Prow Robot 7324ae5f12
Merge pull request #2217 from mickeyzzc/pods-shards-support-no-node-scraping
fix: Support scraping pods metrics that is still in scheduling status and has no assigned node
2023-12-19 19:59:25 +01:00
Kubernetes Prow Robot 50411374cd
Merge pull request #2276 from shafeeqes/enh/vex-2
feat: Generate OpenVX data for every release
2023-12-19 19:49:40 +01:00
Manuel Rüger 37ceaf4218
fix: Update README.md 2023-12-19 19:48:27 +01:00
Manuel Rüger 5834d64a65
fix: Update docs/pod-metrics.md 2023-12-19 19:47:02 +01:00
changhyuni f94716aa74 modify docs, restart policy 2023-12-20 01:18:19 +09:00
Kubernetes Prow Robot d99a440774
Merge pull request #2289 from kubernetes/dependabot/go_modules/github.com/spf13/viper-1.18.2
build(deps): Bump github.com/spf13/viper from 1.18.1 to 1.18.2
2023-12-19 12:04:40 +01:00
Shafeeque E S 9bbed501f2 Address PR review feedback 2023-12-19 16:28:44 +05:30
dependabot[bot] 4cbd42a56d
build(deps): Bump github.com/spf13/viper from 1.18.1 to 1.18.2
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.18.1...v1.18.2)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 10:47:16 +00:00
changhyuni 091ddf9d96 modify docs 2023-12-18 21:33:05 +09:00
Kubernetes Prow Robot 532fb2dba7
Merge pull request #2278 from dalehenries/add-security-insights
chore: add Security Insights (task 11)
2023-12-18 11:05:33 +01:00
Shafeeque E S c11318fa83 Address PR review feedback 2023-12-18 12:29:02 +05:30
Dale Henries 5058e146cd
Add documentation and security-testing sections
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2023-12-16 18:05:01 -05:00
Dale Henries 1091bf4318
Add images URL to distribution-points
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2023-12-16 18:02:37 -05:00
Dale Henries 4cbea37226
Add release-process
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2023-12-16 18:00:56 -05:00
Dale Henries b49d390298
Add link to SECURITY_INSIGHTS spec for future reference
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2023-12-16 12:59:45 -05:00
Dale Henries adf5df45bf Fix expiration-date to 2024
Signed-off-by: Dale Henries <dhenries@samaritan.org>
2023-12-15 17:28:15 -05:00
Kubernetes Prow Robot 39ffa00576
Merge pull request #2279 from dalehenries/token-permissions
ci: token permissions - security slam task 16
2023-12-15 22:58:03 +01:00
Kubernetes Prow Robot a73ae3d6bf
Merge pull request #2277 from dalehenries/add-openssf-scorecard
docs: add OpenSSF Scorecard to README
2023-12-15 22:31:30 +01:00
Dale Henries 1fe8e08c13 token permissions - security slam task 16
Signed-off-by: Dale Henries <dhenries@samaritan.org>
2023-12-15 16:25:32 -05:00
Dale Henries 960857e501 add Security Insights (task 11)
Signed-off-by: Dale Henries <dhenries@samaritan.org>
2023-12-15 15:33:44 -05:00
Dale Henries d247126d90 Revert unnecessary changes made by my markdown linter
Signed-off-by: Dale Henries <dhenries@samaritan.org>
2023-12-15 14:49:06 -05:00
Shafeeque E S 0442ef339e Rename file
Signed-off-by: Shafeeque E S <shafeeque.e.s@sap.com>
2023-12-16 01:14:20 +05:30
Dale Henries ef8f1bfa32 docs: add OpenSSF Scorecard to README
Signed-off-by: Dale Henries <dhenries@samaritan.org>
2023-12-15 14:14:36 -05:00
Shafeeque E S 4de960dc39 Address PR review feedback
Signed-off-by: Shafeeque E S <shafeeque.e.s@sap.com>
2023-12-16 00:22:07 +05:30
Shafeeque E S 376b033ab5 Generate OpenVEX data for every release
Signed-off-by: Shafeeque E S <shafeeque.e.s@sap.com>
2023-12-15 23:22:57 +05:30
Kubernetes Prow Robot fd3cd41fe6
Merge pull request #2275 from shafeeqes/enh/vex
feat: Initialize OpenVEX feed
2023-12-15 18:51:58 +01:00
Shafeeque E S 245d7fcc18 Fix linter errors 2023-12-15 23:11:40 +05:30
Shafeeque E S 02d0c940c8 Init OpenVEX feed 2023-12-15 22:55:59 +05:30
changhyuni b948807ba3 modify labels key
modify label key
2023-12-15 09:18:06 +09:00
changhyuni ed1a7f992c pods: update init_cotainer_info metric 2023-12-14 22:51:38 +09:00
Kubernetes Prow Robot 0bc4b19ac5
Merge pull request #2252 from stonith/add-externalip-node-info
feat: add kube_node_status_addresses metric
2023-12-14 10:28:33 +01:00
Darren Foo 069aeebaa3 add kube_node_status_addresses metric to docs 2023-12-13 23:58:47 -08:00
Darren Foo a403bb3ff5 add new kube_node_status_addresses metric that includes mutiple address/types 2023-12-13 16:51:49 -08:00
Kubernetes Prow Robot 8c1153e15d
Merge pull request #2272 from mrueg/improve-benchmark-output
chore: Improve benchmark output
2023-12-13 19:18:36 +01:00
Manuel Rüger 5ab665a68b chore: Improve benchmark output 2023-12-13 19:02:24 +01:00
Kubernetes Prow Robot 14e935a49f
Merge pull request #2266 from mrueg/endpointslices-namespaces
feat: Add namespace label to endpoinslice metrics
2023-12-11 19:28:14 +01:00
Manuel Rüger ca569e1ffe feat: Add namespace label to endpoinslice metrics
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-12-11 14:05:20 +01:00
Kubernetes Prow Robot 622efeee0a
Merge pull request #2263 from kubernetes/dependabot/go_modules/github.com/prometheus/exporter-toolkit-0.11.0
build(deps): Bump github.com/prometheus/exporter-toolkit from 0.10.0 to 0.11.0
2023-12-11 12:07:14 +01:00
Kubernetes Prow Robot bee257a1a1
Merge pull request #2265 from kubernetes/dependabot/github_actions/actions/setup-go-5
build(deps): Bump actions/setup-go from 4 to 5
2023-12-11 11:48:11 +01:00
dependabot[bot] 4c9c2ddc05
build(deps): Bump github.com/prometheus/exporter-toolkit
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 10:46:45 +00:00
Kubernetes Prow Robot b195db65c4
Merge pull request #2264 from kubernetes/dependabot/go_modules/github.com/spf13/viper-1.18.1
build(deps): Bump github.com/spf13/viper from 1.17.0 to 1.18.1
2023-12-11 11:45:34 +01:00
dependabot[bot] 3d0f76bcd4
build(deps): Bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 09:47:26 +00:00
dependabot[bot] 84acb90341
build(deps): Bump github.com/spf13/viper from 1.17.0 to 1.18.1
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.17.0 to 1.18.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.17.0...v1.18.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 09:23:59 +00:00
Kubernetes Prow Robot c707af4c2d
Merge pull request #2251 from mrueg/readd-embedmd
docs: Re-add embedmd command
2023-12-06 10:43:34 +01:00
Manuel Rüger a017f90941 docs: Re-add embedmd command 2023-11-29 13:50:47 +01:00
Kubernetes Prow Robot 98b38ba9bb
Merge pull request #2247 from CatherineF-dev/patch-4
docs: Add reproduce example in bug_report.md
2023-11-24 23:21:52 +01:00
mickeyzzc ad0e06c453 update readme ,track metrics for unassigned pods
Signed-off-by: mickeyzzc <mickey_zzc@163.com>
2023-11-23 21:42:22 +08:00
CatherineF-dev d3fe638cab
Update bug_report.md 2023-11-23 08:07:46 -05:00
Kubernetes Prow Robot 240cffd908
Merge pull request #2133 from machadovilaca/add-csi-volume-attributes-to-pv-info-metric
feat: create opt-in kube_persistentvolume_csi_attributes metric
2023-11-23 13:48:25 +01:00
João Vilaça e09df21d5d feat: create opt-in kube_persistentvolume_csi_attributes metric
Signed-off-by: João Vilaça <jvilaca@redhat.com>
2023-11-23 12:15:20 +00:00
CatherineF-dev f25f840a55
Update bug_report.md 2023-11-22 09:17:13 -05:00
CatherineF-dev be0082792a
Update bug_report.md 2023-11-20 22:31:18 -05:00
CatherineF-dev fcc7927ffb
Add reproduce example in bug_report.md 2023-11-20 22:27:39 -05:00
Kubernetes Prow Robot 87ad659502
Merge pull request #2244 from kubernetes/dependabot/go_modules/k8s.io/sample-controller-0.28.4
build(deps): Bump k8s.io/sample-controller from 0.28.3 to 0.28.4
2023-11-20 16:35:57 +01:00
dependabot[bot] c299a591f6
build(deps): Bump k8s.io/sample-controller from 0.28.3 to 0.28.4
Bumps [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) from 0.28.3 to 0.28.4.
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.28.3...v0.28.4)

---
updated-dependencies:
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 13:51:03 +00:00
Kubernetes Prow Robot bef45e8815
Merge pull request #2242 from kubernetes/dependabot/go_modules/k8s.io/component-base-0.28.4
build(deps): Bump k8s.io/component-base from 0.28.3 to 0.28.4
2023-11-20 14:50:17 +01:00
dependabot[bot] 2b2991f589
build(deps): Bump k8s.io/component-base from 0.28.3 to 0.28.4
Bumps [k8s.io/component-base](https://github.com/kubernetes/component-base) from 0.28.3 to 0.28.4.
- [Commits](https://github.com/kubernetes/component-base/compare/v0.28.3...v0.28.4)

---
updated-dependencies:
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 13:41:21 +00:00
Kubernetes Prow Robot 804c4f177c
Merge pull request #2245 from kubernetes/dependabot/go_modules/k8s.io/api-0.28.4
build(deps): Bump k8s.io/api from 0.28.3 to 0.28.4
2023-11-20 14:40:36 +01:00
dependabot[bot] 426001a9a9
build(deps): Bump k8s.io/api from 0.28.3 to 0.28.4
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.28.3 to 0.28.4.
- [Commits](https://github.com/kubernetes/api/compare/v0.28.3...v0.28.4)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 09:14:17 +00:00
changhyuni fc1831d8b2 pods: update init_cotainer_info metric 2023-11-18 23:45:52 +09:00
Kubernetes Prow Robot 4e431f6d14
Merge pull request #2234 from xonvanetta/feature/add-wilcard-allowlist-annotations
feat: Support filtering annotations allowlist by "*"
2023-11-09 18:26:07 +01:00
Kubernetes Prow Robot 48b967a9e6
Merge pull request #2237 from kubernetes/dependabot/go_modules/k8s.io/klog/v2-2.110.1
build(deps): Bump k8s.io/klog/v2 from 2.100.1 to 2.110.1
2023-11-08 18:35:47 +01:00
Kubernetes Prow Robot 97a75c0065
Merge pull request #2233 from CatherineF-dev/patch-3
refactor: Clean up generator.go
2023-11-08 18:33:05 +01:00
Kubernetes Prow Robot 7b8ea900e6
Merge pull request #2222 from adinhodovic/add-scheduler-name-metric
feat: Add new metric kube_pod_scheduler
2023-11-08 18:30:36 +01:00
adinhodovic e9c7e66748 fix: Rename kube_pod_scheduler_name to kube_pod_scheduler 2023-11-07 09:56:05 +01:00
Kubernetes Prow Robot a5e439a0a8
Merge pull request #2236 from kubernetes/dependabot/go_modules/github.com/spf13/cobra-1.8.0
build(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
2023-11-06 11:35:07 +01:00
dependabot[bot] 0cb5ca45fe
build(deps): Bump k8s.io/klog/v2 from 2.100.1 to 2.110.1
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.100.1 to 2.110.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.100.1...v2.110.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 09:58:05 +00:00
dependabot[bot] 0634b0d528
build(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 09:57:59 +00:00
Fabian Heib e4d2bd48c8 Support filtering annotations allowlist by "*"
Resolves: add-wilcard-allowlist-annotations
2023-11-02 17:22:02 +01:00
CatherineF-dev 60515bf580
Clean up generator.go 2023-10-30 08:54:27 -04:00
Kubernetes Prow Robot 82fd15ccc4
Merge pull request #2232 from kubernetes/dependabot/go_modules/github.com/fsnotify/fsnotify-1.7.0
build(deps): Bump github.com/fsnotify/fsnotify from 1.6.0 to 1.7.0
2023-10-30 12:24:22 +01:00
dependabot[bot] 252c5f7338
build(deps): Bump github.com/fsnotify/fsnotify from 1.6.0 to 1.7.0
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.6.0...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 09:14:56 +00:00
Kubernetes Prow Robot 9a499d2a05
Merge pull request #2225 from kubernetes/dependabot/go_modules/k8s.io/component-base-0.28.3
build(deps): Bump k8s.io/component-base from 0.28.2 to 0.28.3
2023-10-24 15:27:53 +02:00
dependabot[bot] 3b7b426fe4
build(deps): Bump k8s.io/component-base from 0.28.2 to 0.28.3
Bumps [k8s.io/component-base](https://github.com/kubernetes/component-base) from 0.28.2 to 0.28.3.
- [Commits](https://github.com/kubernetes/component-base/compare/v0.28.2...v0.28.3)

---
updated-dependencies:
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 16:35:21 +00:00
Kubernetes Prow Robot 9facc368ed
Merge pull request #2228 from kubernetes/dependabot/go_modules/k8s.io/sample-controller-0.28.3
build(deps): Bump k8s.io/sample-controller from 0.28.2 to 0.28.3
2023-10-23 18:34:25 +02:00
Kubernetes Prow Robot 423c5f260b
Merge pull request #2226 from kubernetes/dependabot/go_modules/github.com/prometheus/common-0.45.0
build(deps): Bump github.com/prometheus/common from 0.44.0 to 0.45.0
2023-10-23 18:31:43 +02:00
dependabot[bot] 015578526d
build(deps): Bump k8s.io/sample-controller from 0.28.2 to 0.28.3
Bumps [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) from 0.28.2 to 0.28.3.
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.28.2...v0.28.3)

---
updated-dependencies:
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 14:38:25 +00:00
dependabot[bot] dce0ec5cf8
build(deps): Bump github.com/prometheus/common from 0.44.0 to 0.45.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.44.0...v0.45.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 14:10:58 +00:00
Kubernetes Prow Robot f2b8966452
Merge pull request #2224 from kubernetes/dependabot/go_modules/k8s.io/api-0.28.3
build(deps): Bump k8s.io/api from 0.28.2 to 0.28.3
2023-10-23 16:07:07 +02:00
dependabot[bot] f76af437ff
build(deps): Bump k8s.io/api from 0.28.2 to 0.28.3
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.28.2 to 0.28.3.
- [Commits](https://github.com/kubernetes/api/compare/v0.28.2...v0.28.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 13:54:46 +00:00
Kubernetes Prow Robot fc483f5b0c
Merge pull request #2229 from mrueg/tools-update
chore: Run dependabot on tools directory
2023-10-23 15:51:08 +02:00
Manuel Rüger bc8ccc91d8 chore: Run dependabot on tools directory 2023-10-23 15:34:06 +02:00
蓝宝石的傻话 d1f04c2479 Add code comments
Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
2023-10-20 23:10:16 +08:00
adinhodovic c5c6c9a3f8 feat: Add new metric kube_pod_scheduler_name
Signed-off-by: adinhodovic <hodovicadin@gmail.com>
2023-10-19 19:41:34 +02:00
蓝宝石的傻话 f7ca9909df globals rename pods
Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
2023-10-18 14:01:18 +08:00
Kubernetes Prow Robot eac6d3b1c9
Merge pull request #2218 from kubernetes/dependabot/go_modules/github.com/google/go-cmp-0.6.0
build(deps): Bump github.com/google/go-cmp from 0.5.9 to 0.6.0
2023-10-17 16:02:51 +02:00
Kubernetes Prow Robot d9830a7ac2
Merge pull request #2215 from kubernetes/dependabot/go_modules/github.com/spf13/viper-1.17.0
build(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0
2023-10-17 15:58:16 +02:00
dependabot[bot] 889671b7cf
build(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 13:44:18 +00:00
dependabot[bot] b38786fe8c
build(deps): Bump github.com/google/go-cmp from 0.5.9 to 0.6.0
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.9 to 0.6.0.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.9...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-17 13:44:01 +00:00
Kubernetes Prow Robot bcac1bf101
Merge pull request #2219 from mrueg/fix-lint-1023
chore: Fix markdown lint
2023-10-17 15:37:12 +02:00
Kubernetes Prow Robot 6be7404b6b
Merge pull request #2212 from kubernetes/dependabot/go_modules/github.com/prometheus/client_golang-1.17.0
build(deps): Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
2023-10-16 17:33:00 +02:00
Manuel Rüger d57919d14e chore: Fix markdown lint 2023-10-16 17:24:43 +02:00
蓝宝石的傻话 5fc87fac85 add test
Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
2023-10-13 00:08:54 +08:00
蓝宝石的傻话 d33929e543 examples generated from libsonnet
Signed-off-by: 蓝宝石的傻话 <mickey_zzc@163.com>
2023-10-12 23:20:38 +08:00
mickeyzzc 539f57d75d simplified configuration
Signed-off-by: mickeyzzc <mickey_zzc@163.com>
2023-10-12 21:00:10 +08:00
rohitphatak 5c71459a61
feat(ingress): resource backend support added (#2109)
* feat(ingress): resource backend support added

* feat(ingress): updated test case

* Update internal/store/ingress.go

Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>

* feat(ingress): updated doc & test cases

---------

Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>
2023-10-11 16:25:07 +02:00
dependabot[bot] 12c91544a6
build(deps): Bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 12:56:15 +00:00
Kubernetes Prow Robot d2c6e20efb
Merge pull request #2216 from kubernetes/dependabot/go_modules/github.com/prometheus/client_model-0.5.0
build(deps): Bump github.com/prometheus/client_model from 0.4.0 to 0.5.0
2023-10-11 14:54:04 +02:00
mickeyzzc f8b0cb75ca add examples
Signed-off-by: mickeyzzc <mickey_zzc@163.com>
2023-10-11 14:05:31 +08:00
mickeyzzc 82f567907e pods support no node scraping
Signed-off-by: mickeyzzc <mickey_zzc@163.com>
2023-10-11 13:47:05 +08:00
dependabot[bot] 4a87392734
build(deps): Bump github.com/prometheus/client_model from 0.4.0 to 0.5.0
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 10:02:14 +00:00
Kubernetes Prow Robot b91dd31139
Merge pull request #2198 from kubernetes/dependabot/go_modules/k8s.io/component-base-0.28.2
build(deps): Bump k8s.io/component-base from 0.28.1 to 0.28.2
2023-09-22 07:06:49 -07:00
dependabot[bot] 5761c277ee
build(deps): Bump k8s.io/component-base from 0.28.1 to 0.28.2
Bumps [k8s.io/component-base](https://github.com/kubernetes/component-base) from 0.28.1 to 0.28.2.
- [Commits](https://github.com/kubernetes/component-base/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 16:55:41 +00:00
Kubernetes Prow Robot b2a220b68b
Merge pull request #2197 from kubernetes/dependabot/go_modules/k8s.io/sample-controller-0.28.2
build(deps): Bump k8s.io/sample-controller from 0.28.1 to 0.28.2
2023-09-21 09:54:29 -07:00
dependabot[bot] a8ab3202b4
build(deps): Bump k8s.io/sample-controller from 0.28.1 to 0.28.2
Bumps [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) from 0.28.1 to 0.28.2.
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-20 13:17:06 +00:00
Kubernetes Prow Robot ac7f9fb056
Merge pull request #2196 from kubernetes/dependabot/go_modules/k8s.io/apimachinery-0.28.2
build(deps): Bump k8s.io/apimachinery from 0.28.1 to 0.28.2
2023-09-20 06:16:02 -07:00
dependabot[bot] 00161f140d
build(deps): Bump k8s.io/apimachinery from 0.28.1 to 0.28.2
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.28.1 to 0.28.2.
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 09:22:09 +00:00
Kubernetes Prow Robot 76f42c19af
Merge pull request #2190 from dgrisonnet/fix-regression
fix: Remove FieldSelector from non-namespaced resources
2023-09-12 02:04:12 -07:00
Damien Grisonnet cf00170dd4 store: fix missing cluster-scoped resources
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-09-12 09:40:21 +02:00
Manuel Rüger 023f83dd03 Fix: Remove FieldSelector from non-namespaced resources
This should resolve the issue with namespace-denylist as discovered in https://github.com/kubernetes/kube-state-metrics/issues/2187

Regression introduced in c3c552821a

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-09-12 09:34:14 +02:00
Kubernetes Prow Robot a7cb7f736a
Merge pull request #2184 from opeco17/feat/introduce-markdown-formatter
feat: introduce Markdown linter and formatter
2023-09-11 07:30:12 -07:00
opeco17 81e825dfea feat: introduce Markdown formatter 2023-09-11 22:41:43 +09:00
Kubernetes Prow Robot 39d76ab36b
Merge pull request #2188 from kubernetes/dependabot/github_actions/actions/checkout-4
build(deps): Bump actions/checkout from 3 to 4
2023-09-11 03:12:10 -07:00
dependabot[bot] a2cdfc048c
build(deps): Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 09:35:18 +00:00
Kubernetes Prow Robot 48038befa7
Merge pull request #2183 from mrueg/go-1.21
chore: Build with go 1.21
2023-09-07 09:52:57 -07:00
Kubernetes Prow Robot 550775b7be
Merge pull request #2182 from mrueg/kube-1.28
chore: Bump to kubernetes 1.28
2023-09-07 09:50:57 -07:00
Manuel Rüger 435aa5a06e chore: Build with go 1.21 2023-09-06 21:33:25 +02:00
Manuel Rüger 08a183414b chore: Bump to kubernetes 1.28 2023-08-31 20:21:32 +02:00
Kubernetes Prow Robot 84abaf7138
Merge pull request #2181 from kubernetes/release-2.10
chore: Merge Release 2.10 back to main
2023-08-31 11:12:48 -07:00
Kubernetes Prow Robot 25fb4fa076
Merge pull request #2176 from mrueg/prep-v2.10.0
chore: Cut v2.10.0
2023-08-31 09:54:48 -07:00
Manuel Rüger 858a7f6035 chore: Cut v2.10.0
Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-08-31 18:15:09 +02:00
Mark Robinson f3698288ff
feat: Add support for endpoint topology routing hints (#2090)
* Add support for endpoint topology routing hints

Fix goimports

Fix gocritic issue

* Update docs/endpointslice-metrics.md

Co-authored-by: Manuel Rüger <manuel@rueg.eu>

* Update internal/store/endpointslice.go

Co-authored-by: Manuel Rüger <manuel@rueg.eu>

* Update Dockerfile

* Update Dockerfile

* Update endpointslice_test.go

* Redesign metric

* Update endpointslice.go

Remove unneeded label

* Update endpointslice.go

* Update endpointslice-metrics.md

* Fix test

* Remove hostname

* Update docs/endpointslice-metrics.md

---------

Co-authored-by: Manuel Rüger <manuel@rueg.eu>
Co-authored-by: Damien Grisonnet <damien.grisonnet@epita.fr>
2023-08-31 16:33:20 +02:00
Kubernetes Prow Robot dbd456831b
Merge pull request #1988 from dfredell/main
docs: Add cli refrences to the docs around annotations and labels
2023-08-29 05:29:22 -07:00
Kubernetes Prow Robot db81be0f03
Merge pull request #2144 from opeco17/feature/kubeconfig-hot-reload
feat: hot reload kubeconfig
2023-08-29 05:07:21 -07:00
Pranshu Srivastava a379639a52
feat: Allow prefixing * paths
Allow prefixing * paths, for instance, foo_*: [foo, bar, baz], will
result in foo_baz being the key for all object resolutions under baz.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-08-29 16:44:01 +05:30
Kubernetes Prow Robot 5ce46d5f6c
Merge pull request #2067 from rexagod/colon-general-matching
feat: allow field KV general matching
2023-08-29 03:51:21 -07:00
Pranshu Srivastava e52fbce7d5
Allow field KV general matching
Currently all matching support is limited to map-list representations;
this adds support for a more general "key:value" based matching
expression for any `interface{}` field (non-map-list-like).
2023-08-29 15:02:02 +05:30
opeco17 7bf825d989 feat: hot reload kubeconfig 2023-08-29 01:19:45 +00:00
dfredell dcb8cf5b12 Add Description to all doc markdown tables. Add controlled by cli note about labels and annotations to all markdown files. 2023-08-28 14:55:01 -05:00
dfredell 66a6caecc9 Merge remote-tracking branch 'upstream/main' 2023-08-28 14:21:56 -05:00
dfredell 6bf2df6ba9 Run all docs through a markdown table formatter so they are more easily read in their text form. Used Markdown All in One in VSCode. 2023-08-28 14:14:59 -05: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
Kubernetes Prow Robot 801f8bb31c
Merge pull request #2168 from mrueg/bump-deps
build: Bump dependencies
2023-08-28 08:37:44 -07:00
Kubernetes Prow Robot 7324e7067c
Merge pull request #2175 from opeco17/feature/allow-annotations-and-labels-for-resource-quota
feat: enable metric-annotations-allowlist and metric-labels-allowlist for ResourceQuota
2023-08-28 07:13:43 -07:00
opeco17 634c04ef90 feat: enable metric-annotations-allowlist and metric-labels-allowlist for ResourceQuota 2023-08-28 13:59:14 +00:00
Kubernetes Prow Robot 6b1daa7191
Merge pull request #2166 from mrueg/fix-panic
fix: Index out of range in metrics_store.SanitizeHeaders
2023-08-25 08:24:54 -07:00
Manuel Rüger 6071db7f49 build: Fix lint 2023-08-25 12:50:58 +02:00
Manuel Rüger 2181414c8d build: Bump dependencies 2023-08-25 12:26:29 +02:00
Manuel Rüger 1536c720f7 fix: Index out of range in metrics_store.SanitizeHeaders
2023-08-24T18:08:21.796778057Z 2023/08/24 18:08:21 http: panic serving ip:port: runtime error: index out of range [0] with length 0
2023-08-24T18:08:21.796814387Z goroutine 589687 [running]:
2023-08-24T18:08:21.796823334Z net/http.(*conn).serve.func1()
2023-08-24T18:08:21.796830520Z  /usr/local/go/src/net/http/server.go:1854 +0xbf
2023-08-24T18:08:21.796838117Z panic({0x19c2060, 0xc0043060a8})
2023-08-24T18:08:21.796844764Z  /usr/local/go/src/runtime/panic.go:890 +0x263
2023-08-24T18:08:21.796852064Z k8s.io/kube-state-metrics/v2/pkg/metrics_store.SanitizeHeaders(...)
2023-08-24T18:08:21.796858974Z  /root/go/src/k8s.io/kube-state-metrics/pkg/metrics_store/metrics_writer.go:94
2023-08-24T18:08:21.796866007Z k8s.io/kube-state-metrics/v2/pkg/metricshandler.(*MetricsHandler).ServeHTTP(0xc000221490, {0x1d425a0, 0xc005872700}, 0xc003f9d300)
2023-08-24T18:08:21.796873054Z  /root/go/src/k8s.io/kube-state-metrics/pkg/metricshandler/metrics_handler.go:211 +0x8fe
...

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-08-24 20:27:55 +02:00
Kubernetes Prow Robot e3dd5ff151
Merge pull request #2164 from dgrisonnet/allowlist-doc
docs: Update labels and annotations allowlist
2023-08-24 00:54:34 -07:00
Damien Grisonnet 6f7269858d options: update labels/annotations allowlist doc
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-08-23 11:42:31 +02:00
Kubernetes Prow Robot e8272ced47
Merge pull request #2145 from opeco17/feature/disable-labels-annotations-metrics-by-default
feat: disable labels and annotations metrics when metric-annotations-…
2023-08-22 06:34:54 -07:00
Kubernetes Prow Robot 109413e35b
Merge pull request #2148 from opeco17/feature/implement-pod-initialized-time
feat: implement kube_pod_status_initialized_time
2023-08-22 06:12:55 -07:00
Kubernetes Prow Robot 95f4ad2417
Merge pull request #2163 from adberger/main
fix(customresourcestate): typo in Error message
2023-08-22 06:02:55 -07:00
Adrian Berger 3070acb507
fix(customresourcestate): typo in Error message
Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
2023-08-22 12:32:23 +00:00
dfredell b1991d6d97 Merge remote-tracking branch 'upstream/main' 2023-08-21 12:51:46 -05:00
Kubernetes Prow Robot 60d4c4e082
Merge pull request #2140 from chihshenghuang/fix-guage-value-func-panic
fix: Don't crash on non-existent valueFrom path values
2023-08-21 07:07:23 -07:00
Kubernetes Prow Robot 570970378e
Merge pull request #2151 from david-martin/non-map-array-example
docs:  Add example for non map Arrays
2023-08-20 23:47:23 -07:00
chihshenghuang 44333795fe fix non-existent valueFrom path value throw panic error issue 2023-08-20 10:23:14 -07:00
Kubernetes Prow Robot 7ab061282d
Merge pull request #2157 from chrischdi/pr-info-no-suffix-spam
fix: custommetrics: log no _info suffix in name only once per reading the configuration
2023-08-18 11:28:28 -07:00
Christian Schlotter 59860ab904
feat(customresource) log no _info suffix in name only once per reading the configuration 2023-08-18 17:57:44 +02: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
David Martin c1d57de772
Add example for non map Arrays 2023-08-17 14:11:48 +01:00
Kubernetes Prow Robot aff4d97715
Merge pull request #2134 from machadovilaca/add-volume-mod-to-pvc-info-metric
feat: add volumemode to PVC info metric
2023-08-17 02:49:23 -07:00
opeco17 6de105ebbe feat: disable labels and annotations metrics when metric-annotations-allowlist and metric-labels-allowlist are not provided 2023-08-14 14:38:23 +00:00
opeco17 3e4d91c4ba feat: implement kube_pod_status_initialized_time 2023-08-14 14:01:34 +00:00
João Vilaça 0d45f1adf2 Update docs
Signed-off-by: João Vilaça <jvilaca@redhat.com>
2023-08-14 11:09:34 +01:00
Kubernetes Prow Robot a9bdda09b9
Merge pull request #2139 from kubernetes/dependabot/go_modules/k8s.io/sample-controller-0.27.4
build(deps): Bump k8s.io/sample-controller from 0.27.3 to 0.27.4
2023-08-08 10:56:15 -07:00
dependabot[bot] d97275796b
build(deps): Bump k8s.io/sample-controller from 0.27.3 to 0.27.4
Bumps [k8s.io/sample-controller](https://github.com/kubernetes/sample-controller) from 0.27.3 to 0.27.4.
- [Commits](https://github.com/kubernetes/sample-controller/compare/v0.27.3...v0.27.4)

---
updated-dependencies:
- dependency-name: k8s.io/sample-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-08 17:20:09 +00:00
Kubernetes Prow Robot 6bc0cc33fc
Merge pull request #2136 from kubernetes/dependabot/go_modules/k8s.io/component-base-0.27.4
build(deps): Bump k8s.io/component-base from 0.27.3 to 0.27.4
2023-08-08 10:18:16 -07:00
dependabot[bot] 73253a6f1c
build(deps): Bump k8s.io/component-base from 0.27.3 to 0.27.4
Bumps [k8s.io/component-base](https://github.com/kubernetes/component-base) from 0.27.3 to 0.27.4.
- [Commits](https://github.com/kubernetes/component-base/compare/v0.27.3...v0.27.4)

---
updated-dependencies:
- dependency-name: k8s.io/component-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-08 16:39:39 +00:00
Kubernetes Prow Robot c6f4a9014f
Merge pull request #2128 from mrueg/add-dependabot
chore: Add dependabot config
2023-08-08 09:38:16 -07:00
Manuel Rüger 0974832307 chore: Add dependabot config
To check and update go.mod and github actions on a weekly base
2023-08-08 11:19:32 +02:00
João Vilaça 92858f325e feat: add volumemode to PVC info metric
Signed-off-by: João Vilaça <jvilaca@redhat.com>
2023-08-01 12:48:10 +01:00
Kubernetes Prow Robot 02417fbc99
Merge pull request #2127 from mrueg/update-security-contacts-v2
chore: Sync security contacts with approvers
2023-07-26 19:54:10 -07:00
Kubernetes Prow Robot 56a3a0a64e
Merge pull request #2096 from swarup-stripe/add-SA-to-kube-pod-info
feat: Adds new metric `kube_pod_service_account`
2023-07-26 03:54:18 -07:00
Kubernetes Prow Robot 7189f3938f
Merge pull request #2075 from maxime1907/featpvdeletiontimestamp
feat(pv): support kube_persistentvolume_deletion_timestamp
2023-07-26 03:52:18 -07:00
Kubernetes Prow Robot 217acfcadc
Merge pull request #2074 from maxime1907/featpvcdeletiontimestamp
feat(pvc): support kube_persistentvolumeclaim_deletion_timestamp
2023-07-26 03:50:19 -07:00
Kubernetes Prow Robot 61c9de04cd
Merge pull request #2114 from dgrisonnet/webhook-services
feat: Add webhooks client config service metrics
2023-07-26 03:42:18 -07:00
Kubernetes Prow Robot 71e099bfb7
Merge pull request #2122 from ntoofu/fix-2121
fix: Add filtering for Lease metrics
2023-07-26 03:40:17 -07:00
Manuel Rüger 38c9ed6292 chore: Sync security contacts with approvers
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-07-26 12:19:32 +02:00
Kubernetes Prow Robot 89c1bc3be8
Merge pull request #2126 from fpetkovski/remove-fpetkovski-maintainer
chore: Remove myself from maintainers
2023-07-25 12:59:56 -07:00
fpetkovski dc679e1b3a chore: Remove myself from maintainers
I will be removing myself from the maintainers role due to
available time to work on KSM.

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
2023-07-25 14:34:31 +02:00
ntoofu dc79b3e927 Add filtering for Lease metrics 2023-07-21 04:18:10 +09:00
Kubernetes Prow Robot 3fb1e86c18
Merge pull request #2105 from mrueg/update-deps-0623
chore: Update dependencies
2023-07-13 02:08:08 -07:00
Kubernetes Prow Robot a24fecc5cd
Merge pull request #2112 from mrueg/use-caching
build: Reorder CI steps to use go mod cache
2023-07-13 01:48:08 -07:00
Manuel Rüger c3c552821a chore: Fix lint
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-07-13 10:35:24 +02:00
Manuel Rüger b4535b3b23 Fix govulncheck 2023-07-13 10:35:24 +02:00
Manuel Rüger 5f79e4fde0 chore: Update dependencies
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-07-13 10:35:24 +02:00
Damien Grisonnet 229befd41d *: add webhooks client config service metrics
In order to better identify, prioritize, and debug webhook latency
issues it is important to have a metric that would point to the resource
it is responsible for.  However, it is not possible to have that
dimension in the metrics exposed by Kubernetes because of the unbound
cardinality that such a label would have.

The name of the webhook could be an alternative since it usually
contains some information about the resource that the webhook targets,
however this is not very practical to use in multi-tenants
environments.

A solution for these kind of platform is to tie a specific webhook to a
namespace in order to be able to know which tenant manages it and take
actions depending on that. This is achieveable by leveraging the client
config information of webhooks configured via WebhookConfiguration
resources since Services are namespaced objects.

With these new metrics, users will be able to split the alerting
severity of webhook latency / rejection rate per namespace on top of
being able to do it based on the webhook name. This is key in
environment where administrators don't have control over the webhooks
installed by the various tenants.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-07-04 18:20:34 +02:00
Manuel Rüger 1cd78c708a build: Reorder CI steps to use go mod cache 2023-07-03 15:04:56 +02:00
Kubernetes Prow Robot bb6e9f42f8
Merge pull request #2106 from mrueg/doc-crs
docs: Document RBAC and remove outdated info
2023-06-28 10:46:35 -07:00
Manuel Rüger b4b609481d docs: Document RBAC and remove outdated info
Adds a paragraph on RBAC and removes the outdated information on setting
the customresource in the --resources flag.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-06-28 14:27:04 +02:00
Kubernetes Prow Robot 3a5c76d8b8
Merge pull request #2101 from CatherineF-dev/patch-2
docs: update multi-arch version to v2.9.2 in README.md
2023-06-24 23:03:09 -07:00
CatherineF-dev 1879a13b1b
Update multi-arch version to v2.9.2 in README.md 2023-06-24 07:52:09 -04:00
Maxime Leroy c0eb61aeeb feat(pvc): support kube_persistentvolumeclaim_deletion_timestamp
Signed-off-by: Maxime Leroy <19607336+maxime1907@users.noreply.github.com>
2023-06-16 10:46:34 +02:00
Maxime Leroy 2be0d9e34c feat(pv): support kube_persistentvolume_deletion_timestamp
Signed-off-by: Maxime Leroy <19607336+maxime1907@users.noreply.github.com>
2023-06-16 10:42:52 +02:00
Kubernetes Prow Robot 3d46fe0f72
Merge pull request #1990 from mrueg/add-semantic-pr
feat: Enable semantic commit messages
2023-06-13 08:19:59 -07:00
Swarup Srinivasan 8a8b7b47fc add new metric kube_pod_service_account 2023-06-13 11:19:01 -04:00
Kubernetes Prow Robot 31d6e8fc26
Merge pull request #2089 from venkatbvc/gocylo_incremental_fix
Fix cyclomatic complexity in KSM files
2023-06-05 08:37:29 -07:00
Rao, B V Chalapathi 1e8b10d7bb Fix cyclo complexity in horizontalpodautoscaler file function is hpaMetricFamilies 2023-06-01 18:57:24 +05:30
Kubernetes Prow Robot 32cc599309
Merge pull request #2087 from mrueg/k8s-1.27
go.mod: Bump to k8s 1.27.x
2023-05-31 07:07:44 -07:00
Manuel Rüger 17b3343d46 chore: Bump to kubernetes 1.27.x 2023-05-31 14:17:20 +02:00
Kubernetes Prow Robot 122658ea5e
Merge pull request #2082 from kubernetes/release-2.9
Sync `main` with `release-2.9`
2023-05-31 04:59:46 -07:00
Kubernetes Prow Robot 93fe0be5e6
Merge pull request #2084 from rexagod/prep-2.9.2
*: Cut v2.9.2
2023-05-31 02:17:46 -07:00
Pranshu Srivastava 697abd36ed
*: Cut v2.9.2 2023-05-30 20:58:12 +05:30
Kubernetes Prow Robot fe5e38f0fe
Merge pull request #2083 from mrueg/cloudbuild
Increase timeout and update cloudbuild image
2023-05-26 23:30:49 -07:00
Manuel Rüger 4de59b3189 Increase timeout and update cloudbuild image 2023-05-27 08:20:19 +02:00
Kubernetes Prow Robot 95a5c8d06d
Merge pull request #2077 from rexagod/prep-v2.9.0
*: Cut v2.9.0 release
2023-05-23 10:20:27 -07:00
Pranshu Srivastava 4a57755660
*: Cut v2.9.0 release
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-05-23 22:28:18 +05:30
Kubernetes Prow Robot ecf921cd4f
Merge pull request #2076 from mrueg/bump-deps-for-release
chore: Bump dependencies for next release
2023-05-22 11:58:20 -07:00
Manuel Rüger b0fe5f9a1d chore: Bump dependencies for next release 2023-05-22 15:55:43 +02:00
Kubernetes Prow Robot 42e7742cae
Merge pull request #2073 from A-Hilaly/lease-renew-time-labels
Add namespace label to `kube_lease_renew_time`
2023-05-19 23:52:18 -07:00
Amine 379d9a56a7 Add namespace label to `kube_lease_renew_time`
This patch adds the namespace label to the `kube_lease_renew_time` and
updates unit tests to validate the changes.

Fixes github.com/kubernetes/kube-state-metrics
2023-05-19 22:02:54 -05:00
Kubernetes Prow Robot 5010c4a282
Merge pull request #1851 from rexagod/1848
Allow optional VK in CR metrics
2023-05-19 12:56:17 -07: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
Kubernetes Prow Robot 5e4cd5495c
Merge pull request #2072 from CatherineF-dev/patch-1
Update README on listing multi architecture images
2023-05-19 06:54:31 -07:00
CatherineF-dev 258c62a87b
Update README on listing multi architecture images 2023-05-19 08:38:09 -04:00
Kubernetes Prow Robot 3b95dd1cf0
Merge pull request #2058 from jkroepke/multi-cluster
Implement multi-cluster alerts
2023-05-12 06:21:02 -07:00
Kubernetes Prow Robot 5f31736e44
Merge pull request #2063 from askulkarni2/chore/deprecate-kubernetes-release-url
Use dl.k8s.io instead of kubernetes-release bucket
2023-05-11 10:03:04 -07:00
Apoorva Kulkarni 723b0faefa
add redirect to the curl command 2023-05-11 05:58:40 -07:00
Apoorva Kulkarni 205e19eed4
Use dl.k8s.io instead of hardcoded GCS URIs 2023-05-10 16:16:23 -07:00
Kubernetes Prow Robot 76efe2d354
Merge pull request #2061 from mrueg/update-deps-05
Update dependencies
2023-05-10 10:41:02 -07:00
Manuel Rüger dae63b9b57 Update dependencies 2023-05-09 17:32:12 +02:00
Kubernetes Prow Robot eb45f33a1e
Merge pull request #2056 from RamakrishnanArun/cvefix/1.20.3
Update go version to 1.20.4
2023-05-05 07:17:13 -07:00
Arun Ramakrishnan 847d6c8d2c Move to 1.20.4 2023-05-05 10:05:11 -04:00
Jan-Otto Kröpke 7c7a9ceb52
Implement multi-cluster alerts 2023-05-04 23:38:07 +02:00
Kubernetes Prow Robot 32f8c5e805
Merge pull request #2048 from murphd40/2047
2047: Add LabelsFromPath functionality to Info metrics
2023-04-26 06:06:14 -07:00
Kubernetes Prow Robot b3157f78de
Merge pull request #2004 from rexagod/fix-star-path-labels
Adhere to OTel-Prometheus standard for labels
2023-04-26 05:52:13 -07:00
Pranshu Srivastava b382da615a
Adhere to OTel-Prometheus standard for labels
Adhere to OTel-Prometheus standard for generated labels in CRS.

Ref.: 8946dfc6a2/specification/compatibility/prometheus_and_openmetrics.md?plain=1#L224-L229
Additional info.: OSM has a hardcoded approach for doing this right now: https://github.com/openshift/openshift-state-metrics/blob/master/pkg/collectors/utils.go#L29

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-04-22 19:45:48 +05:30
David Murphy d16935b3df
2047: Add LabelsFromPath functionality to Info metrics 2023-04-14 23:05:00 +01:00
Kubernetes Prow Robot 168254d64c
Merge pull request #2046 from juanjjaramillo/juanjjaramillo/fix_job_failure_reason
Fix casing while scraping failure reason for `kube_job_status_failed`
2023-04-14 10:18:41 -07:00
Juan Jose Jaramillo d9572ac392 Map exact value provided but update value to match the correct casing 2023-04-14 09:47:58 -07:00
Juan Jose Jaramillo 2990fd50f2 Ignore casing while scraping failure reason for `kube_job_status_failed` 2023-04-13 14:04:22 -07:00
Kubernetes Prow Robot e3d99ba7cf
Merge pull request #2042 from jcpunk/pss-restricted
Add parameters for PodSecurity restricted
2023-04-11 09:01:08 -07:00
Pat Riehecky b23f04078c Add parameters for PodSecurity restricted
Signed-off-by: Pat Riehecky <riehecky@fnal.gov>
2023-04-11 09:29:41 -05:00
Kubernetes Prow Robot 4efc9d1f86
Merge pull request #2034 from mrueg/landingpage
feat: Use exporter-toolkit landingpage
2023-03-30 08:51:49 -07:00
Kubernetes Prow Robot e58139d646
Merge pull request #2038 from mrueg/gh-checkout-gov4
.github: Use actions/setup-go@v4
2023-03-29 09:27:48 -07:00
Manuel Rüger 0d17918968 .github: Use actions/setup-go@v4
https://github.com/actions/setup-go/releases/tag/v4.0.0
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-03-29 11:00:01 +02:00
Kubernetes Prow Robot fa940a8b7f
Merge pull request #2037 from mrueg/fix-2036
fix: Use correct writer
2023-03-27 09:10:28 -07:00
Manuel Rüger aebe4103f8 fix: Use correct writer
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-03-27 17:22:31 +02:00
Kubernetes Prow Robot 6eadca823e
Merge pull request #1873 from CatherineF-dev/daemonset-sharding-example
docs: Daemonset sharding example
2023-03-21 23:06:36 -07:00
Catherine Fang 5fae5968ac daemonset-sharding-example 2023-03-21 20:37:36 -04:00
Kubernetes Prow Robot 8fe5180dfc
Merge pull request #2033 from mrueg/merge-2.8.2-to-main
Update changelog for v2.8.2 in main
2023-03-21 05:19:07 -07:00
Manuel Rüger 1529d94ec8 feat: Use exporter-toolkit landingpage
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-03-17 19:15:05 +01:00
Manuel Rüger 9254f7e0df *: Cut v2.8.2 2023-03-17 14:08:32 +01:00
Kubernetes Prow Robot b76e410ec1
Merge pull request #2017 from mrueg/rm-vpa
feat!: Remove VerticalPodAutoscaler
2023-03-16 06:45:22 -07:00
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
Kubernetes Prow Robot 6c80e5b227
Merge pull request #2030 from mrueg/add-maintainers
doc: Describe the process to become a maintainer
2023-03-16 05:23:22 -07:00
Manuel Rüger a96d0b59a3 doc: Describe the process to become a maintainer
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-03-16 13:04:34 +01:00
Kubernetes Prow Robot a577a59470
Merge pull request #2024 from CatherineF-dev/set-contentType
Only use OpenMetrics and Text in contentType
2023-03-16 02:03:17 -07:00
Kubernetes Prow Robot b11ec2b306
Merge pull request #2018 from arturhoo/patch-1
Improve wording for Prometheus rule example in pod-metrics
2023-03-16 02:01:18 -07:00
CatherineF-dev d46edde08b Update pkg/metricshandler/metrics_handler.go
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2023-03-14 10:15:49 -04:00
Kubernetes Prow Robot 999f97146e
Merge pull request #2003 from mrueg/go-1.20
build: Build with go 1.20.1
2023-03-13 16:12:33 -07:00
Kubernetes Prow Robot 12027146b9
Merge pull request #1959 from pwschuurman/kep-3335-beta-metrics
Add StatefulSet Start Ordinal metrics for KEP-3335
2023-03-13 14:42:47 -07:00
Manuel Rüger aa5860ef21 build: Build with go 1.20.2
Also bump prometheus and golang dependencies

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2023-03-13 21:14:17 +01:00
Peter Schuurman 56d6c68818 Fix indentation formatting for test WANT stanza in statefulset_test.go 2023-03-13 12:11:51 -07:00
Peter Schuurman 39c66ee248 Add gauge implementation of kube_statefulset_ordinals_start 2023-03-13 12:11:51 -07:00
Peter Schuurman 686f858370 Add StatefulSet Start Ordinal metrics for KEP-3335 2023-03-13 12:11:51 -07:00
Catherine Fang a3bd5d52ff Only use OpenMetrics and Text in contentType 2023-03-13 12:57:18 -04:00
Artur Rodrigues a1a9eda1c8
Clarify pod status in useful queries
Signed-off-by: Artur Rodrigues <artur.rodrigues@lacework.net>
2023-03-13 12:29:07 +00:00
Kubernetes Prow Robot fecc78fb19
Merge pull request #2021 from arturhoo/bump-golangci-lint-version
Update golangci-lint version to 1.51.2
2023-03-13 03:42:45 -07:00
Artur Rodrigues acea5dfb6d
Update golangci-lint version 2023-03-13 08:59:35 +00:00
Kubernetes Prow Robot 054f2a4e71
Merge pull request #1989 from mrueg/crs-support-quantity
feat(CustomResourceState): Support quantities and percentages
2023-03-01 11:17:17 -08:00
Manuel Rüger d799f4038b feat(customresourcestate): Support percentages 2023-03-01 19:14:09 +01:00
Manuel Rüger 26950a49fc feat(CustomResourceState): Support quantities 2023-03-01 19:13:00 +01:00
dfredell 417e9c9eac Add cli refrences to the docs around annotations and labels 2023-02-24 12:25:09 -06:00
Kubernetes Prow Robot 3a7e617949
Merge pull request #2007 from rexagod/fix-label-resolution-maps
Fix label resolution for maps
2023-02-23 09:47:35 -08:00
Kubernetes Prow Robot da0bcebab9
Merge pull request #2008 from rexagod/add-rexagod-as-approver
Add `rexagod` to approvers
2023-02-23 03:37:34 -08:00
Pranshu Srivastava 6c286e0f5f
Add `rexagod` to approvers
Based on the nomination proposed on the Slack channel (thanks, Manuel!).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-02-23 16:50:50 +05:30
Pranshu Srivastava 3f0532bc50
Fix label resolution for maps
The `map[string]interface{}` resolution searched for values within various nested fields, but not the relative path itself.

Ref.: ca1da6b22e/pkg/customresourcestate/registry_factory.go (L603)

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-02-23 00:15:37 +05:30
Kubernetes Prow Robot ca1da6b22e
Merge pull request #2002 from mrueg/prep-v2.8.1
Prepare bug fix release v2.8.1
2023-02-22 03:31:56 -08:00
Manuel Rüger f6f119c1bf *: Cut v2.8.1 2023-02-20 12:12:49 +01:00
Manuel Rüger 2d4579e31d build: Bump to go 1.19.6 2023-02-20 12:05:50 +01:00
Pranshu Srivastava 08c4765d5f fixup! Don't crash on non-existent path values 2023-02-20 12:05:50 +01:00
Pranshu Srivastava 63d2138ee4 Don't crash on non-existent path values
Don't crash on non-existent path values in CRS.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-02-20 12:05:50 +01:00
Cedric Lamoriniere b06d352d05 fix: public Builder compatibility with the BuilderInterface 2023-02-20 12:05:31 +01:00
Kubernetes Prow Robot 91c09d0a96
Merge pull request #2001 from mrueg/go-1.19.6
build: Bump to go 1.19.6
2023-02-20 03:01:49 -08:00
Manuel Rüger ebb47002a2 build: Bump to go 1.19.6 2023-02-17 21:35:23 +01:00
Kubernetes Prow Robot eb6358ea82
Merge pull request #2000 from edwardmlyte/main
Correct link for customising kube prometheus
2023-02-17 06:22:04 -08:00
Kubernetes Prow Robot d498cab7c6
Merge pull request #1998 from rexagod/1992
Don't crash on non-existent path values
2023-02-17 06:20:04 -08:00
Pranshu Srivastava b54e43d555
fixup! Don't crash on non-existent path values 2023-02-17 18:12:22 +05:30
Edward Maxwell-Lyte 8869f9a535
Correct link for customising kube prometheus
Original page moved location.
2023-02-17 09:27:31 +00:00
Pranshu Srivastava c493044e4a
Don't crash on non-existent path values
Don't crash on non-existent path values in CRS.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2023-02-17 00:07:53 +05:30
Kubernetes Prow Robot da10923ae1
Merge pull request #1994 from clamoriniere/fix-builder-interface
fix: public Builder compatibility with the BuilderInterface
2023-02-16 05:29:39 -08:00
Cedric Lamoriniere bcfef5a9ca
fix: public Builder compatibility with the BuilderInterface 2023-02-15 13:04:55 +01:00
Manuel Rüger db94c08005 chore: Update CONTRIBUTING.md
Co-authored-by: Mario Constanti <github@constanti.de>
2023-02-14 09:37:23 +01:00
Manuel Rüger f5f648ac24 feat: Enable semantic commit messages 2023-02-10 17:00:02 +01:00
Kubernetes Prow Robot 1acb4dfdac
Merge pull request #1986 from kubernetes/release-2.8
Merge Release 2.8.0 back to main
2023-02-09 22:41:30 -08:00
Kubernetes Prow Robot 2fd22c42ed
Merge pull request #1967 from mrueg/prep-v2.8.0
Prepare v2.8.0
2023-02-09 11:00:18 -08:00
Manuel Rüger 61b78ce3fc *: Cut v2.8.0 2023-02-09 19:42:18 +01:00
Manuel Rüger 53748191a6 go.mod: Update dependencies 2023-02-09 17:28:33 +01:00
Kubernetes Prow Robot 757055d223
Merge pull request #1958 from rexagod/1947
Handle unit length `valueFrom` values
2023-02-09 07:44:22 -08:00
Kubernetes Prow Robot f27c1ef251
Merge pull request #1964 from jabdoa2/patch-1
Document how gauges convert types to float
2023-02-09 04:52:25 -08:00
Manuel Rüger 8e3adcdb6e
Update docs/customresourcestate-metrics.md 2023-02-09 13:40:53 +01:00
Pranshu Srivastava 10324307bd
fixup! Handle unit length `valueFrom` values 2023-02-09 17:30:42 +05:30
Manuel Rüger a244030394
Update docs/customresourcestate-metrics.md 2023-02-09 12:50:48 +01:00
Kubernetes Prow Robot 77d09351a7
Merge pull request #1974 from mrueg/openmetrics
Set OpenMetrics content header
2023-02-09 03:18:25 -08:00
Kubernetes Prow Robot 5ec099bd98
Merge pull request #1977 from CatherineF-dev/clean-up-NewFamilyGenerator
Clean up function NewFamilyGenerator in comments
2023-02-07 07:59:01 -08:00
Catherine Fang 4210d5081e Clean up NewFamilyGenerator in comments 2023-02-06 20:45:54 -05:00
Kubernetes Prow Robot 86bf8f2803
Merge pull request #1971 from ryanrolds/rolds/bug_fix_pod_container_ready_time
Fixing emitting of ready time metrics when condition is false
2023-02-06 09:31:00 -08:00
Kubernetes Prow Robot c530a7bf9c
Merge pull request #1976 from CatherineF-dev/force-adding-metric-stability
Migrate all NewFamilyGenerator to NewFamilyGeneratorWithStability
2023-02-06 09:29:02 -08:00
Catherine Fang 4342ca7b97 Migrate all NewFamilyGenerator to NewFamilyGeneratorWithStability 2023-02-05 22:02:47 -05:00
Manuel Rüger 49af6b3945 Set OpenMetrics content header
See: https://github.com/prometheus/common/blob/main/expfmt/encode.go#L86

See: https://github.com/kubernetes/kube-state-metrics/issues/1973
2023-02-05 19:40:12 +01:00
Kubernetes Prow Robot 5da24c250f
Merge pull request #1963 from jabdoa2/support_string_bool_in_custom_resource_state
support "True" and "False" as string in custom-resource-state
2023-02-02 06:27:29 -08:00
Kubernetes Prow Robot 5250ea4cc5
Merge pull request #1965 from mrueg/convert-structure-logging
Use structured logging
2023-02-01 09:53:06 -08:00
Ryan R. Olds 67ed488ba8 Fixing emitting of ready time metrics when condition is false 2023-01-31 13:29:26 -08:00
Manuel Rüger fa5346405a Use structured logging 2023-01-27 17:35:26 +01:00
jabdoa2 24e2665a0b
Improve formating 2023-01-27 16:06:06 +01:00
jabdoa2 c0bd852949
Document how gauges convert types to float 2023-01-27 16:02:54 +01:00
Kubernetes Prow Robot 90f58ce055
Merge pull request #1957 from mrueg/tools-go-mod
tools: Use own go.mod
2023-01-26 11:14:25 -08:00
Manuel Rüger db21b96de3 Improve command to install tools 2023-01-26 20:06:04 +01:00
Kubernetes Prow Robot 5e293b2795
Merge pull request #1960 from mrueg/useragent
Enrich UserAgent with more information
2023-01-26 10:00:26 -08:00
Jan Kantert e26d682408 lowercase string and simplify logic
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2023-01-26 17:56:29 +01:00
Jan Kantert 2b5460f0c2 support "True" and "False" as string in custom-resource-state for operator status conditions 2023-01-26 17:28:13 +01:00
Kubernetes Prow Robot bc7b5b6cf8
Merge pull request #1956 from bjorand/version_flag
remove broken --version flag, replace by version command
2023-01-24 01:52:17 -08:00
Pranshu Srivastava bd2ea7a6f8
Handle unit length `valueFrom` values
Handle unit length `valueFrom` values and skip strings where we expect
them to be type-cast-able to `float64`, instead of erroring, since that
is the expected behavior, and what's being done for other types.
2023-01-24 14:44:38 +05:30
Manuel Rüger b41d5caa46 Enhance UserAgent with more information
Before:
"User-Agent: v2.7.0"

After:
"User-Agent: kube-state-metrics/v2.7.0 (linux/amd64) kubernetes/1cda0bf9"
2023-01-23 14:12:02 +01:00
Benjamin Jorand 57a196b56c update doc 2023-01-23 13:51:29 +01:00
Benjamin Jorand d72db6921c remove unwanted change 2023-01-23 13:25:07 +01:00
Benjamin Jorand ca7bc253b0 clean broken --version flag 2023-01-23 13:24:01 +01:00
Manuel Rüger 482ad311db tools: Use own go.mod
This reduces the number of deps that will be fetched for building ksm
2023-01-20 09:45:47 +01:00
Kubernetes Prow Robot 1cda0bf92e
Merge pull request #1938 from ryanrolds/rolds/pod_ready_time
Add metrics of kube_pod_status_ready_time and kube_pod_status_containers_ready_time redux
2023-01-19 05:28:35 -08:00
Ryan R. Olds ad5a7acf45 Added a test for kube_pod_status_container_ready_time 2023-01-18 16:23:44 -08:00
Benjamin Jorand 689a1f5f4f fix --version flag 2023-01-18 21:21:11 +01:00
Kubernetes Prow Robot c752152030
Merge pull request #1875 from CatherineF-dev/update-develop-doc
Update development doc
2023-01-16 13:16:10 -08:00
Catherine Fang 5b6ea714f5 Update development guide 2023-01-16 16:05:17 -05:00
Kubernetes Prow Robot 63db4839e9
Merge pull request #1928 from mrueg/hotreloading-crs
Reload CustomResourceState Config File on Change
2023-01-12 06:16:54 -08:00
Kubernetes Prow Robot b7a7070e87
Merge pull request #1942 from bavarianbidi/prefix_gvk_labels_in_customresourcemonitoring
prefix GVK labels in CustomResourceMonitoring
2023-01-12 00:58:54 -08:00
Ryan R. Olds 59b1728783 Merge branch 'main' into rolds/pod_ready_time 2023-01-10 16:26:17 -08:00
Ryan R. Olds dd7202bdc2 Fixing bad merge in rebase 2023-01-10 16:13:18 -08:00
Ryan Olds 0e4e396e34 Addressed feedback 2023-01-10 16:04:31 -08:00
Lan Liang 4d8c58ad00 Support pod_ready_time and pod_container_ready_time
Co-authored-by: Szymon Grzemski <sz.grzemski@gmail.com>
Signed-off-by: Lan Liang <gcslyp@gmail.com>
2023-01-10 16:04:03 -08:00
Kubernetes Prow Robot 559bb28d6f
Merge pull request #1932 from frezes/feat/addPodStatusQosClass
Add kube_pod_status_qos_class gauge to pod metrics
2023-01-10 11:53:26 -08:00
Mario Constanti 488c0bcf59 update crd monitoring and mention new flags 2023-01-10 13:51:04 +01:00
Mario Constanti 771f85c457 fix vpa crd metric names 2023-01-10 13:50:43 +01:00
Mario Constanti b410166471 replace kube_crd with kube_customresource in docs
Signed-off-by: Mario Constanti <mario@constanti.de>
2023-01-10 13:31:51 +01:00
Manuel Rüger 06268ab5ef Reload CustomResourceState Config File on Change
This change adds hot reloading support for the customresourcestate
config file.

It also resolves a bug in which the customresourcestate config file was
included in the ksm config file, in which it did not get detected.

It also resolves a bug in which customresourcestatemetrics were not
added when set resources were non-default resources.

Fixes: https://github.com/kubernetes/kube-state-metrics/issues/1892
2023-01-09 17:32:09 +01:00
Mario Constanti 7130bd0d2b prefix GVK labels in CustomResourceMonitoring
This will prefix the auto-generated GVK labels for CustomResources with
customresource_ to make it a bit more clear that these labels got generated.

Signed-off-by: Mario Constanti <mario@constanti.de>
2023-01-09 15:07:37 +01:00
Kubernetes Prow Robot ef627d6a1f
Merge pull request #1945 from yosshi825/fix/typo
docs:fix broken link
2023-01-05 23:07:58 -08:00
yosshi825 b2fba10843 docs:fix link 2023-01-06 15:18:33 +09:00
Kubernetes Prow Robot 71200632a6
Merge pull request #1944 from grzesuav/typo
docs: Fix typo in kube_node_deletion_timestamp description
2023-01-03 10:07:32 -08:00
Grzegorz Głąb 3ca8765a38 docs: Fix typo in kube_node_deletion_timestamp description
Signed-off-by: Grzegorz Głąb <grzesuav@gmail.com>
2023-01-03 18:42:43 +01:00
frezes c3004c6145 Change kube_pod_status_qos_class to experimental metric
Signed-off-by: frezes <zhangjunhao@kubesphere.io>
2023-01-03 14:25:39 +08:00
Kubernetes Prow Robot f1288f943a
Merge pull request #1936 from CatherineF-dev/update-develop-doc-2
Add develop doc on adding new metrics
2022-12-21 09:23:25 -08:00
CatherineF-dev 022fce9d9b
Update docs/developer/guide.md
Co-authored-by: Pranshu Srivastava <prasriva@redhat.com>
2022-12-21 09:34:40 -05:00
Catherine Fang 62f3fc2983 Add develop doc on adding new metrics 2022-12-20 13:17:54 -05:00
Kubernetes Prow Robot d9677c09fb
Merge pull request #1930 from rexagod/1886
Make CRS metrics type dynamic
2022-12-15 04:17:36 -08:00
Pranshu Srivastava 02fd1a9c18
Make CRS metrics type dynamic
All CRS metrics are hardcoded to "gauge" type, this patch addresses
that.
2022-12-15 16:14:49 +05:30
Kubernetes Prow Robot 4ef27523a2
Merge pull request #1933 from mrueg/bump-deps-12
Bump dependencies and linter
2022-12-14 10:11:35 -08:00
Manuel Rüger 0955db8399 .github: Bump golangci-lint to 1.50.1 2022-12-13 00:00:26 +01:00
Manuel Rüger 89403d239a go.mod: Bump to kubernetes 1.26.0 2022-12-12 23:50:14 +01:00
Manuel Rüger 97b7e41f94 Makefile: Bump to prometheus 2.40.6 2022-12-12 23:48:54 +01:00
Manuel Rüger 28052175ab Makefile: Bump to go 1.19.4 2022-12-12 23:48:54 +01:00
Kubernetes Prow Robot 5d6cb39117
Merge pull request #1931 from mrueg/update-branch-name
Rename references from master to main branch
2022-12-12 06:03:35 -08:00
frezes 288718a71f Add kube_pod_status_qos_class gauge to pod metrics
Signed-off-by: frezes <zhangjunhao@kubesphere.io>
2022-12-12 17:38:37 +08:00
Manuel Rüger 01062d5186 Rename references from master to main branch 2022-12-11 19:13:31 +01:00
Kubernetes Prow Robot f01ce58a30
Merge pull request #1924 from rexagod/foo-bar-baz-que
docs: add status badge for the periodic cronjob
2022-12-09 22:17:40 -08:00
Pranshu Srivastava 2849d59668
docs: add status badge for the periodic cronjob
Additionally, rename it to a more fitting name.
2022-12-10 11:34:57 +05:30
Kubernetes Prow Robot 448becbe8d
Merge pull request #1926 from mrueg/crs-config-metrics
Add metrics for CustomResource State Config file
2022-12-08 07:34:24 -08:00
Manuel Rüger eb3bdbcb58 Add metrics for CustomResourceConfig file 2022-12-08 09:39:17 +01:00
Kubernetes Prow Robot 143f94d579
Merge pull request #1916 from mrueg/config-change-metrics
Add metrics for config file changes
2022-12-07 01:10:38 -08: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 fa89bc91ab pkg/metrics_store: add error handling to WriteAll
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-12-06 21:02:21 +01: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
Kubernetes Prow Robot 18d87c2557
Merge pull request #1923 from pawcykca/empty-string-for-owner-dimensions
Empty string for "owner_*" dimensions in all metrics.
2022-12-06 11:56:37 -08:00
Paweł Kubica 98583875f5
Update internal/store/persistentvolumeclaim.go
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2022-12-05 10:15:27 +01:00
Paweł Kubica 0553bf45a9 Replace special string "<none>" with empty string for "storageclass" dimension.
Returning empty string instead of special string "<none>" for "storageclass" dimensions of "kube_persistentvolumeclaim_info" metric.
2022-12-03 15:20:08 +01:00
Paweł Kubica 2c3ea01cb2 Replace "<none>" with empty string for "owner_kind", "owner_name" and "owner_is_controller" dimensions.
Returning empty string instead of "<none>" value for "owner_kind", "owner_name" and "owner_is_controller" dimensions when no metadata.ownerReferences exists in Kubernetes resoures.
2022-12-03 15:17:02 +01:00
Manuel Rüger ee891760b8 Add metrics for config file changes
This uses code pieces from prometheus/alertmanager in https://github.com/prometheus/alertmanager/blob/main/config/coordinator.go#LL56C26-L56C26
licensed under Apache-2.0.

kube_state_metrics_config_hash{type="config", filename="config.yml"} 4.0061079457904e+13
kube_state_metrics_config_last_reload_success_timestamp_seconds{type="config", filename="config.yml"} 1.6697483049487052e+09
kube_state_metrics_config_last_reload_successful{type="config",
filename="config.yml"} 1

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-12-02 15:41:57 +01:00
Kubernetes Prow Robot 44aea58610
Merge pull request #1910 from mrueg/add-endpointslices
Add Metrics for EndpointSlices
2022-12-01 09:11:56 -08:00
Kubernetes Prow Robot a406f233f4
Merge pull request #1918 from simonpasquier/bump-exporter-toolkit
Update github.com/prometheus/exporter-toolkit
2022-11-30 07:24:58 -08:00
Simon Pasquier 8b1016485a Update github.com/prometheus/exporter-toolkit
The latest version (v0.8.2) fixes CVE-2022-46146.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-11-30 15:55:51 +01:00
Kubernetes Prow Robot db20a991fc
Merge pull request #1914 from dgrisonnet/CatherineF-dev-reviewer
Add CatherineF-dev as reviewer
2022-11-29 08:13:24 -08:00
Damien Grisonnet af833dd387 Add CatherineF-dev as reviewer
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-11-29 14:47:17 +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 0cbabf9523
Merge pull request #1908 from kubernetes/release-2.7
Merge Release 2.7 back to master branch
2022-11-24 16:12:04 -08:00
Kubernetes Prow Robot abe3fd3184
Merge pull request #1896 from mrueg/prep-release-2.7
*: Cut v2.7.0
2022-11-24 08:04:05 -08:00
Manuel Rüger 095bf79b11 *: Cut v2.7.0
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-11-24 16:53:26 +01:00
Manuel Rüger 820741d4d4 go.mod: Update dependencies 2022-11-24 16:52:25 +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 df2d8f1c0e fix linter error 2022-11-24 22:50:39 +09: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
Kubernetes Prow Robot 6e28b186f8
Merge pull request #1906 from JoaoBraveCoding/1711
Start using autoscaling/v2 for HorizontalPodAutoscaler
2022-11-24 03:58:04 -08: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 07af191fe5 add stability experimental 2022-11-24 00:54:58 +09:00
Kaito Ii 278426995e add ingress classs as nondefault resource 2022-11-24 00:07:56 +09:00
Kaito Ii 4abefe268a add ingress class metrics 2022-11-23 23:16:36 +09:00
Kubernetes Prow Robot 898345f01b
Merge pull request #1900 from dgrisonnet/rexagod-reviewer
Add rexagod as reviewer
2022-11-22 22:42:14 -08:00
Damien Grisonnet cc0fd00cf7 Add rexagod as reviewer
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-11-22 11:30:48 +01:00
Kubernetes Prow Robot 3be79d55ec
Merge pull request #1894 from exitflynn/master
update kube_node_status_{capacity/allocatable} doc to clarify difference
2022-11-21 07:44:31 -08:00
Kubernetes Prow Robot 34b4660799
Merge pull request #1827 from rexagod/1738
Incorporate Viper
2022-11-17 05:04:39 -08:00
Pranshu Srivastava f8360a8903
Add end-to-end testing to verify hot-reloading
Add end-to-end testing to verify hot-reloading for event-based changes
stemming from the config file. Also,
* sent in a doc fix that was missed
earlier:
https://github.com/kubernetes/kube-state-metrics/pull/1890/files#diff-380eca5a922c0ddbf67f04daefc6823e7ef0e197434d3a826d39c7063cdfa6d6R15,
* updated fsnotify and viper dependencies (v1.6.0 and v1.14.0
  respectively).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-16 20:26:22 +05:30
Pranshu Srivastava 9860f46776
Implement hot-reloading based on config changes
Reload KSM on-the-fly when a change is detected in the configuration.

Meta changes (will squash)
2022-11-16 20:26:12 +05:30
Pranshu Srivastava 5888a7eb37
Add --config flag
--config flag defines the path to the kube-state-metrics options config file.
2022-11-16 20:26:12 +05:30
Kubernetes Prow Robot 53a0dc6c1c
Merge pull request #1890 from rexagod/1889
Add node deletionTimestamp metric
2022-11-15 22:44:47 -08:00
Pranshu Srivastava ed551af5b5
Add node deletionTimestamp metric
Adds deletionTimestamp metric, for nodes.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-16 11:49:10 +05:30
Kubernetes Prow Robot b2c90e86b6
Merge pull request #1880 from rexagod/1871-1868
Allow labelFromKey field for all applicable types
2022-11-14 11:10:41 -08:00
Kubernetes Prow Robot 9edd02b9d3
Merge pull request #1835 from rexagod/1790
Deprecate VPA
2022-11-14 10:44:41 -08:00
Akshit Tyagi 837f7473e1 update kube_node_status_{capacity/allocatable} doc to clarify difference 2022-11-14 14:57:16 +00:00
Kubernetes Prow Robot e27fb87824
Merge pull request #1834 from rexagod/1791-1-incorporate-cobra
Incorporate Cobra
2022-11-10 23:56:11 -08:00
Pranshu Srivastava b926fd968e
Incorporate Cobra
s/pflags/cobra/g:
* Use spf13/cobra to handle all flags and sub-commands.
* Remove all spf13/pflag usage, and fallback to the in-build flag
  package if, and when needed.
* Add completion support.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-10 18:25:12 +05:30
Kubernetes Prow Robot 8096b31cf3
Merge pull request #1888 from mrueg/exporter-toolkit-0.8
go.mod: Bump exporter-toolkit to 0.8.1
2022-11-10 04:16:53 -08:00
Manuel Rüger d39f1b138b go.mod: Bump exporter-toolkit to 0.8.1
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-11-10 08:00:52 +01:00
Pranshu Srivastava 3072502343
fixup! fixup! fixup! fixup! Allow `labelFromKey` field 2022-11-10 03:10:58 +05:30
Pranshu Srivastava 2279fb2695
Deprecate VPA
Deprecate VPA metrics in v2.9.0.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-10 02:13:51 +05:30
Pranshu Srivastava b9f0d8ddf9
fixup! fixup! fixup! Allow `labelFromKey` field 2022-11-09 16:49:28 +05:30
Pranshu Srivastava a1716fa39d
fixup! fixup! Allow `labelFromKey` field 2022-11-09 12:27:18 +05:30
Pranshu Srivastava 83d68c57fd
fixup! Allow `labelFromKey` field 2022-11-09 03:39:40 +05:30
Kubernetes Prow Robot dc1f1f3018
Merge pull request #1876 from mattcary/kep1847
Add retention policy metrics for KEP-1847
2022-11-08 12:58:18 -08:00
Matthew Cary b6c5667fe6 Add retention policy metrics for KEP-1847 2022-11-08 11:42:30 -08:00
Kubernetes Prow Robot c0a03ad6bb
Merge pull request #1813 from bavarianbidi/crd_only_mode
introduce custom-resources-only flag ...
2022-11-08 03:44:20 -08: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
Kubernetes Prow Robot d620e43c38
Merge pull request #1864 from CatherineF-dev/sharding-per-node
Sharding metrics per node via fieldSelector
2022-11-07 03:34:18 -08:00
Mario Constanti 53af11625c introduce custom-resources-only flag ...
... to only monitor all known custom-resource configurations instead of
listing each of them explicitly

Signed-off-by: Mario Constanti <mario@constanti.de>
2022-11-07 07:31:41 +01:00
Catherine Fang 43c6073234 Refactoring 2022-11-04 15:07:37 -04:00
CatherineF-dev 813496de4f Update README.md
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2022-11-04 13:12:53 -04:00
Kubernetes Prow Robot 0f483430c4
Merge pull request #1878 from rexagod/1858-1857
Detect vulns actually used by KSM
2022-11-04 10:04:15 -07:00
Kubernetes Prow Robot 32f08e3842
Merge pull request #1866 from logicalhan/patch-2
add myself to OWNERs
2022-11-04 08:54:14 -07:00
Pranshu Srivastava 1736469dd4
Add `govulncheck` cron
Add `govulncheck` cron configuration.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-04 18:27:07 +05:30
Catherine Fang 2f1da3af9b Provide scaling example 2022-11-04 08:44:00 -04:00
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 3b50fbcd16 Validate options 2022-11-04 08:44:00 -04:00
Catherine Fang 2c0c8d2e51 Sharding per node 2022-11-04 08:44:00 -04:00
Pranshu Srivastava a5242f4ddb
Address vulns reported by the security checks
As of this moment, there are 2 vulns in the codebase.
* GO-2022-1095: os/exec@go1.19.2
* GO-2022-1095: syscall@go1.19.2

This commit aims to fix that.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-04 17:52:20 +05:30
Kubernetes Prow Robot 8a390513f8
Merge pull request #1874 from mrueg/dep-bump-2.7.0
Bump dependencies
2022-11-04 03:32:15 -07:00
Pranshu Srivastava 6d2a555bbc
Allow `labelFromKey` field
Allow `labelFromKey` field for the following types:
* Gauge: Done.
* Info: Done.
* StateSet: N/A (redundant use case, see doc changes for more info).

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-04 15:09:13 +05:30
Kubernetes Prow Robot 1a55a38d89
Merge pull request #1849 from rexagod/1846
Recommend kube-scheduler's metrics
2022-11-03 11:25:36 -07:00
Pranshu Srivastava 5d20fd3454
Recommend kube-scheduler alternatives
Recommend metrics exposed by the kube-scheduler, in case of the ones below:
* `kube_pod_container_resource_limits`
* `kube_pod_container_resource_requests`

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2022-11-03 23:46:20 +05:30
Han Kang 38858e6002
Update OWNERS 2022-11-03 09:21:31 -07:00
Kubernetes Prow Robot 086a6fd2b2
Merge pull request #1831 from whitebear009/hpa
add ContainerResourceSourceType for hpa metrics
2022-11-03 07:19:36 -07:00
Manuel Rüger 81cd6ea2c3 go.mod: Bump dependencies
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-11-02 11:27:23 +01:00
Manuel Rüger 2c734dca81 Makefile: Build with go 1.19.3
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-11-02 11:26:42 +01:00
Manuel Rüger 3d8abf894b e2e: Test against k8s 1.25.0
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-11-02 11:26:42 +01:00
Kubernetes Prow Robot 846222b455
Merge pull request #1870 from timp87/fix-customresourcestate-metrics-doc
Fix typos in customresourcestate-metrics doc
2022-10-27 10:08:33 -07:00
Pavel Timofeev aba1302f28
Clarify valueFrom comment 2022-10-26 13:56:41 -06:00
Pavel Timofeev 1ea0ba87a3
One more typo fix 2022-10-26 13:53:02 -06:00
Pavel Timofeev 4c6fff1478
Fix typos 2022-10-25 22:48:27 -06:00
Kubernetes Prow Robot 0d55500068
Merge pull request #1826 from rexagod/1786
Handle singular labels in allowlist
2022-10-21 09:27:51 -07:00
Kubernetes Prow Robot a3a509acdf
Merge pull request #1865 from mrueg/gosec
Harden and add gosec linter
2022-10-21 00:37:51 -07:00
Kubernetes Prow Robot 80f0366b76
Merge pull request #1867 from mrueg/update-gh-actions
.github: Update actions
2022-10-20 23:13:52 -07:00
Han Kang a13c1107ac add myself to OWNERs 2022-10-20 12:47:06 -07:00
Manuel Rüger 470c4fa6fb .github: Update actions
Context: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-20 21:36:01 +02:00
Manuel Rüger 6b7027ff41 Harden and add gosec linter
Remediate:
G104: Errors unhandled.
G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32
G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
G304: Potential file inclusion via variable
G601: Implicit memory aliasing in for loop.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-20 20:44:46 +02:00
Kubernetes Prow Robot d4fdcda6f5
Merge pull request #1850 from rexagod/1847
Represent GVK information as labels
2022-10-20 09:47:01 -07:00
Pranshu Srivastava 762f98bb70
fixup! fixup! Represent GVK information as labels 2022-10-18 21:37:58 +05:30
Pranshu Srivastava 7f906e87b6
fixup! Represent GVK information as labels 2022-10-18 21:16:56 +05:30
Kubernetes Prow Robot 339b134791
Merge pull request #1856 from chrischdi/ksm-cr-fix-docs
customresourcestate fix type indentation in example
2022-10-17 00:23:07 -07:00
Christian Schlotter 563aac0398
customresourcestate fix type indentation in example 2022-10-17 09:11:59 +02:00
Kubernetes Prow Robot b909c01c64
Merge pull request #1844 from CatherineF-dev/import-k8s-metrics-stability
Import k8s metrics stability framework
2022-10-14 05:36:47 -07:00
Catherine Fang 5995c1e2cf Add all stable metrics 2022-10-14 08:25:39 -04:00
Catherine Fang 75bce1c552 Upgrade dependency component-base to v0.25.2 and add TODO 2022-10-14 08:25:39 -04:00
Catherine Fang 37423f462f Import k8s metrics stability framework 2022-10-14 08:19:06 -04:00
Kubernetes Prow Robot 0880c8d275
Merge pull request #1819 from mrueg/bump-go-1.19
Build with go 1.19 / update to k8s 1.25
2022-10-14 03:28:46 -07:00
Kubernetes Prow Robot cb5f88ba27
Merge pull request #1845 from lantingchiang/lease
Allow Lease metrics to be exported across all namespaces
2022-10-14 02:40:47 -07:00
Lanting Chiang 29e043ed1d account for nil holderIdentity case 2022-10-13 11:31:11 -04:00
Lanting Chiang ceaad61c45 export Lease.Spec.HolderIdentity 2022-10-12 09:52:39 -04:00
Pranshu Srivastava 633cbf49d0
Represent GVK information as labels
Represent GVK information as labels in the metrics, instead of appending
them to the metric name itself. This would allow users to aggregate
varying GVKs of a CR under the same metric, making operations much more
easier.
2022-10-08 00:24:16 +05:30
Manuel Rüger 3eee641d85 README.md: Replace Kubernetes compat matrix
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-05 18:25:29 +02:00
Manuel Rüger 112391760e Build with go 1.19
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-05 18:14:50 +02:00
Manuel Rüger a345efe5e4 go.mod: Upgrade to k8s 1.25
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-05 18:14:19 +02:00
Lanting Chiang 5464a9d0e0 update lease store to export namespace 2022-09-28 11:07:10 -04:00
Lanting Chiang 8f883f0601 Allow Lease metrics to be exported across all namespaces 2022-09-27 17:15:41 -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 12402a564c
Merge pull request #1841 from evir35/1660-do-not-expose-ingress-path-metric-when-service-is-nil
Do not expose ingress path metric when service is nil
2022-09-23 06:18:25 -07:00
evir35 7f453f0569
Fix none to blank string 2022-09-23 21:38:00 +09:00
evir35 242cea3ecc
Fix return blank string when Service is nil 2022-09-23 19:35:50 +09:00
evir35 d7a079e361
Do not expose ingress path metric when service is nil 2022-09-23 01:46:35 +09:00
Kubernetes Prow Robot bef31e3f51
Merge pull request #1838 from qdupuy/patch-1
fix/docs: Typo correction in SA metrics
2022-09-20 22:45:13 -07:00
Quentin DUPUY 8f293ab20f
fix/docs: Typo correction in SA metrics
Typo correction in SA metrics documentation in the summary
2022-09-19 15:19:34 +02:00
whitebear009 386eafd05f add ContainerResourceSourceType for hpa metrics and reduce cyclomatic complexity 2022-09-19 11:36:42 +08:00
Kubernetes Prow Robot 20ef8a7596
Merge pull request #1752 from ssabo/master
add exit code
2022-09-04 22:00:38 -07:00
Kubernetes Prow Robot 734389481a
Merge pull request #1822 from sashashura/patch-1
GitHub Workflows security hardening
2022-08-31 22:15:05 -07:00
Kubernetes Prow Robot cf66346e99
Merge pull request #1821 from CatherineF-dev/promote-metrics
Promote two metrics kube_pod_container_status_waiting_reason and kube_deployment_status_replicas_ready to stable
2022-08-31 07:53:01 -07:00
Alex 36c925b094
Update ci.yml
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
2022-08-31 10:11:23 +01:00
Catherine Fang ee77b19bdb Promote two metrics to stable 2022-08-30 20:51:29 -04:00
Kubernetes Prow Robot acca9b050e
Merge pull request #1818 from kubernetes/release-2.6
Merge Release 2.6.0 back to master
2022-08-26 01:48:25 -07:00
Shaun Sabo 5bfe00666c documentation 2022-08-24 13:26:51 -07:00
Shaun Sabo eb3c14002c fix test 2022-08-24 13:07:04 -07:00
Shaun Sabo ffb6fe77e8 remove reason from exitcode 2022-08-24 12:55:27 -07:00
Shaun Sabo 085935314b unit tests 2022-08-24 12:55:27 -07:00
Shaun Sabo e31b035319 create new metric 2022-08-24 12:55:27 -07:00
Shaun Sabo 1851bfae76 fix unitests 2022-08-24 12:55:27 -07:00
Shaun Sabo c9bb45384a add exit code 2022-08-24 12:55:27 -07:00
Kubernetes Prow Robot bc3b98558b
Merge pull request #1817 from mrueg/prep-release-2.6.0
*: Cut v2.6.0
2022-08-24 09:38:03 -07:00
Manuel Rüger 1b8b443e4b *: Cut v2.6.0 2022-08-24 17:09:08 +02:00
Kubernetes Prow Robot ebc0e18687
Merge pull request #1814 from nabokihms/local-storage-labels
feat: Add local storage labels to kube_persistentvolume_info
2022-08-24 07:38:03 -07:00
Kubernetes Prow Robot 6dfeab3dc5
Merge pull request #1816 from mrueg/disable-rbac-metrics
Remove RBAC resources from default exposed metric set
2022-08-24 06:34:05 -07:00
Kubernetes Prow Robot 4c141d5877
Merge pull request #1810 from chrischdi/pr-custom-resource-flag-repeat
Prevent definition of same gvk in custom resource configuration
2022-08-24 00:20:24 -07:00
m.nabokikh 9e639b2ff9 Add host path metrics, fix table formatting
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2022-08-24 11:17:08 +04:00
Christian Schlotter 44831f7386
Prevent multiple custom resource configurations for the same resource 2022-08-24 08:20:08 +02:00
Manuel Rüger 93e79fc9d8 Remove RBAC resources from default exposed metric set
These resources might create a lot of metrics,
so we won't enable them by default for now.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-08-23 18:44:55 +02:00
Kubernetes Prow Robot 5b017f7ffc
Merge pull request #1789 from mrueg/update-go
Update dependencies
2022-08-23 07:13:24 -07:00
Kubernetes Prow Robot 69cc1960b9
Merge pull request #1812 from bavarianbidi/deprecate_precomputed_endpoint_metrics
graduate new endpoint metrics to STABLE
2022-08-23 07:09:24 -07:00
m.nabokikh 9939059be5 Make code inline with the other parts
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2022-08-23 17:03:40 +04:00
m.nabokikh a6984e00ef feat: Add local storage labels to kube_persistentvolume_info
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2022-08-23 15:45:07 +04:00
Mario Constanti 9f7d1af299 graduate new endpoint metrics to STABLE
* graduate kube_endpoint_ports and kube_endpoint_address to STABLE
* graduate kube_endpoint_address_not_ready and
  kube_endpoint_address_available to DEPRECATED as the information is
precomputed during metrics-scraping

Signed-off-by: Mario Constanti <mario@constanti.de>
2022-08-23 09:06:49 +02:00
Manuel Rüger 03906e6e49 Update dependencies
go v1.18.3 -> v1.18.5
prometheus v2.35.0 -> v2.37.0
golangci-lint v1.46.2 -> v1.48.0

Several go dependencies, among them:

k8s v1.24.2 -> v1.24.4

cloudbuild image
v20211118-2f2d816b90 -> v20220609-2e4c91eb7e

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-08-22 18:56:39 +02:00
Kubernetes Prow Robot f1d5653465
Merge pull request #1809 from chrischdi/pr-info-nometric-nil
Do not expose info metric for nil objects
2022-08-19 05:45:52 -07:00
Christian Schlotter 25f3b8f45a
Do not expose info metric for nil objects 2022-08-19 13:28:23 +02:00
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 b314ccb826
Merge pull request #1777 from chrischdi/poc-additional-metric-types-2
pkg/customresourcestate implement info and stateSet metric type and refactor configuration file
2022-08-18 12:20:13 -07:00
Christian Schlotter 52d3ab621b
pkg/customresourcestate implement info and stateSet metric type and refactor configuration file
* Adds detection of booleans in string format to getNum.
* Refactors configuration file to allow definition of different metric types
  having different configuration variables.
* Refactor order of types and funcs in pkg/customersourcestate.
* Allows info and stateSet metrics to iterate over arrays.
* Adds `nilIsZero` config variable to gauge to indicate non-existing values to tread as 0 value instead of returning an error.
* Skip adding a label instead of setting value to `<nil>`.
* Replace namespace and subsystem by metricsNamePrefix
* Adjust docs for customresourcestate metrics to align with new configuration file
2022-08-18 21:05:09 +02: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
Kubernetes Prow Robot 9063fa6b17
Merge pull request #1808 from mrueg/drop-pkg-errors
Replace pkg/errors with stdlib errors
2022-08-15 22:41: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
John ebb8b10551
Apply suggestions from code review
Co-authored-by: JUN YANG <yang.jun22@zte.com.cn>
2022-08-13 21:44:46 +02:00
John d5486a7d87
Apply suggestions from code review
Co-authored-by: JUN YANG <yang.jun22@zte.com.cn>
2022-08-13 21:44:23 +02:00
John 62beea063a
Apply suggestions from code review
Co-authored-by: JUN YANG <yang.jun22@zte.com.cn>
2022-08-13 21:44:00 +02:00
John a2ccd75234
Apply suggestions from code review
Co-authored-by: JUN YANG <yang.jun22@zte.com.cn>
2022-08-13 14:46:18 +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 ba904d874c fix typos 2022-08-10 01:56:20 +09:00
Kaito Ii aa01f53446 fix metrics name 2022-08-10 01:49:55 +09:00
Kaito Ii df7dafe962
Apply suggestions from code review
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2022-08-10 00:36:49 +09:00
Kubernetes Prow Robot 767af98d2f
Merge pull request #1725 from tanguyfalconnet/feat/hpa/status_current_target
feat(hpa): status current metric
2022-08-09 07:34:51 -07:00
Kaito Ii 2cd6aaa8aa fix filename and sort order 2022-08-09 23:17:20 +09: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
Kubernetes Prow Robot fad76e457a
Merge pull request #1784 from ikarlashov/fix_customresourcestate_doc
Fix custom resource metrics documentation
2022-07-11 22:20:53 -07:00
Kubernetes Prow Robot 3fc5dd385f
Merge pull request #1780 from mrueg/update-security-contacts
SECURITY_CONTACTS: Sync with OWNERS
2022-07-11 08:01:48 -07:00
Evgen Karlashov 9197bb28b9 Changes to customresourcestate doc
Signed-off-by: Evgen Karlashov <ievgen.karlashov@kpn.com>
2022-07-08 11:25:06 +02:00
Evgen Karlashov 5ba662251f Fix custom resource metrics documentation
Signed-off-by: Evgen Karlashov <ievgen.karlashov@kpn.com>
2022-07-08 11:25:06 +02:00
Manuel Rüger c7810d151c SECURITY_CONTACTS: Sync with OWNERS
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-07-04 18:55:42 +02:00
Kubernetes Prow Robot 335e9e1235
Merge pull request #1759 from kaitoii11/roles
Add support for role and cluster role
2022-07-04 05:35:24 -07:00
Kaito Ii 64926a3407 fix libsonnet to add roles 2022-06-30 22:03:14 +09:00
Kaito Ii a601d33bb4 Fix typo
Signed-off-by: Kaito Ii <kaitoii1111@gmail.com>
2022-06-30 20:55:28 +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
Kubernetes Prow Robot e4011f8f4b
Merge pull request #1773 from Serializator/service-account-metrics-1717
Add support for the ServiceAccount resource (Ref: #1717)
2022-06-30 02:12:07 -07:00
Kubernetes Prow Robot d0969f49b0
Merge pull request #1774 from Serializator/update-developer-docs-new-resource-metric-collector
Update the developer documentation for adding a new resource metric collector
2022-06-29 15:14:06 -07:00
Julian van den Berkmortel a2ab72a773
Update the developer documentation for adding a new resource metric collector 2022-06-29 23:59:32 +02:00
Julian van den Berkmortel 6a24f639f8
Add support for the ServiceAccount resource (Ref: #1717) 2022-06-29 23:58:01 +02:00
Kubernetes Prow Robot 26c889014b
Merge pull request #1772 from Serializator/readme-versioning-heading
Add "Versioning" heading to the README.md
2022-06-29 10:50:07 -07:00
Kubernetes Prow Robot 5798914f95
Merge pull request #1769 from Serializator/kube-pod-tolerations-metric-1744
Add metric for pod tolerations (Ref: #1744)
2022-06-29 09:44:06 -07:00
Julian van den Berkmortel af39c7e217
Add "Versioning" heading to the README.md 2022-06-29 18:01:00 +02:00
Julian van den Berkmortel a0980c87d1
Add metric for pod tolerations (Ref: #1744) 2022-06-29 17:56:52 +02:00
Kubernetes Prow Robot 4692dc66c6
Merge pull request #1767 from yosshi825/fix/typo
fix:typo
2022-06-28 06:59:57 -07:00
yosshi825 9c90196261 fix:typo 2022-06-28 22:40:31 +09:00
Kubernetes Prow Robot b0153df9dc
Merge pull request #1766 from dontan001/timestamp_support
To support read the timestamp fields of custom resources
2022-06-28 06:19:58 -07:00
dongge.tan 889d7b4281 To support read the timestamp fields of custom resources 2022-06-28 16:27:54 +08:00
Kubernetes Prow Robot 3bc65571c4
Merge pull request #1764 from yangjunmyfm192085/updatereadme
update the description about metrics server
2022-06-27 00:00:59 -07:00
杨军10092085 f70471b84b update the description about metrics server 2022-06-27 14:52:59 +08:00
Kubernetes Prow Robot 8d8df116d9
Merge pull request #1761 from bavarianbidi/new_kube_endpoint_address_metrics
add new kube_endpoint_address metric
2022-06-22 09:29:43 -07:00
Mario Constanti 6082c0335c kube_endpoint_address now has a ready label
Signed-off-by: Mario Constanti <mario@constanti.de>
2022-06-22 13:35:33 +02:00
Mario Constanti 997b5cedfe add new kube_endpoint_address metric
As KSM shouldn't be responsible for computation of metrics, a new metric
is needed to expose available and unavailable addresses of an endpoint.

This new metric is generated as a future replacement for
kube_endpoint_address_available and kube_endpoint_address_not_ready.

Signed-off-by: Mario Constanti <mario@constanti.de>
2022-06-21 05:41:09 +02:00
Kubernetes Prow Robot 8024d3e040
Merge pull request #1760 from jumbosushi/fix-node-docs
Update kube_node_status_allocatable unit doc
2022-06-19 22:44:05 -07:00
Atsushi Yamamoto 3b93153364
Update kube_node_status_allocatable unit doc 2022-06-16 17:26:33 -07:00
Kubernetes Prow Robot aa8729abea
Merge pull request #1754 from chrischdi/pr-customresource-underscore-fix
fix customresourcestate metric names to not contain underscores
2022-06-09 04:17:42 -07:00
Kubernetes Prow Robot 379b60abd9
Merge pull request #1756 from yosshi825/docs/kube-pod-nodeselectors
docs:fix label name for kube_pod_nodeselectors
2022-06-08 23:49:42 -07:00
yosshi825 cc322b7240 docs:fix label name for kube_pod_nodeselectors 2022-06-09 13:58:01 +09:00
Christian Schlotter 138e1e65bc
fix customresourcestate metric names to not contain underscores 2022-06-08 21:48:13 +02:00
Kubernetes Prow Robot e3bc8c22c2
Merge pull request #1750 from mrueg/registry.k8s.io
Switch registry from k8s.gcr.io to registry.k8s.io
2022-06-07 05:31:49 -07:00
Manuel Rüger de1902391c Switch registry from k8s.gcr.io to registry.k8s.io
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-06-07 13:48:26 +02:00
Kubernetes Prow Robot 7f09ca71ba
Merge pull request #1747 from kubernetes/release-2.5
Merge Release 2.5 back to master
2022-06-03 04:54:20 -07:00
Kubernetes Prow Robot 66ce101f5e
Merge pull request #1748 from mrueg/update-release-instruction
Update release instructions
2022-06-03 04:40:19 -07:00
Manuel Rüger 26c286c17c Update release instructions
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-06-03 13:28:21 +02:00
Kubernetes Prow Robot 0567e1e1b9
Merge pull request #1746 from mrueg/prep-2.5.0
*: Cut 2.5.0 release
2022-06-03 03:14:20 -07:00
Manuel Rüger 53913691b4 *: Cut 2.5.0 release
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-06-02 22:53:36 +02:00
Kubernetes Prow Robot d6666ee631
Merge pull request #1745 from mrueg/go-1.18.3
Version bump Go to 1.18.3
2022-06-02 07:07:47 -07:00
Manuel Rüger 824fb1cde7 Version bump Go to 1.18.3
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-06-02 12:16:21 +02:00
Kubernetes Prow Robot 1e782857c6
Merge pull request #1710 from hack-edu/master
feat: enable customresource metrics by configuration
2022-06-02 02:57:47 -07:00
Noah Perks Sloan e7725f9bdb docs: update arg 2022-06-01 20:35:21 -05:00
noah 99d86bb5a5
another exp note
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2022-06-01 20:33:43 -05:00
Noah Perks Sloan fdd09314c8 fix: inconsistent test result by sorting 2022-06-01 13:51:39 -05:00
Noah Perks Sloan 2b77ed6be8 chore: docs formatting
is there a tool for this?
2022-06-01 11:03:56 -05:00
noah 6ec0332bd5
note experimental status
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2022-06-01 10:11:27 -05:00
Noah Perks Sloan a9ec8a6209 fix: remove dots in flag names 2022-06-01 09:21:05 -05:00
Noah Perks Sloan fad7caf05f fix(docs): flag name 2022-06-01 09:18:52 -05:00
Noah Perks Sloan bc7cc9eac8 doc: crs flags 2022-06-01 09:18:07 -05:00
Noah Perks Sloan d0aa4a3bdd refactor: inline config as a flag
This is more flexible than the env variable, as a configuration can still set an env variable and use substitution in the args. e.g.,

```yaml
args:
 - --custom-resource-state.config
 - $(KSM_CUSTOM_RESOURCE_STATE_CONFIG)
env:
 ...
```
2022-06-01 09:12:48 -05:00
Kubernetes Prow Robot 0c6afa9ea3
Merge pull request #1740 from bjschafer/add-pod-ips
Add kube_pod_ips gauge to pod metrics
2022-05-31 22:19:01 -07:00
Noah Perks Sloan 39f7f0ce5a doc: don't abbreviate 2022-05-31 16:14:21 -05:00
Noah Perks Sloan 8c5d9797bf doc: note CR support is experimental 2022-05-31 16:12:07 -05:00
Noah Perks Sloan 4b704fd90e fix: use a flag for the configuration file 2022-05-31 16:11:49 -05:00
Noah Perks Sloan ea795572d8 chore: goimports 2022-05-31 14:28:29 -05:00
Noah Perks Sloan e0e4f14412 feat: enable customresource metrics by configuration
The main use case is just surfacing fields from custom resources without having to write a lot of code for each one.
2022-05-31 14:24:28 -05:00
Braxton Schafer 5d57f47658 skip invalid IPs on pod_ips metric 2022-05-31 11:44:17 -05:00
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
Kubernetes Prow Robot 7e28ed2722
Merge pull request #1741 from aidan-ogorman-dev/pvc-pv-creation-timestamp
Adding Unix creationTimestamp to PV/PVC metrics
2022-05-30 23:50:52 -07:00
Aidan O'Gorman 04da1d8fa8 fixed .md formatting 2022-05-30 17:51:21 +01:00
Kubernetes Prow Robot d04c7d13aa
Merge pull request #1734 from honpey/panic-fix
internal/store: fix metrics slice length for init containers
2022-05-30 00:42:52 -07: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
Kubernetes Prow Robot 07c8a22490
Merge pull request #1743 from mrueg/bump-0522
Bump to go 1.18.2, k8s 1.24, kind 0.14.0, prometheus 2.35.0
2022-05-30 00:14:51 -07:00
Aidan O'Gorman f553236fd0 revert change to example standard deployment 2022-05-29 14:07:26 +01:00
Aidan O'Gorman b4b8df7134 Fixing unit test for PV and PVC 2022-05-29 11:42:13 +01:00
Manuel Rüger 42cd98e44a Bump to go 1.18.2, k8s 1.24, kind 0.14.0, prometheus 2.35.0
and several other go deps

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-05-26 20:09:21 +02:00
Kubernetes Prow Robot ecf650fa3c
Merge pull request #1742 from mrueg/golangci-1.46.2
.github/workflows: Update golangci-lint to v1.46.2
2022-05-24 22:58:43 -07:00
Manuel Rüger 3f1a96a368 .github/workflows: Update golangci-lint to v1.46.2
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-05-25 00:19:54 +02:00
Aidan O'Gorman 1362519c92 Fix ups to unit tests 2022-05-24 09:50:21 +01:00
Aidan O'Gorman 859c8e903f Adding Unix creationTimestamp to PV/PVC metrics 2022-05-23 21:28:24 +01:00
Kubernetes Prow Robot c02c4cd32f
Merge pull request #1732 from X4BNet/feature/LastSuccessfulTime
Add missing LastSuccessfulTime metric
2022-05-16 04:18:17 -07:00
Kubernetes Prow Robot 5aee2c24d1
Merge pull request #1727 from luke-sprig/feat/expose-csi-pv-metric
feat: Add CSI support to PV Metrics
2022-05-16 02:16:18 -07:00
Mathew Heard 7f29e6c4eb Add missing LastSuccessfulTime metric 2022-05-16 18:38:41 +10:00
Luke Chui 821a034c25 fix formatting 2022-05-13 12:42:27 -07:00
Kubernetes Prow Robot 9e97bb1413
Merge pull request #1731 from jan--f/pod-store-metrics-slice-length
internal/store: fix metrics slice length
2022-05-10 00:55:43 -07: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
Kubernetes Prow Robot 3e12ba0470
Merge pull request #1726 from mrueg/go-1.18
Update go 1.18 / update dependencies
2022-05-04 22:20:19 -07:00
Luke Chui a7a8043e1f add metric + docs + tests 2022-05-04 19:35:52 -07:00
Manuel Rüger c8168536a0 Update dependencies
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-05-04 23:59:43 +02:00
Manuel Rüger ec03b740c3 Update to go 1.18
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-05-04 23:55:04 +02:00
Tanguy Falconnet 8e5d283d11 update(hpa): according to code review 2022-05-04 10:34:22 +02:00
Tanguy Falconnet b09674c2d4
chore: apply suggestions from code review
Co-authored-by: Filip Petkovski <filip.petkovsky@gmail.com>
2022-05-04 10:11:11 +02:00
Tanguy Falconnet 20084df76e chore(hpa): rename metric to match with k8s api 2022-04-29 15:28:07 +02:00
Tanguy Falconnet b26d66357a fix(test/hpa): values & labels wanted 2022-04-29 12:34:42 +02:00
Tanguy Falconnet 6906e07645 fix(hpa): status current target 2022-04-29 12:34:09 +02:00
Tanguy Falconnet 3eb7aa4451 feat(hpa): status current target
Signed-off-by: Tanguy Falconnet <tfalconnet.externe@bedrockstreaming.com>
2022-04-29 12:23:41 +02:00
Kubernetes Prow Robot cb966b4010
Merge pull request #1723 from mfojtik/fix-panic
internal/store: fix potential panic in pod store
2022-04-25 05:41:40 -07:00
Michal Fojtik 43d374b1cb
internal/store: fix potential panic in pod store 2022-04-25 13:53:50 +02:00
Kubernetes Prow Robot 1f9457b64b
Merge pull request #1721 from pgvishnuram/master
fix CVE: CVE-2022-27191 in go.mod package
2022-04-25 02:07:39 -07:00
pgvishnuram 0a6761d765 fix CVE: CVE-2022-27191 in go.mod package 2022-04-25 13:19:53 +05:30
Kubernetes Prow Robot b43b8cd57b
Merge pull request #1713 from fpetkovski/bump-golangci-lint
Update golangci-lint version to 1.45.2
2022-04-05 04:49:37 -07:00
fpetkovski 8011ae46c0
Update golangci-lint version to 1.45.2 2022-04-05 11:32:36 +02:00
Kubernetes Prow Robot fde834fda3
Merge pull request #1712 from dgrisonnet/update-owners
Update OWNERS
2022-04-05 00:57:37 -07:00
Damien Grisonnet bcf909d826 Update OWNERS
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2022-03-31 17:42:02 +02:00
Kubernetes Prow Robot eff2c0ed6d
Merge pull request #1708 from mrueg/bump-versions-2022-Mar
Update dependencies
2022-03-18 03:05:16 -07:00
Manuel Rüger f987770240 go.mod: Bump dependencies 2022-03-17 22:15:01 +01:00
Manuel Rüger ecd5ce2a8b Makefile: Bump to go 1.17.8 / prometheus 2.33.4 2022-03-14 11:46:13 +01:00
Manuel Rüger b4b0ba12d0 tests/e2e.sh: Bump to kind v0.12.0 2022-03-14 11:45:51 +01:00
Kubernetes Prow Robot 179e61f301
Merge pull request #1699 from fpetkovski/fix-server-test
Properly initialize KSM server test
2022-03-11 07:37:07 -08:00
Kubernetes Prow Robot 57533e4d60
Merge pull request #1706 from sthaha/test-newline-in-metricset
Assert that newlines in coma separated arguments are ignored
2022-03-09 06:14:12 -08:00
Sunil Thaha c309956a6f
Assert that newlines in coma separated arguments are ignored
This test is added to ensure that ksm can be invoked as follows and that
this is a "documented" feature.
```
<ksm> --metric-denylist="
    ^kube_.+_created$,
    ^kube_.+_metadata_resource_version$,
    ^kube_pod_completion_time$,
    ^kube_pod_status_scheduled$
  "
```
See: Usage in kube-prometheus jsonnet for example [1]

[1]: 9cf6111562/jsonnet/kube-prometheus/addons/ksm-lite.libsonnet (L18)

Signed-off-by: Sunil Thaha <sthaha@redhat.com>
2022-03-09 14:12:25 +10:00
Kubernetes Prow Robot ef8bede406
Merge pull request #1704 from fpetkovski/fix-changelog-entry
Fix changelog entry
2022-03-08 06:26:33 -08:00
fpetkovski cf6bdc9e0d
Fix changelog entry 2022-03-08 15:21:06 +01:00
Kubernetes Prow Robot 34ee79a82f
Merge pull request #1702 from fpetkovski/prepare-2.4.2
Prepare 2.4.2
2022-03-08 05:06:32 -08:00
fpetkovski b57133a264 Prepare 2.4.2 2022-03-03 13:09:44 +01:00
Kubernetes Prow Robot abe6c4cb0a
Merge pull request #1700 from e-ngo/prevent-watch-from-resetting-rv
Prevent watch from resetting ResourceVersion.
2022-03-02 07:05:14 -08:00
Eric Ngo 7f17751b62 Prevent watch from resetting ResourceVersion. 2022-03-01 17:31:24 -08:00
fpetkovski f4341718df Properly initialize KSM server test
The pkg/app/server test does not properly initialize KSM with an empty
metrics opt-in list. This results in opt-in metrics showing up in the
expected test results.

This commit changes the test to be in line with how KSM is initialized
in production code by passing in an empty opt-in list.
2022-03-01 10:13:08 +01: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
Kubernetes Prow Robot 6a8c6f8f1a
Merge pull request #1687 from liangyuanpeng/support_uid_service
Add default label of uid for service
2022-02-28 00:40:57 -08:00
Kubernetes Prow Robot 5db4c85d4e
Merge pull request #1696 from kubernetes/release-2.4
Release 2.4
2022-02-23 02:28:18 -08:00
Kubernetes Prow Robot 64e3608946
Merge pull request #1694 from fpetkovski/bump-patch-version
Bump patch version
2022-02-23 02:22:19 -08:00
fpetkovski e52d8ace1f Update version to 2.4.1 2022-02-22 15:28:58 +01:00
Kubernetes Prow Robot d3b2526aec
Merge pull request #1693 from fpetkovski/increase-build-timeout
Increase build timeout to 1800s
2022-02-22 05:13:46 -08:00
fpetkovski e1cc5f6bd7 Increase build timeout to 1800s 2022-02-22 14:01:29 +01:00
Kubernetes Prow Robot 462c6e6215
Merge pull request #1692 from fpetkovski/increase-build-timeout
Increase build timeout to 1800s
2022-02-22 02:37:47 -08:00
fpetkovski dddd54e1f4 Increase build timeout to 1800s 2022-02-22 11:27:21 +01:00
Lan Liang 5453753153 Upgrade doc for service metrics of add uid 2022-02-20 00:36:28 +08:00
Lan Liang e8ac5eeb64 Update test for service 2022-02-19 21:34:49 +08:00
Lan Liang ad9d3364ec Add default label of uid for service 2022-02-19 21:15:09 +08:00
Kubernetes Prow Robot 929f4acd01
Merge pull request #1685 from whitebear009/hpa-metric-type
Change the processing type from int to float in kube_horizontalpodautoscaler_spec_target_metric
2022-02-18 00:56:24 -08:00
whitebear009 c04de9a0ae remove ok variable and change the type of v variable to map 2022-02-17 19:39:31 +08:00
whitebear009 eece675df0 fix typo and add unit test for float target metric 2022-02-16 22:49:19 +08:00
whitebear009 2f5b0f0ff3 filter unset field and add unit test 2022-02-16 18:55:40 +08:00
whitebear009 8e184f03b1 Change the processing type from int to float in kube_horizontalpodautoscaler_spec_target_metric 2022-02-15 19:32:47 +08:00
Kubernetes Prow Robot 5a3183e4d5
Merge pull request #1683 from fpetkovski/prepare-2.4
Prepare release 2.4
2022-02-14 23:36:04 -08:00
fpetkovski 13c8574db7 Prepare release 2.4 2022-02-14 11:45:45 +01:00
Kubernetes Prow Robot cf19fdebd1
Merge pull request #1682 from mrueg/go-1.17.7
Makefile: Use go 1.17.7
2022-02-11 06:07:05 -08:00
Manuel Rüger 82073793b6 Makefile: Use go 1.17.7
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-02-11 14:25:12 +01:00
Kubernetes Prow Robot 60906c6a25
Merge pull request #1681 from mrueg/bump-go
Bump go to 1.17.6 and dependencies
2022-02-10 06:57:47 -08:00
Manuel Rüger 4443f88367 Bump go to 1.17.7 and dependencies
Also unpack only promtool during install

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-02-10 15:28:46 +01:00
Kubernetes Prow Robot 10dde2115c
Merge pull request #1676 from sherifabdlnaby/alloc-optimize
Optimize Slice Allocations ( ~ -20% byte/op, ~ -20% ns/op, ~ -25% allocs )
2022-02-10 05:07:47 -08:00
Sherif Abdel-Naby a229e1b67f
Update internal/store/utils.go
Co-authored-by: Filip Petkovski <filip.petkovsky@gmail.com>
2022-02-10 14:19:12 +02:00
Sherif Abdel-Naby 8c9476d2d1
Update internal/store/utils.go
Co-authored-by: Filip Petkovski <filip.petkovsky@gmail.com>
2022-02-10 14:18:59 +02:00
Sherif Abdel-Naby 5766f80bd2
Add Comment 2022-02-10 04:32:19 +02:00
Sherif Abdel-Naby aa44127adb
Optimize by Allocating in one contiguous block 2022-02-10 04:26:47 +02:00
Sherif Abdel-Naby c8ac409365
Lint 2022-02-10 04:26:47 +02: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 2b085201e5 Adds opt-in metric info and builds out opt-in column in Pod 2022-02-07 10:21:14 -08:00
Eric Hole b2bdf2bd09 Removes dead code from test 2022-02-07 09:40:52 -08:00
Eric Hole 90689ccff3 Change kube_pod_nodeselector to be opt-in 2022-02-07 09:13:20 -08:00
Kubernetes Prow Robot 6d5a8055cb
Merge pull request #1677 from mrueg/benchstat
tools: Switch from benchcmp to benchstat
2022-02-07 01:47:44 -08:00
Manuel Rüger 22067a0295 tools: Switch from benchcmp to benchstat
benchcmp is deprecated and thus replaced by benchstat

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-02-05 18:42:17 +01: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
Kubernetes Prow Robot 34a1398f1c
Merge pull request #1674 from ArthurSens/linux-hardening
jsonnet: Drop all Linux capabilities
2022-02-01 04:42:19 -08:00
ArthurSens 8918f9b9fe jsonnet: Drop all Linux capabilities
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
2022-02-01 09:15:57 +00:00
Kubernetes Prow Robot 9ea05e42fb
Merge pull request #1671 from ArthurSens/readOnlyRootFilesystem
jsonnet: Forbid write access to root filesystem
2022-01-27 01:03:12 -08:00
Arthur Silva Sens d9aaef0d9d jsonnet: Forbid write access to root filesystem
Signed-off-by: GitHub <noreply@github.com>
2022-01-27 08:51:26 +00:00
Kubernetes Prow Robot d7e618dbd8
Merge pull request #1663 from akamac/patch-1
fix sample yaml
2022-01-25 05:42:33 -08:00
Kubernetes Prow Robot d9254d7c28
Merge pull request #1668 from ArthurSens/privilege-escalation
jsonnet: explicitly forbid privilege escalation
2022-01-25 01:26:30 -08:00
Arthur Silva Sens 8d2587a6a1 jsonnet: explicitly forbid privilege escalation
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
2022-01-25 09:14:35 +00:00
Kubernetes Prow Robot 486b95fcc1
Merge pull request #1669 from Garima-Negi/Fix-OWNERS-file
Fix OWNERS file emeritus_approvers
2022-01-23 02:07:56 -08:00
Garima c504508222 Fix OWNERS file emeritus_approvers 2022-01-23 14:55:49 +05:30
Kubernetes Prow Robot 98c833322c
Merge pull request #1667 from paulfantom/automountServiceAccountToken
jsonnet: increase security by specifying automountServiceAccountToken on pod level and not on serviceAccount
2022-01-21 04:57:59 -08:00
Paweł Krupa (paulfantom) c9c314f5f2 examples: regenerate 2022-01-21 13:43:22 +01:00
Paweł Krupa (paulfantom) 122f3e9783 jsonnet: increase security by specifying automountServiceAccountToken on pod level and not on serviceAccount 2022-01-21 12:47:30 +01:00
Alexey Miasoedov 5fa79e1e71
fix sample yaml 2022-01-10 12:37:46 +03:00
Kubernetes Prow Robot 41eea36f69
Merge pull request #1491 from bison/deprecated-versions
Use v1 PodDisruptionBudget and CronJob resources
2022-01-04 06:00:53 -08: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
Kubernetes Prow Robot f629b2579d
Merge pull request #1657 from kubernetes/release-2.3
Release 2.3
2021-12-22 02:09:36 -08:00
Kubernetes Prow Robot e080c3ce73
Merge pull request #1653 from arajkumar/fix-pdb-allowlist-typo
pdb: use plural form of resource name in allowlist key
2021-12-20 00:05:26 -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
Kubernetes Prow Robot 04ac65bd45
Merge pull request #1652 from adammw/adammw/ingressclass
Add ingressclass to kube_ingress_info metric
2021-12-16 02:07:19 -08:00
Adam Malcontenti-Wilson 8608588043 Add ingressclass to kube_ingress_info metric 2021-12-16 10:59:23 +11:00
Kubernetes Prow Robot b550d7a3bc
Merge pull request #1651 from fpetkovski/prepare-2.3.0
Update compatibility matrix
2021-12-15 02:24:19 -08:00
Garrybest acd5e74f50 Add a custom resource test based on foo object in samplecontroller
Signed-off-by: Garrybest <garrybest@foxmail.com>
2021-12-14 21:31:33 +08:00
Garrybest 854bc7c36b Reform main function to adapt custom resource registry
Signed-off-by: Garrybest <garrybest@foxmail.com>
2021-12-14 21:31:33 +08:00
Garrybest 3ca06c2692 Reform Builder to adapt custom resource registry
Signed-off-by: Garrybest <garrybest@foxmail.com>
2021-12-14 21:31:26 +08:00
Garrybest 577bf2e8b5 Design a custom resource RegistryFactory for out-of-tree implements
Signed-off-by: Garrybest <garrybest@foxmail.com>
2021-12-10 15:45:21 +08:00
fpetkovski 3edcad1c64 Update compatibility matrix 2021-12-09 16:31:42 +01:00
Kubernetes Prow Robot b761b5382b
Merge pull request #1649 from fpetkovski/prepare-2.3.0
Prepare 2.3.0
2021-12-09 07:24:16 -08:00
fpetkovski 456c6c2193 Prepare 2.3.0 2021-12-09 15:13:03 +01:00
Kubernetes Prow Robot e3056ae518
Merge pull request #1648 from Serializator/add-kube-horizontalpodautoscaler-info-metric
Add "kube_horizontalpodautoscaler_info" metric
2021-12-09 02:00:10 -08:00
Julian van den Berkmortel bb02daf5b4
Add the "kube_horizontalautoscaler_info" metric docs 2021-12-08 18:44:31 +01:00
Julian van den Berkmortel 060ed075dc
Add the "kube_horizontalpodautoscaler_info" metric 2021-12-08 18:44:30 +01:00
Julian van den Berkmortel 0629d82d07
Add the "kube_horizontalpodautoscaler_info" metric to the tests 2021-12-08 18:44:29 +01:00
Kubernetes Prow Robot 840d30ce57
Merge pull request #1643 from Serializator/feature/opt-in-metrics-1574
Add the "--opt-in-metrics" argument to the CLI to allow for opt-in metrics
2021-12-01 13:53:18 -08:00
Julian van den Berkmortel da04a73f68
Add the opt-in metric family filter to expose or not to a metric family from the store (#1574) 2021-12-01 22:08:52 +01:00
Kubernetes Prow Robot cb35edbba9
Merge pull request #1646 from spiffxp/fix-gcb-image
images: fix invalid k8s-staging-test-infra/gcb-docker-gcloud tag
2021-11-30 13:57:01 -08:00
Aaron Crickenberger 642804b4e3 images: fix invalid k8s-staging-test-infra/gcb-docker-gcloud tag 2021-11-30 13:46:40 -08:00
Kubernetes Prow Robot ba14700961
Merge pull request #1645 from spiffxp/use-k8s-infra-for-gcb-image
images: use k8s-staging-test-infra/gcb-docker-gcloud
2021-11-30 11:37:01 -08:00
Aaron Crickenberger a5e058b847 images: use k8s-staging-test-infra/gcb-docker-gcloud 2021-11-30 11:26:43 -08:00
Julian van den Berkmortel 0046f2d227
Add an OptIn property to the FamilyGenerator struct to identify an opt-in metric family (#1574) 2021-11-28 23:05:42 +01:00
Kubernetes Prow Robot 0c9580d09c
Merge pull request #1632 from Serializator/refactor/opt-in-metrics-1574
Add "FamilyGeneratorFilter" interface for the purpose of a more extensible approach to the allow- / denylist
2021-11-22 07:13:08 -08:00
Kubernetes Prow Robot 0c33f919a1
Merge pull request #1634 from fpetkovski/fpetkovski-approver
Add fpetkovski to approvers
2021-11-19 03:54:51 -08:00
fpetkovski fb3a636bf9 Add fpetkovski to approvers 2021-11-19 10:51:55 +01:00
Kubernetes Prow Robot e01346e2d5
Merge pull request #1633 from dgrisonnet/dgrisonnet-approver
OWNERS: add dgrisonnet to approvers
2021-11-19 01:46:51 -08:00
Kubernetes Prow Robot 07b767561c
Merge pull request #1637 from mrueg/extract-version
.github: Extract golangci-lint version
2021-11-19 00:46:51 -08:00
Manuel Rüger 2e78af1ccd Fix findings to make lint pass
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2021-11-18 16:22:16 +01:00
Manuel Rüger f4510e454b .github: Extract golangci-lint version
Bump to v1.43.0

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2021-11-18 14:59:35 +01:00
Kubernetes Prow Robot 4444929559
Merge pull request #1636 from mrueg/bump-versions-2021-Nov
Bump golang and kubernetes versions
2021-11-18 05:59:02 -08:00
Manuel Rüger 787964ffdf Bump golang and kubernetes versions
golang 1.17.2 -> 1.17.3
prometheus 2.30.1 -> 2.31.1
kubernetes 0.22.2 -> 0.22.4

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2021-11-18 14:52:07 +01:00
Damien Grisonnet b834f1fffa OWNERS: add dgrisonnet to approvers
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-11-17 17:57:33 +01:00
Julian van den Berkmortel f78c8eb1c6
Add CompositeFamilyGeneratorFilter struct for combining multiple filters 2021-11-16 17:49:14 +01:00
Julian van den Berkmortel d767e99c98
Add FamilyGeneratorFilter interface and use it for the allow- / denylist 2021-11-16 17:49:13 +01:00
Kubernetes Prow Robot e859b280fc
Merge pull request #1629 from Serializator/bug/multi-arch-image-1615
Use the architecture specified in the Makefile for the Docker image and binary
2021-11-10 07:57:27 -08:00
Kubernetes Prow Robot 261dbadfa7
Merge pull request #1571 from Daimler/kube_endpoint_ports
endpoints: export number of ports as new metric
2021-11-09 17:37:27 -08:00
Kubernetes Prow Robot 1f4343d23d
Merge pull request #1603 from karancode/support-kustomize-deployment
feat: kustomization for all examples
2021-11-09 15:55:26 -08:00
Kubernetes Prow Robot c4ec8db723
Merge pull request #1627 from dgrisonnet/rebase-v2.2.4-master
Merge changes from v2.2.4 back to master
2021-11-09 10:18:47 -08:00
Constanti, Mario 27366d7893 endpoints: export information about ports
metric - introduce new kube_endpoint_ports metric:
* export all relevant port infomation (port name, port number and port protocol) from an endpoint

tests - make endpoint tests endpoint.spec aware:
* endpoint port struct with multiple ports need port names per port
* single port struct doesn't need a port name
* port protocol is per default TCP

Signed-off-by: Constanti, Mario <mario.constanti@daimler.com>
2021-11-09 06:53:03 +01:00
Julian van den Berkmortel 7b6a94cced
Pass through GOOS and GOARCH as environment variables to the container (#1615) 2021-11-08 22:42:13 +01:00
Julian van den Berkmortel 7b185364f4
Specify the arch passed as build arg to the distroless image (#1615) 2021-11-08 18:23:32 +01:00
Damien Grisonnet d20d5658c3 *: rebase v2.2.4 changes on master
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-11-08 18:12:00 +01:00
Kubernetes Prow Robot e2328cf5f0
Merge pull request #1623 from arajkumar/pdb_label_and_annotation
Implement kube_*_labels and kube_*_annotations metrics for pdb
2021-10-28 07:50:27 -07:00
karancode ef3a54641a kustomization for autosharding only 2021-10-27 21:55:58 +09:00
Kubernetes Prow Robot 2724b83160
Merge pull request #1622 from mrueg/update-deps-21-10
Update dependencies and golang to v1.17.2
2021-10-26 21:51:26 -07:00
Manuel Rüger 0338624fad Makefile: Update to golang v1.17.2 2021-10-27 02:37:25 +02:00
Kubernetes Prow Robot 8c8f38464d
Merge pull request #1616 from olivierlemasle/rebase-950
[e2e] check all default collector metrics are available
2021-10-26 17:35:41 -07:00
Manuel Rüger 91929afc51 go.mod: Update dependencies 2021-10-27 02:07:27 +02: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
Kubernetes Prow Robot 25066f254b
Merge pull request #1621 from sandipanpanda/fix-cip-mm-link
Fix broken link of cip-mm in RELEASE.md
2021-10-24 13:52:21 -07:00
sandipanpanda a3d2252bef
Fix broken link of cip-mm in RELEASE.md 2021-10-24 01:10:54 +05:30
Kubernetes Prow Robot b730cb4152
Merge pull request #1595 from mallow111/issue-1593
Issue #1595 ---Part2 --- Add namespace denied list
2021-10-20 12:40:06 -07:00
Min Wang fd183115fb
address comments 2021-10-19 11:20:18 -07:00
Min Wang 853ad1028a
adddress comments 2021-10-19 11:20:18 -07:00
Min Wang bde6d151ef
fix linter check 2021-10-19 11:20:18 -07:00
Min Wang 1d0c17b80e
run make generate 2021-10-19 11:20:18 -07:00
Min Wang c6ec339eea
address comments 2021-10-19 11:20:18 -07:00
Min Wang 6f7b4b1b76
add more test cases 2021-10-19 11:20:17 -07:00
Min Wang 77418c7dba
Add namespace denied list 2021-10-19 11:20:17 -07:00
Kubernetes Prow Robot d116961318
Merge pull request #1610 from ahmed-mez/ahmed/fix-builder-interface
Fix BuilderInterface and BuildStoresFunc to allow using KSM as a library
2021-10-18 09:55:49 -07:00
Ahmed Mezghani 698aee0f46
Improve the fake store 2021-10-18 18:45:32 +02:00
Olivier Lemasle ce2116679e e2e TestDefaultCollectorMetricsAvailable improvements:
- Remove usage of deprecated io/ioutil
- Comply to PR comments
2021-10-18 17:03:41 +02:00
YaoZengzeng eb9aeb35d8 [e2e] check all default collector metrics are available
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
2021-10-18 15:25:14 +02:00
Kubernetes Prow Robot 73ff2068e6
Merge pull request #1611 from fpetkovski/merge-2.2.3
Merge updates from 2.2.3
2021-10-18 05:57:49 -07:00
fpetkovski a3df3c5b9e Prepare release v2.3.3 2021-10-18 14:02:22 +02:00
fpetkovski 967b4fa89f Revert "cloudbuild.yaml: Drop _ prefix for vars"
This reverts commit fdad0b5f62.
2021-10-18 14:02:22 +02:00
fpetkovski 1283a8f6c2 Prepare release v2.2.2 2021-10-18 14:02:22 +02:00
Manuel Rüger 20e7693185 cloudbuild.yaml: Drop _ prefix for vars 2021-10-18 14:02:22 +02:00
Ahmed Mezghani 91adf1f7dd
Typo fix 2021-10-15 14:03:25 +02:00
Ahmed Mezghani da9f39e6cb
Add a test case for builder with custom store 2021-10-15 12:54:52 +02:00
karancode 5262289e90 add root level kustomize 2021-10-14 11:25:11 +09:00
Ahmed Mezghani 73d15e3b6c
Fix BuilderInterface 2021-10-11 18:11:57 +02:00
karancode e4cfaa3f77 add kustomization yaml 2021-10-09 22:05:56 +09:00
Kubernetes Prow Robot 1e9d07bfe1
Merge pull request #1596 from mallow111/add-nsfiler-issue-1593
Issue #1595  --Part1-- Add fieldSelector in listWatchFunc
2021-10-08 04:10:58 -07:00
Kubernetes Prow Robot 50271e7a03
Merge pull request #1600 from arajkumar/improved-unittest-for-pv
test: Improve coverage for persistentvolume annotation/label related metrics
2021-10-08 04:08:58 -07:00
Arunprasad Rajkumar b00b1994ce
test: Improve coverage for persistentvolume annotation/label related metrics
Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-10-08 16:16:56 +05:30
Min Wang 1b2c05c6c9 Add fieldSelector in listWatchFunc 2021-10-04 18:54:51 -07:00
Kubernetes Prow Robot 31b2fff8bd
Merge pull request #1592 from slashpai/add_label
Add app.kubernetes.io/component label
2021-10-01 06:53:23 -07:00
Jayapriya Pai f94b21930f :* Run make examples 2021-10-01 15:50:06 +05:30
Jayapriya Pai fc0e816a2b jsonnet: Add app.kubernetes.io/component label
This was done this way to avoid update failure since matchLabels is an immutable field

Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2021-10-01 15:49:28 +05:30
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
Kubernetes Prow Robot 8dab6f7472
Merge pull request #1591 from mrueg/update-deps-0921
Update dependencies (go + used modules)
2021-09-28 06:18:43 -07:00
Manuel Rüger ca5ad566d1 Makefile: Update promtool to 2.30.1 2021-09-28 14:16:28 +02:00
Manuel Rüger c5b890c49e Update go to 1.17.1 and dependencies 2021-09-28 14:15:26 +02:00
Kubernetes Prow Robot cb9a9b9116
Merge pull request #1583 from mindw/add_pod_image_spec
add image_spec to pod (init)container info
2021-09-28 05:14:42 -07:00
Kubernetes Prow Robot cff82c8764
Merge pull request #1589 from fpetkovski/prepare-release-2.2.1
Prepare release 2.2.1
2021-09-27 06:51:35 -07:00
fpetkovski 0e364c3f79 Update 2.2.0 to 2.2.1 2021-09-27 14:49:21 +02:00
fpetkovski a3ad1ec699 Prepare 2.2.1 2021-09-27 14:47:52 +02:00
Kubernetes Prow Robot b5228e737d
Merge pull request #1584 from nabokihms/vpa-with-no-target-ref
fix: avoid panic because of VPA objects without target ref
2021-09-22 08:34:01 -07:00
m.nabokikh 05b3d3b169 fix: rename k8sautoscaling import to autoscalingv1
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2021-09-22 19:18:12 +04:00
m.nabokikh 8579a68e2f fix: expose metrics for VPA objects with empty target refs
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2021-09-22 15:51:00 +04:00
m.nabokikh c39a3bd585 fix: avoid panic because of VPA objects without target ref
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2021-09-22 15:47:04 +04:00
Gabi Davar 5016cca2de
add image_spec to pod (init)container info 2021-09-21 18:26:50 +03:00
Kubernetes Prow Robot ef612201de
Merge pull request #1559 from fpetkovski/document-autosharding
Improve auto-sharding documentation
2021-09-21 07:10:24 -07:00
Kubernetes Prow Robot 0d86ab6f07
Merge pull request #1581 from mindw/add_configmap_labels_ann
Expose configmap labels and annotations
2021-09-21 06:48:23 -07:00
Gabi Davar 58559bf0cf
put all arguments into one line. 2021-09-21 14:53:23 +03:00
Gabi Davar 41105b6776
fix linter? 2021-09-21 13:41:47 +03:00
Gabi Davar 443c91ae40
Expose configmap labels and annotations 2021-09-21 12:52:40 +03:00
Kubernetes Prow Robot 6a70201516
Merge pull request #1580 from mindw/fix_annotations
fixed four resources with copy/paste issues
2021-09-20 09:06:10 -07:00
Gabi Davar 6512e2ce27
fixed four resources with copy/paste issues
Signed-off-by: Gabi Davar <grizzly.nyo@gmail.com>
2021-09-20 18:18:33 +03:00
Kubernetes Prow Robot 2fed5d99b4
Merge pull request #1578 from arajkumar/use-go-cmp-for-test-diff
test: Use go-cmp package to diff test expectation vs actual
2021-09-16 08:43:45 -07:00
Arunprasad Rajkumar 26a9a66205
test: Use go-cmp package to diff test expectation
Prior to this PR, it is pretty hard and manual to diff the test failure expectation
vs actual. This PR simplifies using github.com/google/go-cmp/cmp
package.

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-09-16 17:28:54 +05:30
Kubernetes Prow Robot 57cd09a95a
Merge pull request #1575 from idsvandermolen/idsvandermolen/issue1573
Add NodeAffinity and Shutdown to podStatusReasons
2021-09-15 06:48:41 -07:00
Ids van der Molen b099ea66cd Document pod status reasons NodeAffinity and Shutdown 2021-09-15 12:53:23 +02:00
Ids van der Molen 69e13ccb74 Add NodeAffinity and Shutdown to podStatusReasons 2021-09-14 20:42:12 +02:00
fpetkovski 8eecd406fc Improve auto-sharding documentation
Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
2021-09-13 13:44:22 +02:00
Damien Grisonnet cf3ff0ebff internal/store: fix pod store unit tests
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-09-06 18:11:41 +02:00
Kubernetes Prow Robot d111b6d8e0
Merge pull request #1566 from arajkumar/fix-pvc-label-annotation
persistentvolumeclaim: Implement annotation and fix label metrics generation
2021-09-01 02:21:00 -07:00
Arunprasad Rajkumar cded74c951
persistentvolumeclaim: Implement annotation and fix label metrics generation
This PR fixes the regression introduced on `kube_persistentvolumeclaim_labels` functionality after https://github.com/kubernetes/kube-state-metrics/pull/1468. This also implements `kube_persistentvolumeclaim_annotations`.

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2021-08-31 22:25:35 +05:30
Kubernetes Prow Robot a3dab11c73
Merge pull request #1565 from PhilipGough/bz-1999446
internal: Migrate HPA API version to autoscaling/v2beta2
2021-08-31 06:59:37 -07:00
Kubernetes Prow Robot c1789ae09e
Merge pull request #1560 from mrueg/go-1.17
go.mod: Bump dependencies, move to go-1.17
2021-08-31 05:01:37 -07: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
Manuel Rüger 7e994c331f go.mod: Bump dependencies, move to go-1.17 2021-08-27 15:46:24 +02:00
Kubernetes Prow Robot a465b976c6
Merge pull request #1556 from pkbhowmick/replace-func
Replace deprecated functions
2021-08-23 23:35:13 -07:00
Pulak Kanti Bhowmick e23338288b Replace deprecated functions in deployment
Signed-off-by: Pulak Kanti Bhowmick <pkbhowmick007@gmail.com>
2021-08-23 23:23:52 +06:00
Kubernetes Prow Robot ac1cd47bdf
Merge pull request #1555 from mrueg/security_contacts
SECURITY_CONTACTS: Add myself as a contact
2021-08-23 06:32:01 -07:00
Manuel Rüger 6388b57859 SECURITY_CONTACTS: Add myself as a contact 2021-08-23 14:47:31 +02:00
Kubernetes Prow Robot d73ee0c18d
Merge pull request #1553 from kubernetes/release-2.2
Merge release 2.2 back to default branch
2021-08-23 05:46:00 -07: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
275 changed files with 20764 additions and 4942 deletions

View File

@ -9,7 +9,7 @@ assignees: ''
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
If the matter is security related, please disclose it privately see https://github.com/kubernetes/kube-state-metrics/blob/master/SECURITY.md
If the matter is security related, please disclose it privately see https://github.com/kubernetes/kube-state-metrics/blob/main/SECURITY.md
-->
**What happened**:
@ -18,10 +18,18 @@ If the matter is security related, please disclose it privately see https://gith
**How to reproduce it (as minimally and precisely as possible)**:
```bash
# An example: https://github.com/kubernetes/kube-state-metrics/issues/2223#issuecomment-1792850276
minikube start
...
go run main.go --custom-resource-state-only --custom-resource-state-config-file ksm-2223/custom-resource-config-file.yaml --kubeconfig ~/.kube/config
```
**Anything else we need to know?**:
**Environment**:
- kube-state-metrics version:
- Kubernetes version (use `kubectl version`):
- Cloud provider or hardware configuration:
- Other info:
* kube-state-metrics version:
* Kubernetes version (use `kubectl version`):
* Cloud provider or hardware configuration:
* Other info:

View File

@ -9,10 +9,10 @@ assignees: ''
<!-- Please only use this template for submitting feature requests -->
**What would you like to be added**:
**What would you like to be added:**
**Why is this needed**:
**Why is this needed:**
**Describe the solution you'd like**
**Describe the solution you'd like:**
**Additional context**
**Additional context:**

View File

@ -5,9 +5,10 @@
4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->
**What this PR does / why we need it**:
<!-- markdownlint-disable-next-line MD041 -->
**What this PR does / why we need it:**
**How does this change affect the cardinality of KSM**: *(increases, decreases or does not change cardinality)*
**How does this change affect the cardinality of KSM:** *(increases, decreases or does not change cardinality)*
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
**Which issue(s) this PR fixes:** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*
Fixes #

14
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
groups:
k8s-dependencies:
patterns:
- "k8s.io*"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@ -3,62 +3,57 @@ name: continuous-integration
on:
push:
branches:
- master
- main
- release*
tags:
- v1.*
- v2.*
pull_request:
branches:
- master
- main
- release*
permissions:
contents: read
env:
E2E_SETUP_KIND: yes
E2E_SETUP_KUBECTL: yes
SUDO: sudo
GO_VERSION: "^1.24"
GOLANGCI_LINT_VERSION: "v2.0.2"
jobs:
ci-go-lint:
name: ci-go-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Lint
run: |
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.40.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${{ env.GOLANGCI_LINT_VERSION }}
make lint
ci-validate-manifests:
name: ci-validate-manifests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Validate generated manifests
run: |
@ -68,19 +63,14 @@ jobs:
name: ci-validate-go-modules
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Validate go modules
run: |
@ -90,21 +80,16 @@ jobs:
name: ci-validate-docs
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ^1.16
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Check that all metrics are documented
- name: Check that all metrics are documented and templates have no delta
run: |
make doccheck
@ -112,19 +97,14 @@ jobs:
name: ci-unit-tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Unit tests
run: |
@ -135,7 +115,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup promtool
run: |
@ -149,41 +129,41 @@ jobs:
name: ci-benchmark-tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Benchmark tests
run: |
make test-benchmark-compare
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare
- run: |
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
cat result.txt >> "$GITHUB_STEP_SUMMARY"
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
cat <<EOL >> "$GITHUB_STEP_SUMMARY"
<hr />
The table shows the median and 95% confidence interval (CI) summaries for each benchmark comparing the HEAD and the BASE, and an A/B comparison under "vs base". The last column shows the statistical p-value with ten runs (n=10).
The last row has the Geometric Mean (geomean) for the given rows in the table.
Refer to <a href="https://pkg.go.dev/golang.org/x/perf/cmd/benchstat">benchstat's documentation</a> for more help.
EOL
ci-build-kube-state-metrics:
name: ci-build-kube-state-metrics
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Build
run: |
@ -193,19 +173,14 @@ jobs:
name: ci-e2e-tests
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup environment
run: |
go get -v -t -d ./...
make install-tools
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: End-to-end tests
run: |

29
.github/workflows/govulncheck.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: govulncheck
on:
schedule:
# Run every Monday
- cron: '0 0 * * 1'
env:
GO_VERSION: "^1.24"
permissions:
contents: read
jobs:
ci-security-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
name: Checkout code
- name: Set up Go 1.x
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Install govulncheck binary
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run security checks
run: |
govulncheck ./...

37
.github/workflows/openvex.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: openvex
on:
workflow_dispatch:
release:
types:
- released
permissions:
contents: read
jobs:
vexctl:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set environment variables
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: openvex/generate-vex@c59881b41451d7ccba5c3b74cd195382b8971fcd
# Refer: https://github.com/openvex/vexctl#operational-model
name: Run vexctl
with:
product: pkg:golang/k8s.io/kube-state-metrics/v2@${{ env.RELEASE_VERSION }}
file: kube-state-metrics.openvex.json
- name: Upload OpenVEX document to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ env.RELEASE_VERSION }} kube-state-metrics.openvex.json

41
.github/workflows/sbom.yaml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Generate SBOM with Kubernetes BOM
on:
release:
types:
- released
permissions:
contents: read
jobs:
sbom:
runs-on: ubuntu-latest
permissions:
contents: write
env:
OUTPUT: sbom.spdx
TAG: ${{ github.event.release.tag_name }}
steps:
- name: Fetch source code into GITHUB_WORKSPACE
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Kubernetes BOM
uses: kubernetes-sigs/release-actions/setup-bom@a30d93cf2aa029e1e4c8a6c79f766aebf429fddb # v0.3.1
- name: Generate SBOM
run: |
bom generate \
--dirs=. \
--image=registry.k8s.io/kube-state-metrics/kube-state-metrics:$TAG \
--namespace=https://github.com/kubernetes/kube-state-metrics/releases/download/$TAG/$OUTPUT \
--output=$OUTPUT
- name: Upload SBOM to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload $TAG $OUTPUT

23
.github/workflows/semantic.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: "Lint pull request title"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
contents: read
jobs:
main:
permissions:
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
name: Validate PR title for semantic commit message
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,29 +1,60 @@
run:
deadline: 2m
version: "2"
linters:
disable-all: true
default: none
enable:
- gocritic
- gocyclo
- gosec
- govet
- ineffassign
- misspell
- promlinter
- revive
- staticcheck
- unconvert
- unused
exclusions:
generated: lax
rules:
- linters:
- promlinter
path: _test\.go
- linters:
- gosec
text: 'G104:'
- linters:
- revive
text: 'package-comments:|var-naming:'
# This needs to stay as long as we support exposing v1.endpoints metrics
- linters:
- staticcheck
text: 'SA1019: v1.Endpoint'
path: 'internal/store/endpoint.*.go|internal/store/builder.go'
# TODO: Use functions with context https://github.com/kubernetes/kube-state-metrics/issues/2721
- linters:
- staticcheck
text: 'SA1019: .*List|Watch'
path: 'pkg/sharding/listwatch.go|pkg/watch/watch.go'
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports
- golint
- staticcheck
- gocyclo
- ineffassign
- misspell
- gocritic
- govet
- unconvert
- promlinter
linters-settings:
goimports:
local-prefixes: k8s.io/kube-state-metrics
issues:
exclude-use-default: false
exclude-rules:
# We don't check metrics naming in the tests.
- path: _test\.go
linters:
- promlinter
settings:
goimports:
local-prefixes:
- k8s.io/kube-state-metrics
- k8s.io/kube-state-metrics/v2
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

19
.markdownlint-cli2.jsonc Normal file
View File

@ -0,0 +1,19 @@
{
"globs": [
"**/*.md"
],
// ToDo: Following rules can't be fixed automatically. They should be enabled when fixed.
"config": {
"MD004": {
"style": "asterisk"
},
"MD013": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md013---line-length
"MD033": {
"allowed_elements": [
"details",
"summary",
"br"
]
}
}
}

View File

@ -0,0 +1,28 @@
# OpenVEX Templates Directory
This directory contains the OpenVEX data for this repository.
The files stored in this directory are used as templates by
`vexctl generate` when generating VEX data for a release or
a specific artifact.
To add new statements to publish data about a vulnerability,
download [vexctl](https://github.com/openvex/vexctl)
and append new statements using `vexctl add`. For example:
```bash
vexctl add --in-place main.openvex.json pkg:oci/test CVE-2014-1234567 fixed
```
That will add a new VEX statement expressing that the impact of
CVE-2014-1234567 is under investigation in the test image. When
cutting a new release, for `pkg:oci/test` the new file will be
incorporated to the relase's VEX data.
## Read more about OpenVEX
To know more about generating, publishing and using VEX data
in your project, please check out the [vexctl repository and
documentation](https://github.com/openvex/vexctl).
OpenVEX also has an [examples repository](https://github.com/openvex/examples)
with samples and docs.

View File

@ -0,0 +1,8 @@
{
"@context": "https://openvex.dev/ns/v0.2.0",
"@id": "https://openvex.dev/docs/public/vex-2912204db7d51d98234a931d600f7cc2dd0bf24a5b5b326de138d64b30c22911",
"author": "vexctl (automated template)",
"timestamp": "2023-12-15T22:55:18.754525+05:30",
"version": 1,
"statements": []
}

View File

@ -1,3 +1,310 @@
# Changelog
## v2.16.0 / 2025-06-23
**Note:**
* This release builds with Golang `v1.24.4`
* This release builds with `k8s.io/client-go`: `v0.32.6`
* [FEATURE] Add a `reclaim_policy` label to the `kube_persistentvolume_info` metric by @SuperQ in <https://github.com/kubernetes/kube-state-metrics/pull/2615>
* [FEATURE] Use dlclark/regexp2 over standard library's package to support lookarounds by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2616>
* [BUGFIX] Report correct values in `kube_pod_status_reason` metric by @carlosmorenokm1 in <https://github.com/kubernetes/kube-state-metrics/pull/2644>
* [FEATURE] Add add `pathType` to `kube_ingress_path` by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2670>
* [FEATURE] Introduce object limits by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2626>
* [BUGFIX] Close reflectors once their corresponding CRDs are dropped by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2672>
* [FEATURE] Incorporate `WithAuthenticationAndAuthorization` to support endpoint authn/z by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2686>
## v2.15.0 / 2025-02-03
**Note:**
* This release builds with Golang `v1.23.5`
* This release builds with `k8s.io/client-go`: `v0.32.1`
* [BUGFIX] Fix CR cache for GVK all specified case by @chelseychen in <https://github.com/kubernetes/kube-state-metrics/pull/2567>
* [BUGFIX] Deduplicate tolerations before creating metric by @RiRa12621 in <https://github.com/kubernetes/kube-state-metrics/pull/2559>
* [BUGFIX] Make `$VERSION` 3rd-party independant by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2572>
* [BUGFIX] Fix NoNodePod naming in jsonnet by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2598>
* [BUGFIX] Panic in `util.GVRFromType` for structured types by @L3n41c in <https://github.com/kubernetes/kube-state-metrics/pull/2553>
* [FEATURE] Add external traffic policy to kube_service_info by @jahantech in <https://github.com/kubernetes/kube-state-metrics/pull/2584>
* [FEATURE] Promote kube_statefulset_ordinals_start from ALPHA -> STABLE by @pwschuurman in <https://github.com/kubernetes/kube-state-metrics/pull/2415>
* [FEATURE] Add timezone to kube_cronjob_info / Make kube_cronjob_next_schedule_time timezone-aware by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2376>
## v2.14.0 / 2024-11-08
**Note:**
* This release builds with Golang `v1.23.3`
* This release builds with `k8s.io/client-go`: `v0.31.2`
* This release removes `kube_endpoint_address_not_ready` and `kube_endpoint_address_available` which have been deprecated in 2022. Please use `kube_endpoint_address`as a replacement.
* [BUGFIX] Use --track-unscheduled-pods to select unscheduled pods in Daemonset sharding by @CatherineF-dev in <https://github.com/kubernetes/kube-state-metrics/pull/2388>
* [BUGFIX] Install tools so VERSION gets set by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2456>
* [BUGFIX] Syntax errors in kube-state-metrics.libsonnet by @jeffmccune in <https://github.com/kubernetes/kube-state-metrics/pull/2454>
* [BUGFIX] Set kube_job_status_failed metric even when there are no job.Status.Conditions present by @richabanker in <https://github.com/kubernetes/kube-state-metrics/pull/2485>
* [BUGFIX] de-duplication of custom resource metrics by @bartlettc22 in <https://github.com/kubernetes/kube-state-metrics/pull/2502>
* [BUGFIX] Configure sharding every time MetricsHandler.Run runs by @wallee94 in <https://github.com/kubernetes/kube-state-metrics/pull/2478>
* [BUGFIX] Panic in `util.GVRFromType` for core objects by @L3n41c in <https://github.com/kubernetes/kube-state-metrics/pull/2535>
* [BUGFIX] Big memory value overflow by @leiwingqueen in <https://github.com/kubernetes/kube-state-metrics/pull/2540>
* [BUGFIX] Expose empty labels by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2539>
* [BUGFIX] CustomResourceMetrics: Convert status condition Unknown to a valid value by @Haleygo in <https://github.com/kubernetes/kube-state-metrics/pull/2536>
* [CHANGE] Remove deprecated endpoint address metric by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2527>
* [FEATURE] Add new metric kube_job_status_suspended by @Indresh2410 in <https://github.com/kubernetes/kube-state-metrics/pull/2542>
* [FEATURE] Move endpoint ports into address metric by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2503>
* [ENHANCEMENT] Use concurrent map when storing metrics by @rarruda in <https://github.com/kubernetes/kube-state-metrics/pull/2510>
## v2.13.0 / 2024-07-18
**Note:**
* This release builds with Golang `v1.22.5`.
* This release builds with `k8s.io/client-go`: `v0.30.3`.
* This release adds read and write timeouts for requests. The defaults might have an impact on scrapes that take a long time.
* [BUGFIX] Pod autosharding: transition from labelselector to fieldselector by @pkoutsovasilis in <https://github.com/kubernetes/kube-state-metrics/pull/2347>
* [ENHANCEMENT] Add automatic detection of memory limits by @SuperQ in <https://github.com/kubernetes/kube-state-metrics/pull/2447>
* [FEATURE] Add `readyz` endpoint by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2442>
* [FEATURE] Add `livez` endpoint by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2418>
* [FEATURE] Add kube_persistentvolume_volume_mode metric by @ricardoapl in <https://github.com/kubernetes/kube-state-metrics/pull/2370>
* [FEATURE] Add read and write timeouts by @Pokom in <https://github.com/kubernetes/kube-state-metrics/pull/2412>
## v2.12.0 / 2024-04-02
**Note:**
* This release addresses a critical issue where scraping the exposition data for certain types caused metrics-backends to crash: <https://github.com/kubernetes/kube-state-metrics/issues/2248>.
* This release builds with `k8s.io/client-go`: `v0.29.3`.
* [BUGFIX] Fallback to `gauge` for `protobuf`-based negotiations by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2270>
* [ENHANCEMENT] Add `kube_pod_container_status_last_terminated_timestamp`by @tetianakravchenko in <https://github.com/kubernetes/kube-state-metrics/pull/2291>
* [FEATURE] Allow prefixing expandable paths by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2052>
## v2.11.0 / 2024-03-04
**Note:**
This release builds with Golang `v1.21.8`.
* [ENHANCEMENT] Add OpenSSF Scorecard to README by @dalehenries in <https://github.com/kubernetes/kube-state-metrics/pull/2277>
* [ENHANCEMENT] Generate OpenVX data for every release by @shafeeqes in <https://github.com/kubernetes/kube-state-metrics/pull/2276>
* [ENHANCEMENT] Add restartPolicy to `kube_pod_init_container_info` metric by @changhyuni in <https://github.com/kubernetes/kube-state-metrics/pull/2240>
* [FEATURE] Add `kube_node_status_addresses` metric by @stonith in <https://github.com/kubernetes/kube-state-metrics/pull/2252>
* [FEATURE] Add namespace label to `endpointslice` metrics by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2266>
* [FEATURE] Add opt-in `kube_persistentvolume_csi_attributes` metric by @machadovilaca in <https://github.com/kubernetes/kube-state-metrics/pull/2133>
* [FEATURE] Add new metric `kube_pod_scheduler` metric by @adinhodovic in <https://github.com/kubernetes/kube-state-metrics/pull/2222>
* [FEATURE] Support filtering annotations allow-list by `*` by @xonvanetta in <https://github.com/kubernetes/kube-state-metrics/pull/2234>
* [ENHANCEMENT] Support scraping pod metrics that are still in scheduling status and have no assigned nodes by @mickeyzzc in <https://github.com/kubernetes/kube-state-metrics/pull/2217>
* [FEATURE] Add backend resource info for `kube_ingress_path` by @rohitphatak in <https://github.com/kubernetes/kube-state-metrics/pull/2109>
## v2.10.1 / 2023-10-09
**Note:**
* This release addresses a regression introduced in [#2105](https://github.com/kubernetes/kube-state-metrics/pull/2105).
* [BUGFIX] Remove FieldSelector from non-namespaced resources by @mrueg and @dgrisonnet in [#2190](https://github.com/kubernetes/kube-state-metrics/pull/2190)
* [ENHANCEMENT] Bump Go to v1.20.8
## v2.10.0 / 2023-08-31
**Note:**
* Label and annotation metrics aren't exposed by default anymore to reduce the memory usage of the default configuration of kube-state-metrics. Before this change, they used to only include the name and namespace of the objects which is not relevant to users not opting in these metrics.
* [BUGFIX] Log no _info suffix in name only once per reading the configuration for custommetrics by @chrischdi in <https://github.com/kubernetes/kube-state-metrics/pull/2157>
* [BUGFIX] Don't crash on non-existent valueFrom path values by @chihshenghuang in <https://github.com/kubernetes/kube-state-metrics/pull/2140>
* [BUGFIX] Index out of range in metrics_store.SanitizeHeaders by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2166>
* [BUGFIX] Always extract the headers but only write it when we have custommetrics by @chrischdi in <https://github.com/kubernetes/kube-state-metrics/pull/2154>
* [BUGFIX] Add filtering for Lease metrics by @ntoofu in <https://github.com/kubernetes/kube-state-metrics/pull/2122>
* [FEATURE] Implement kube_pod_status_initialized_time by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2148>
* [FEATURE] Disable labels and annotations metrics when metric-annotations-… by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2145>
* [FEATURE] Add webhooks client config service metrics by @dgrisonnet in <https://github.com/kubernetes/kube-state-metrics/pull/2114>
* [FEATURE] Support kube_persistentvolumeclaim_deletion_timestamp by @maxime1907 in <https://github.com/kubernetes/kube-state-metrics/pull/2074>
* [FEATURE] Support kube_persistentvolume_deletion_timestamp by @maxime1907 in <https://github.com/kubernetes/kube-state-metrics/pull/2075>
* [FEATURE] Adds new metric `kube_pod_service_account` by @swarup-stripe in <https://github.com/kubernetes/kube-state-metrics/pull/2096>
* [FEATURE] Add volumemode to PVC info metric by @machadovilaca in <https://github.com/kubernetes/kube-state-metrics/pull/2134>
* [FEATURE] Enable metric-annotations-allowlist and metric-labels-allowlist for ResourceQuota by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2175>
* [FEATURE] Allow field KV general matching by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2067>
* [FEATURE] Support hot reload for kubeconfig by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2144>
* [FEATURE] Add support for endpoint topology routing hints by @MarkSRobinson in <https://github.com/kubernetes/kube-state-metrics/pull/2090>
## v2.9.2 / 2023-05-30
This release does not incorporate any user-facing changes. Re-running release procedures as the process for the previous release failed. Changes are listed in v2.9.0.
## v2.9.1 / 2023-05-29
This release does not incorporate any user-facing changes. Re-running release procedures as the process for the previous release failed. Changes are listed in v2.9.0.
## v2.9.0 / 2023-05-23
The changes mentioned below are only the user-facing ones. For a list of the complete set of changes, refer the changelog associated with the release tag.
**Note:**
* The deprecated experimental VerticalPodAutoscaler metrics are no longer supported, and have been removed. We recommend to use CustomResourceState metrics to gather metrics from custom resources like the Vertical Pod Autoscaler.
* #2004 regulated label names to adhere with [OTel-Prometheus standards](https://github.com/open-telemetry/opentelemetry-specification/blob/8946dfc6a2302f78b0224fcc3f4dfb816a7bb1f4/specification/compatibility/prometheus_and_openmetrics.md?plain=1#L224-L229), so existing label names that do not follow the same may be replaced by the ones that do. Please refer to the PR for more details.
* [BUGFIX] Adhere to OTel-Prometheus standard for labels #2004 @rexagod
* [BUGFIX] Respect relative paths for label resolutions #2007 @rexagod
* [BUGFIX] Support LabelsFromPath functionality for Info-typed metrics #2048 @murphd40
* [CHANGE] Remove VerticalPodAutoscaler #2017 @mrueg
* [ENHANCEMENT] Add StatefulSet Start Ordinal metrics for KEP-3335 #1959 @pwschuurman
* [ENHANCEMENT] Add namespace label to `kube_lease_renew_time` #2073 @A-Hilaly
* [ENHANCEMENT] Add parameters for PodSecurity #2042 @jcpunk
* [ENHANCEMENT] Add support for multi cluster prometheus alerts #2058 @jkroepke
* [ENHANCEMENT] Don't crash on non-existent path values #1998 @rexagod
* [ENHANCEMENT] Only use OpenMetrics and Text in contentType #2024 @CatherineF-dev
* [ENHANCEMENT] Update go version to 1.20.4 #2056 @RamakrishnanArun
* [FEATURE] Add support for variable VKs in CRS config #1851 @rexagod
* [FEATURE] Support quantities and percentages #1989 @mrueg
* [FEATURE] Use prometheus/exporter-toolkit landing page #2034 @mrueg
## v2.8.2 / 2023-03-17
* [BUGFIX] Only use OpenMetrics and Text in contentType #2024 @CatherineF-dev
## v2.8.1 / 2023-02-22
* [BUGFIX] Don't crash on non-existent paths @rexagod #1998
* [BUGFIX] Fix public Builder compatibility with BuilderInterface @clamoriniere #1994
## v2.8.0 / 2023-02-10
Note: The `--version` flag was removed as `kube-state-metrics version` also provides the same information. See #1956
Note: Experimental CustomResourceState changed their labels for better usability. See #1942
kube_crd_uptime{group="myteam.io", kind="Foo", version="v1"} -> kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"}
* [CHANGE] Prefix Group, Version and Kind labels for CustomResourceState Metrics #1942 @bavarianbidi
* [CHANGE] Fix empty string for "owner_\*" dimensions #1923 @pawcykca
* [CHANGE] Remove broken --version flag, replace by version command #1956 @bjorand
* [FEATURE] Add metrics for EndpointSlices #1910 @mrueg
* [FEATURE] Add metrics for config file changes #1916 @mrueg
* [FEATURE] Add metrics for CustomResource State config file change #1928 @mrueg
* [FEATURE] Reload Kube-State-Metrics on CustomResourceState config file change #1930 @mrueg
* [FEATURE] Make CustomResourceState metrics type dynamic #1930 @rexagod
* [FEATURE] Add kube_pod_status_qos_class to pod metrics #1932 @frezes
* [FEATURE] Add kube_pod_status_ready_time and kube_pod_status_containers_ready_time metrics #1938 @ryanrolds
* [FEATURE] Enrich UserAgent with more information about kube-state-metrics #1960 @mrueg
* [FEATURE] Convert True/False to 1.0/0.0 values in CustomResourceState metrics #1963 @jabdoa2
* [FEATURE] Expose metrics in OpenMetrics format #1974 @mrueg
* [BUGFIX] Handle unit length `valueFrom` values #1958 @rexagod
* [ENHANCEMENT] Build with kubernetes 1.26 #1933 @mrueg
## v2.7.0 / 2022-11-25
Note: Experimental VerticalPodAutoscaler metrics are considered deprecated in this release and will be removed in v2.9.0.
Please use CustomResourceStateMetrics to gather metrics from VPA resources. See: #1718
Note: Experimental CustomResourceState changed their naming convention for better usability.
The name of the CRD used to be interpolated into the name of the metric which made it impossible to aggregate a CRD across different versions.
This was changed to have the GVK information represented as labels:
kube_myteam_io_v1_Foo_uptime -> kube_crd_uptime{group="myteam.io", kind="Foo", version="v1"}
See: #1847
* [CHANGE] Deprecate VerticalPodAutoscaler metrics #1835 @rexagod
* [CHANGE] Recommend kube-scheduler metrics for container resource limits and requests #1849 @rexagod
* [FEATURE] Add experimental kube_pod_container_status_last_terminated_exitcode metric #1752 @ssabo
* [FEATURE] Introduce custom-resources-only flag #1813 @bavarianbidi
* [FEATURE] Allow allowlist filtering by wildcard key #1823 @rexagod
* [FEATURE] Add ContainerResourceSourceType to hpa spec and target metrics #1831 @whitebear009
* [FEATURE] Represent group, version and kind of a resource as labels #1850 @rexagod
* [FEATURE] Sharding metrics per node via fieldSelector #1864 @CatherineF-dev
* [FEATURE] Add experimental StatefulSet retention policy metrics #1876 @mattcary
* [FEATURE] Allow labelFromKey field for all applicable metric types #1880 @rexagod
* [FEATURE] Introduce Viper, allow hot-reload on config change #1827 @rexagod
* [FEATURE] Introduce Cobra, allow configuration via environment variables #1834 @rexagod
* [FEATURE] Add experimental kube_node_deletion_timestamp metric #1890 @rexagod
* [FEATURE] Support autoscaling/v2 resources for HorizontalPodAutoscaler #1906 @JoaoBraveCoding
* [FEATURE] Add IngressClass metrics #1905 @kaitoii11
* [ENHANCEMENT] Import Kubernetes metrics stability framework #1844 @CatherineF-dev
* [ENHANCEMENT] Promote kube_pod_container_status_waiting_reason and kube_deployment_status_replicas_ready to stable #1821 @CatherineF-dev
* [ENHANCEMENT] Build with Kubernetes 1.25 and go 1.19 #1819 @mrueg
* [BUGFIX] Handle singular labels in allowlist #1826 @rexagod
* [BUGFIX] Do not expose ingress path metric when service is nil #1841 @evir35
* [BUGFIX] Allow lease metrics to be exported across all namespaces #1845 @lantingchiang
## v2.6.0 / 2022-08-26
* [FEATURE] Add local storage labels to kube_persistentvolume_info #1814 @nabokihms
* [FEATURE] Add support for StateSet and Info metrics for Custom-Resource State #1777 @chrischdi
* [FEATURE] Add support for Rolebinding resource metrics #1799 @kaitoii11
* [FEATURE] Add new kube_horizontalpodautoscaler_status_target_metric #1725 @tanguyfalconnet
* [FEATURE] Add support for Role and Clusterrole resource metrics #1759 @kaitoii11
* [FEATURE] Add support for the ServiceAccount resource metrics #1773 @Serializator
* [FEATURE] Add metric for pod tolerations #1769 @Serializator
* [FEATURE] Add new kube_endpoint_address metric #1761 @bavarianbidi
* [FEATURE] Support reading the timestamp fields of custom resources #1766 @dontan001
* [ENHANCEMENT] Migrate to structured logging #1807 @dmpe
* [ENHANCEMENT] Switch registry vanity domain from k8s.gcr.io to registry.k8s.io #1750 @mrueg
* [ENHANCEMENT] Graduate new endpoint metrics to stable #1812 @bavarianbidi
* [BUGFIX] Fix label name for kube_pod_nodeselector #1756 @yosshi825
* [BUGFIX] Fix Custom-Resource State Metrics not to contain underscores #1754 @chrischdi
* [BUGFIX] Fix kube_node_status_allocatable unit doc #1760 @jumbosushi
## v2.5.0 / 2022-06-03
* [FEATURE] Add experimental Custom-Resource State Metrics #1710 @iamnoah
* [FEATURE] Add kube_pod_ips metric #1740 @bjschafer
* [FEATURE] Add kube_pod_nodeselector metric #1675 @geojaz
* [FEATURE] Add CSIPersistentVolumeSource to persistent volume metric #1727 @luke-sprig
* [FEATURE] Add kube_cronjob_status_last_successful_time metric #1732 @splitice
* [FEATURE] Add kube_persistentvolumeclaim_created metric #1741 @aidan-ogorman-dev
* [ENHANCEMENT] Build with Go 1.18 #1726, #1745 @mrueg
* [ENHANCEMENT] Bump kubernetes 1.24 and other go dependencies #1726, #1743 @mrueg
* [ENHANCEMENT] Update x/crypto to mitigate CVE-2022-27191 #1721 @pgvishnuram
* [BUGFIX] Assert that newlines in comma separated arguments are ignored #1706 @sthaha
* [BUGFIX] Fix potential panic in pod store #1723 @mfojtik
* [BUGFIX] Fix potential panic in internal store #1731 @jan--f
* [BUGFIX] Properly initialize KSM Server test #1699 @fpetkovski
## v2.4.2 / 2022-02-10
* [BUGFIX] Publish images with with the correct tag
## v2.4.1 / 2022-02-10
* [FEATURE] Add `ingressclass` label to `kube_ingress_info` metric #1652 @adammw
* [FEATURE] Extend KSM library to support custom resource metrics #1644 @Garrybest
* [ENHANCEMENT] Use apiVersion `v1` for `PodDisruptionBudget` and `CronJob` resources #1491 @bison
* [ENHANCEMENT] Optimize slice allocations #1676 @sherifabdlnaby
* [BUGFIX] Use plural form of resource name in `allowlist` for PodDisruptionBudget #1653 @arajkumar
## v2.3.0 / 2021-12-09
* [FEATURE] Add a `--namespace-denylist` command line flag to exclude metrics from certain namespaces #1596 #1595 @mallow111
* [FEATURE] Add `kube_*_labels` and `kube_*_annotations` metrics for Pod Disruption Budgets #1623 @arajkumar
* [FEATURE] Add a Kustomization file for deploying KSM in authosharding mode #1603 @karancode
* [FEATURE] Expose a metric for the number of ports in endpoint objects #1571 @bavarianbidi
* [FEATURE] Add a command line flag for opt-in metrics #1643 @Serializator
* [FEATURE] Add `kube_horizontalpodautoscaler_info` metric #1648 @Serializator
* [ENHANCEMENT] Update Go to 1.17.4 #1649 @fpetkovski
* [ENHANCEMENT] Update Kubernetes to 1.23 #1649 @fpetkovski
* [BUGFIX] Report the correct architecture for arm64 images #1629 @Serializator
## v2.2.4 / 2021-11-08
* [BUGFIX] Fix BuilderInterface and BuildStoresFunc to allow using KSM as a library #1618 @ahmed-mez
## v2.2.3 / 2021-10-13
* [BUGFIX] Fix the image build job. Reverts #1602
## v2.2.2 / 2021-10-13
* [BUGFIX] Downgrade latest allowed go version to 1.16.9 #1601 @mrueg
* [BUGFIX] Fix CI variable names used for building KSM images @mrueg
## v2.2.1 / 2021-09-24
* [FEATURE] Add the kube_persistentvolumeclaim_annotations metric which exposes annotations on PVCs #1566 @arajkumar
* [BUGFIX] Revert the accidentally removed kube_persistentvolumeclaim_labels metric #1566 @arajkumar
* [BUGFIX] Filter annotations in metrics based on `--metric-annotations-allowlist` instead of `--metric-labels-allowlist` for
CronJob, Daemonset, HPA and Ingress resources #1580 @midnw
* [BUGFIX] Avoid panicking when VPA objects have no targetRef #1584 @nabokihms
## v2.2.0 / 2021-08-24
* [FEATURE] Add --use-apiserver-cache flag to set resourceVersion=0 for ListWatch requests #1548
@ -60,6 +367,7 @@ Location on quay.io will not be updated anymore. Previously pushed images will b
* [BUGFIX] Propagate resource version when sharded #1402
## v2.0.0-beta / 2020-12-04
Promotion to beta release after a period of no bugs.
## v2.0.0-alpha.3 / 2020-11-19
@ -82,69 +390,68 @@ kube_pod_container_resource_requests and kube_pod_container_resource_limits
* [CHANGE] Update go module path to k8s.io/kube-state-metrics/v2 #1238
* [CHANGE] Bump klog to v2 and client-go to 1.19 #1250
* [FEATURE] Add iscsi initiator name to persistentvolume_info #1235
* [BUGFIX] Added Namespace to Rolebinding Jsonnet #1233
* [BUGFIX] Reference closure scoped family generator #1240
* [FEATURE] Add iscsi initiator name to persistentvolume_info #1235
* [BUGFIX] Added Namespace to Rolebinding Jsonnet #1233
* [BUGFIX] Reference closure scoped family generator #1240
## v2.0.0-alpha / 2020-09-16
NOTE: This is a major new alpha 2.0 release with breaking changes and removed metrics. See details below!
* [CHANGE] Apply boundaries to metrics and allow via flag (--labels-allow-list) what labels to include #1125
* [CHANGE] Apply boundaries to metrics and allow via flag (--labels-allow-list) what labels to include #1125
* [CHANGE] Update DaemonSet updated_number_scheduled metric name to be consistent #1181
Metric was changed from kube_daemonset_updated_number_scheduled to kube_daemonset_status_updated_number_scheduled
Metric was changed from kube_daemonset_updated_number_scheduled to kube_daemonset_status_updated_number_scheduled
* [CHANGE] Rework resource metrics #1168
Metrics kube_pod_container_resource_requests, kube_pod_container_resource_limits, kube_pod_overhead, kube_pod_init_container_resource_limits, kube_pod_init_container_resource_requests changed
* [CHANGE] Convert k8s labels to snake case #1165
* [CHANGE] Mutatingwebhookconfiguration.go: Switch to v1 #1144
* [CHANGE] Convert k8s labels to snake case #1165
* [CHANGE] Mutatingwebhookconfiguration.go: Switch to v1 #1144
* [CHANGE] v2: Rename storage class labels reclaimPolicy to reclaim_policy and volumeBindingMode to volume_binding_mode #1107
* [CHANGE] v2: Renamed --namespace flag to --namespaces #1098
* [CHANGE] Rename kube_pod_deleted to kube_pod_deletion_timestamp #1079
* [CHANGE] v2: Rename collector flag to resource flag #1006
--resources is the new flag
* [CHANGE] Remove non-identifying labels from pod metrics #1009
* [CHANGE] Remove non-identifying labels from pod metrics #1009
* [CHANGE] v2: Remove deprecated stable metrics #1004
Note that some of these were replaced with EXPERIMENTAL resource metrics. See #1168 for more details.
`kube_pod_container_resource_requests` and `kube_pod_container_resource_limits` are the replacements with `resource` labels
representing the resource name and `unit` labels representing the resource unit.
- kube_pod_container_resource_requests_cpu_cores
- kube_pod_container_resource_limits_cpu_cores
- kube_pod_container_resource_requests_memory_bytes
- kube_pod_container_resource_limits_memory_bytes
- `kube_node_status_capacity` and `kube_node_status_allocatable` are the replacements with `resource` labels
* kube_pod_container_resource_requests_cpu_cores
* kube_pod_container_resource_limits_cpu_cores
* kube_pod_container_resource_requests_memory_bytes
* kube_pod_container_resource_limits_memory_bytes
* `kube_node_status_capacity` and `kube_node_status_allocatable` are the replacements with `resource` labels
representing the resource name and `unit` labels representing the resource unit.
- kube_node_status_capacity_pods
- kube_node_status_capacity_cpu_cores
- kube_node_status_capacity_memory_bytes
- kube_node_status_allocatable_pods
- kube_node_status_allocatable_cpu_cores
- kube_node_status_allocatable_memory_bytes
* kube_node_status_capacity_pods
* kube_node_status_capacity_cpu_cores
* kube_node_status_capacity_memory_bytes
* kube_node_status_allocatable_pods
* kube_node_status_allocatable_cpu_cores
* kube_node_status_allocatable_memory_bytes
* [CHANGE] Rename black-/whitelist to allow/deny-list #1045
New flags are --metric-allowlist and --metric-denylist
* [CHANGE] Update telemetry port to 8081 #1049
* [CHANGE] v2: Rename hpa metrics to use full horizontalpodautoscaler #1003
* [CHANGE] Update telemetry port to 8081 #1049
* [CHANGE] v2: Rename hpa metrics to use full horizontalpodautoscaler #1003
All metrics with prefix of kube_hpa_ were renamed to kube_horizontalpodautoscaler_
* [CHANGE] v2: change metrics port to 8080, telemetry port to 8081 #1005
* [CHANGE] v2: change metrics port to 8080, telemetry port to 8081 #1005
* [FEATURE] Add http request metric for kube-state-metrics main /metrics #1218
* [FEATURE] Add fc/iscsi/nfs identifier tags to persistentvolume_info metric #1208
* [FEATURE] Adds new pod metric kube_pod_container_state_started #1183
* [FEATURE] Add fc/iscsi/nfs identifier tags to persistentvolume_info metric #1208
* [FEATURE] Adds new pod metric kube_pod_container_state_started #1183
* [FEATURE] Add observedGeneration metric (kube_daemonset_status_observed_generation) for DaemonSets #1178
* [FEATURE] Add internal_ip to node_info #1172
* [FEATURE] Avoid conflicts when mapping Kubernetes labels to Prometheus labels #1156
* [FEATURE] Add internal_ip to node_info #1172
* [FEATURE] Avoid conflicts when mapping Kubernetes labels to Prometheus labels #1156
* [FEATURE] Add aws/gce volume id to kube_persistentvolume_info #1146
* [FEATURE] Add UnexpectedAdmissionError to kube_pod_status_reason metric #1145
* [FEATURE] Add init container requests (kube_pod_init_container_resource_requests) #1123
* [FEATURE] Add host_network to kube_pod_info #1100
* [FEATURE] Add kube_replicationcontroller_owner #1058
* [FEATURE] Pod: add gauges for pod overhead (kube_pod_overhead) #1053
* [FEATURE] Add "Terminating" status in kube_pod_status_phase metrics #1013
* [FEATURE] Add lease collector metrics #1038
* [FEATURE] Add host_network to kube_pod_info #1100
* [FEATURE] Add kube_replicationcontroller_owner #1058
* [FEATURE] Pod: add gauges for pod overhead (kube_pod_overhead) #1053
* [FEATURE] Add "Terminating" status in kube_pod_status_phase metrics #1013
* [FEATURE] Add lease collector metrics #1038
* [ENHANCEMENT] Add DeprecatedVersion to struct FamilyGenerator and func NewFamilyGenerator #1160
* [ENHANCEMENT] Add security context to deployment and statefulset #1034
* [ENHANCEMENT] Add security context to deployment and statefulset #1034
* [BUGFIX] Fix VolumeAttachment API version mismatch: expected v1 but watching v1beta1 #1136
* [BUGFIX] Fix various CI issues (kube_volumeattachment_info nodeName -> node label rename) #1117
* [BUGFIX] Fix maxUnavailable to round down instead up #1076
* [BUGFIX] Fix various CI issues (kube_volumeattachment_info nodeName -> node label rename) #1117
* [BUGFIX] Fix maxUnavailable to round down instead up #1076
## v1.9.7 / 2020-05-24

View File

@ -6,21 +6,49 @@ _As contributors and maintainers of this project, and in the interest of fosteri
## Getting Started
We have full documentation on how to get started contributing here:
We have full documentation on how to get started contributing here:
<!---
If your repo has certain guidelines for contribution, put them here ahead of the general k8s resources
-->
### Semantic Commit Messages
- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md) - Common resources for existing developers
We use [semantic commit messages](https://www.conventionalcommits.org/en/v1.0.0/) in this repository.
They follow this format: `<type>[optional scope]: <description>`
Examples for commit messages following this are:
`feat: allow provided config object to extend other configs`
You can also include a scope within parenthesis:
`fix(scope): Prevent wrong calculation of storage`
Here's a list of types that we use:
| Type | Explanation |
|---|---|
| feat | A new feature |
| fix | A bug fix |
| docs | Documentation only changes |
| style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| refactor | A code change that neither fixes a bug nor adds a feature |
| perf | A code change that improves performance |
| test | Adding missing tests or correcting existing tests |
| build |Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| chore | Other changes that don't modify src or test files |
| revert | Reverts a previous commit |
### Further Information
* [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
* [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
* [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md) - Common resources for existing developers
## Mentorship
- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
* [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
## Contact Information
- [Join Slack](http://slack.k8s.io) to sign up and join the Kubernetes Slack. Please make sure to read our [Slack Guidelines](https://github.com/kubernetes/community/blob/master/communication/slack-guidelines.md) before participating.
- The [kube-state-metrics slack channel](https://kubernetes.slack.com/messages/CJJ529RUY) provides an effective communication platform to reach out to members and other users of the project. It offers an alternative to submitting a GitHub issue for when you have questions and issues.
* [Join Slack](http://slack.k8s.io) to sign up and join the Kubernetes Slack. Please make sure to read our [Slack Guidelines](https://github.com/kubernetes/community/blob/master/communication/slack-guidelines.md) before participating.
* The [kube-state-metrics slack channel](https://kubernetes.slack.com/messages/CJJ529RUY) provides an effective communication platform to reach out to members and other users of the project. It offers an alternative to submitting a GitHub issue for when you have questions and issues.

View File

@ -1,5 +1,6 @@
ARG GOVERSION=1.16
FROM golang:${GOVERSION} as builder
ARG GOVERSION=1.24
ARG GOARCH
FROM golang:${GOVERSION} AS builder
ARG GOARCH
ENV GOARCH=${GOARCH}
WORKDIR /go/src/k8s.io/kube-state-metrics/
@ -7,7 +8,7 @@ COPY . /go/src/k8s.io/kube-state-metrics/
RUN make build-local
FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static-debian12:latest-${GOARCH}
COPY --from=builder /go/src/k8s.io/kube-state-metrics/kube-state-metrics /
USER nobody

19
MAINTAINER.md Normal file
View File

@ -0,0 +1,19 @@
# Maintaining kube-state-metrics
kube-state-metrics is welcoming contributions from the community. If you are interested in intensifying your contributions and becoming a maintainer, this doc describes the necessary steps.
As part of the Kubernetes project, we rely on the [community membership process](https://github.com/kubernetes/community/blob/master/community-membership.md). We do not adhere strictly to the numbers of contributions and reviews. Still as becoming a maintainer is a trust-based process and we desire positive outcomes for the project, we look for a long-term interest and engagement.
## Adding a new reviewer
* Ensure the new reviewer is a member of the [kubernetes organization](https://github.com/kubernetes/org/blob/main/config/kubernetes/org.yaml).
* Add the new reviewer to the [OWNERS](OWNERS) file to be able to review pull requests.
* Add the new reviewer to the [kube-state-metrics-maintainers group](https://github.com/kubernetes/org/blob/main/config/kubernetes/sig-instrumentation/teams.yaml), to gain write access to the kube-state-metrics repository (e.g. for creating new releases).
## Adding a new approver
* Ensure the new approver is already a reviewer in the [OWNERS](OWNERS) file.
* Add the new approver to the [OWNERS](OWNERS) file to be able to approve pull requests.
* Add the new approver to the [SECURITY_CONTACTS](SECURITY_CONTACTS) file to be able to get notified on security related incidents.
* Add the new approver to the [kube-state-metrics-admin group](https://github.com/kubernetes/org/blob/main/config/kubernetes/sig-instrumentation/teams.yaml), to get admin access to the kube-state-metrics repository.
* Add the new approver to the k8s.io [OWNERS](https://github.com/kubernetes/k8s.io/blob/main/k8s.gcr.io/images/k8s-staging-kube-state-metrics/OWNERS) file to be able to approve image promotion from the staging registry.

View File

@ -2,12 +2,10 @@ FLAGS =
TESTENVVAR =
REGISTRY ?= gcr.io/k8s-staging-kube-state-metrics
TAG_PREFIX = v
VERSION = $(shell cat VERSION)
VERSION = $(shell grep '^version:' data.yaml | grep -oE "[0-9]+.[0-9]+.[0-9]+")
TAG ?= $(TAG_PREFIX)$(VERSION)
LATEST_RELEASE_BRANCH := release-$(shell grep -ohE "[0-9]+.[0-9]+" VERSION)
LATEST_RELEASE_BRANCH := release-$(shell echo $(VERSION) | grep -ohE "[0-9]+.[0-9]+")
BRANCH = $(strip $(shell git rev-parse --abbrev-ref HEAD))
DOCKER_CLI ?= docker
PROMTOOL_CLI ?= promtool
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /tests/e2e)
ARCH ?= $(shell go env GOARCH)
BUILD_DATE = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
@ -15,12 +13,21 @@ GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
OS ?= $(shell uname -s | tr A-Z a-z)
ALL_ARCH = amd64 arm arm64 ppc64le s390x
PKG = github.com/prometheus/common
PROMETHEUS_VERSION = 2.28.1
GO_VERSION = 1.16.6
PROMETHEUS_VERSION = 3.4.1
GO_VERSION = 1.24.4
IMAGE = $(REGISTRY)/kube-state-metrics
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
USER ?= $(shell id -u -n)
HOST ?= $(shell hostname)
MARKDOWNLINT_CLI2_VERSION = 0.18.1
DOCKER_CLI ?= docker
PROMTOOL_CLI ?= promtool
GOMPLATE_CLI ?= go tool github.com/hairyhenderson/gomplate/v4/cmd/gomplate
GOJSONTOYAML_CLI ?= go tool github.com/brancz/gojsontoyaml
EMBEDMD_CLI ?= go tool github.com/campoy/embedmd
JSONNET_CLI ?= go tool github.com/google/go-jsonnet/cmd/jsonnet
JB_CLI ?= go tool github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
export DOCKER_CLI_EXPERIMENTAL=enabled
@ -41,20 +48,24 @@ licensecheck:
exit 1; \
fi
lint: shellcheck licensecheck
lint: shellcheck licensecheck lint-markdown-format
golangci-lint run
doccheck: generate
lint-fix: fix-markdown-format
golangci-lint run --fix -v
doccheck: generate validate-template
@echo "- Checking if the generated documentation is up to date..."
@git diff --exit-code
@echo "- Checking if the documentation is in sync with the code..."
@grep -hoE -d skip '\| kube_[^ |]+' docs/* --exclude=README.md | sed -E 's/\| //g' | sort -u > documented_metrics
@grep -rhoE '\| kube_[^ |]+' docs/metrics/* --exclude=README.md | sed -E 's/\| //g' | sort -u > documented_metrics
@find internal/store -type f -not -name '*_test.go' -exec sed -nE 's/.*"(kube_[^"]+)".*/\1/p' {} \; | sort -u > code_metrics
@diff -u0 code_metrics documented_metrics || (echo "ERROR: Metrics with - are present in code but missing in documentation, metrics with + are documented but not found in code."; exit 1)
@echo OK
@rm -f code_metrics documented_metrics
@echo "- Checking for orphan documentation files"
@cd docs; for doc in *.md; do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
@cd docs; for doc in $$(find metrics/* -name '*.md' | sed 's/.*\///'); do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
@echo OK
build-local:
@ -63,7 +74,8 @@ build-local:
build: kube-state-metrics
kube-state-metrics:
${DOCKER_CLI} run --rm -v "${PWD}:/go/src/k8s.io/kube-state-metrics" -w /go/src/k8s.io/kube-state-metrics golang:${GO_VERSION} make build-local
# Need to update git setting to prevent failing builds due to https://github.com/docker-library/golang/issues/452
${DOCKER_CLI} run --rm -v "${PWD}:/go/src/k8s.io/kube-state-metrics" -w /go/src/k8s.io/kube-state-metrics -e GOOS=$(OS) -e GOARCH=$(ARCH) golang:${GO_VERSION} git config --global --add safe.directory "*" && make build-local
test-unit:
GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(ARCH) $(TESTENVVAR) go test --race $(FLAGS) $(PKGS)
@ -74,12 +86,24 @@ test-rules:
shellcheck:
${DOCKER_CLI} run -v "${PWD}:/mnt" koalaman/shellcheck:stable $(shell find . -type f -name "*.sh" -not -path "*vendor*")
lint-markdown-format:
${DOCKER_CLI} run -v "${PWD}:/workdir" davidanson/markdownlint-cli2:v${MARKDOWNLINT_CLI2_VERSION} --config .markdownlint-cli2.jsonc
fix-markdown-format:
${DOCKER_CLI} run -v "${PWD}:/workdir" davidanson/markdownlint-cli2:v${MARKDOWNLINT_CLI2_VERSION} --fix --config .markdownlint-cli2.jsonc
generate-template:
${GOMPLATE_CLI} -d config=./data.yaml --file README.md.tpl > README.md
validate-template: generate-template
git diff --no-ext-diff --quiet --exit-code README.md
# Runs benchmark tests on the current git ref and the last release and compares
# the two.
test-benchmark-compare:
@git fetch
./tests/compare_benchmarks.sh master
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH}
./tests/compare_benchmarks.sh main 2
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH} 2
all: all-container
@ -116,10 +140,10 @@ clean:
e2e:
./tests/e2e.sh
generate: build-local
generate: build-local generate-template
@echo ">> generating docs"
@./scripts/generate-help-text.sh
embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print`
${EMBEDMD_CLI} -w `find . -path ./vendor -prune -o -name "*.md" -print`
validate-manifests: examples
@git diff --exit-code
@ -128,29 +152,31 @@ mixin: examples/prometheus-alerting-rules/alerts.yaml
examples/prometheus-alerting-rules/alerts.yaml: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/mixin.jsonnet scripts/vendor
mkdir -p examples/prometheus-alerting-rules
jsonnet -J scripts/vendor scripts/mixin.jsonnet | gojsontoyaml > examples/prometheus-alerting-rules/alerts.yaml
${JSONNET_CLI} -J scripts/vendor scripts/mixin.jsonnet | ${GOJSONTOYAML_CLI} > examples/prometheus-alerting-rules/alerts.yaml
examples: examples/standard examples/autosharding mixin
examples: examples/standard examples/autosharding examples/daemonsetsharding mixin
examples/standard: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor VERSION
examples/standard: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor
mkdir -p examples/standard
jsonnet -J scripts/vendor -m examples/standard --ext-str version="$(VERSION)" scripts/standard.jsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
${JSONNET_CLI} -J scripts/vendor -m examples/standard --ext-str version="$(VERSION)" scripts/standard.jsonnet | xargs -I{} sh -c 'cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
find examples -type f ! -name '*.yaml' -delete
examples/autosharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor VERSION
examples/autosharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor
mkdir -p examples/autosharding
jsonnet -J scripts/vendor -m examples/autosharding --ext-str version="$(VERSION)" scripts/autosharding.jsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
${JSONNET_CLI} -J scripts/vendor -m examples/autosharding --ext-str version="$(VERSION)" scripts/autosharding.jsonnet | xargs -I{} sh -c 'cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
find examples -type f ! -name '*.yaml' -delete
examples/daemonsetsharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/daemonsetsharding.jsonnet scripts/vendor
mkdir -p examples/daemonsetsharding
${JSONNET_CLI} -J scripts/vendor -m examples/daemonsetsharding --ext-str version="$(VERSION)" scripts/daemonsetsharding.jsonnet | xargs -I{} sh -c 'cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
find examples -type f ! -name '*.yaml' -delete
scripts/vendor: scripts/jsonnetfile.json scripts/jsonnetfile.lock.json
cd scripts && jb install
install-tools:
@echo Installing tools from tools.go
@cat tools/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
cd scripts && ${JB_CLI} install
install-promtool:
@echo Installing promtool
@wget -qO- "https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.${OS}-${ARCH}.tar.gz" | tar xvz --strip-components=1
@wget -qO- "https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.${OS}-${ARCH}.tar.gz" |\
tar xvz --strip-components=1 prometheus-${PROMETHEUS_VERSION}.${OS}-${ARCH}/promtool
.PHONY: all build build-local all-push all-container container container-* do-push-* sub-push-* push push-multi-arch test-unit test-rules test-benchmark-compare clean e2e validate-modules shellcheck licensecheck lint generate embedmd
.PHONY: all build build-local all-push all-container container container-* do-push-* sub-push-* push push-multi-arch test-unit test-rules test-benchmark-compare clean e2e validate-modules shellcheck licensecheck lint lint-fix generate generate-template validate-template embedmd

19
OWNERS
View File

@ -1,15 +1,18 @@
reviewers:
- brancz
- CatherineF-dev
- dgrisonnet
- fpetkovski
- LiliC
- logicalhan
- mrueg
- tariq1890
- rexagod
approvers:
- brancz
- LiliC
- CatherineF-dev
- dgrisonnet
- mrueg
- tariq1890
emeritus-approvers:
- rexagod
emeritus_approvers:
- LiliC
- andyxning
- brancz
- tariq1890
- zouyee
- fpetkovski

264
README.md
View File

@ -1,9 +1,13 @@
# Overview
[![Build Status](https://github.com/kubernetes/kube-state-metrics/workflows/continuous-integration/badge.svg)](https://github.com/kubernetes/kube-state-metrics/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/kube-state-metrics)](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics) [![GoDoc](https://godoc.org/github.com/kubernetes/kube-state-metrics?status.svg)](https://godoc.org/github.com/kubernetes/kube-state-metrics)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/kube-state-metrics)](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics)
[![Go Reference](https://pkg.go.dev/badge/github.com/kubernetes/kube-state-metrics.svg)](https://pkg.go.dev/github.com/kubernetes/kube-state-metrics)
[![govulncheck](https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml/badge.svg)](https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8696/badge)](https://www.bestpractices.dev/projects/8696)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics/badge)](https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics)
kube-state-metrics is a simple service that listens to the Kubernetes API
kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API
server and generates metrics about the state of the objects. (See examples in
the Metrics section below.) It is not focused on the health of the individual
Kubernetes components, but rather on the health of the various objects inside,
@ -26,58 +30,61 @@ the raw metrics. Note that the metrics exposed on the `/metrics` endpoint
reflect the current state of the Kubernetes cluster. When Kubernetes objects
are deleted they are no longer visible on the `/metrics` endpoint.
> [!NOTE]
> This README is generated from a [template](./README.md.tpl). Please make your changes there and run `make generate-template`.
## Table of Contents
- [Versioning](#versioning)
- [Kubernetes Version](#kubernetes-version)
- [Compatibility matrix](#compatibility-matrix)
- [Resource group version compatibility](#resource-group-version-compatibility)
- [Container Image](#container-image)
- [Metrics Documentation](#metrics-documentation)
- [Conflict resolution in label names](#conflict-resolution-in-label-names)
- [Enabling VerticalPodAutoscalers](#enabling-verticalpodautoscalers)
- [Kube-state-metrics self metrics](#kube-state-metrics-self-metrics)
- [Resource recommendation](#resource-recommendation)
- [Latency](#latency)
- [A note on costing](#a-note-on-costing)
- [kube-state-metrics vs. metrics-server](#kube-state-metrics-vs-metrics-server)
- [Scaling kube-state-metrics](#scaling-kube-state-metrics)
- [Resource recommendation](#resource-recommendation)
- [Horizontal scaling (sharding)](#horizontal-scaling-sharding)
- [Automated sharding](#automated-sharding)
- [Setup](#setup)
- [Building the Docker container](#building-the-docker-container)
- [Usage](#usage)
- [Kubernetes Deployment](#kubernetes-deployment)
- [Limited privileges environment](#limited-privileges-environment)
- [Helm Chart](#helm-chart)
- [Development](#development)
- [Developer Contributions](#developer-contributions)
* [Versioning](#versioning)
* [Kubernetes Version](#kubernetes-version)
* [Compatibility matrix](#compatibility-matrix)
* [Resource group version compatibility](#resource-group-version-compatibility)
* [Container Image](#container-image)
* [Metrics Documentation](#metrics-documentation)
* [ECMAScript regular expression support for allow and deny lists](#ecmascript-regular-expression-support-for-allow-and-deny-lists)
* [Conflict resolution in label names](#conflict-resolution-in-label-names)
* [Kube-state-metrics self metrics](#kube-state-metrics-self-metrics)
* [Resource recommendation](#resource-recommendation)
* [Latency](#latency)
* [A note on costing](#a-note-on-costing)
* [kube-state-metrics vs. metrics-server](#kube-state-metrics-vs-metrics-server)
* [Scaling kube-state-metrics](#scaling-kube-state-metrics)
* [Resource recommendation](#resource-recommendation)
* [Horizontal sharding](#horizontal-sharding)
* [Automated sharding](#automated-sharding)
* [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
* [Setup](#setup)
* [Building the Docker container](#building-the-docker-container)
* [Usage](#usage)
* [Kubernetes Deployment](#kubernetes-deployment)
* [Limited privileges environment](#limited-privileges-environment)
* [Helm Chart](#helm-chart)
* [Development](#development)
* [Developer Contributions](#developer-contributions)
* [Community](#community)
### Versioning
#### Kubernetes Version
kube-state-metrics uses [`client-go`](https://github.com/kubernetes/client-go) to talk with
Kubernetes clusters. The supported Kubernetes cluster version is determined by `client-go`.
The compatibility matrix for client-go and Kubernetes cluster can be found
[here](https://github.com/kubernetes/client-go#compatibility-matrix).
Kubernetes clusters. The supported Kubernetes cluster version is determined by
[`client-go`](https://github.com/kubernetes/client-go#compatibility-matrix).
All additional compatibility is only best effort, or happens to still/already be supported.
#### Compatibility matrix
At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kubernetes/kubernetes/releases) will be recorded below.
Generally, it is recommended to use the latest release of kube-state-metrics. If you run a very recent version of Kubernetes, you might want to use an unreleased version to have the full range of supported resources. If you run an older version of Kubernetes, you might need to run an older version in order to have full support for all resources. Be aware, that the maintainers will only support the latest release. Older versions might be supported by interested users of the community.
| kube-state-metrics | **Kubernetes 1.18** | **Kubernetes 1.19** | **Kubernetes 1.20** | **Kubernetes 1.21** | **Kubernetes 1.22** |
|--------------------|---------------------|----------------------|----------------------|----------------------|----------------------|
| **v1.9.8** | - | - | - | - | - |
| **v2.0.0** | -/✓ | ✓ | ✓ | -/✓ | -/✓ |
| **v2.1.1** | -/✓ | ✓ | ✓ | ✓ | -/✓ |
| **v2.2.0** | -/✓ | ✓ | ✓ | ✓ | ✓ |
| **master** | -/✓ | ✓ | ✓ | ✓ | ✓ |
- `✓` Fully supported version range.
- `-` The Kubernetes cluster has features the client-go library can't use (additional API objects, deprecated APIs, etc).
**Note:** The current kube-state-metrics `v2.0.0 +` releases work on Kubernetes v1.17 & v1.18 excluding Ingress or CertificateSigningRequest resource metrics. If you require those metrics on an older Kubernetes version, use kube-state-metrics `v1.9.8`.
| kube-state-metrics | Kubernetes client-go Version |
|--------------------|:----------------------------:|
| **v2.12.0** | v1.29 |
| **v2.13.0** | v1.30 |
| **v2.14.0** | v1.31 |
| **v2.15.0** | v1.32 |
| **v2.16.0** | v1.32 |
| **main** | v1.33 |
#### Resource group version compatibility
@ -88,7 +95,9 @@ release.
#### Container Image
The latest container image can be found at:
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.2.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.16.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
* [Multi-architecture images](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.16.0)
### Metrics Documentation
@ -120,12 +129,9 @@ e.g. by standardizing Kubernetes labels using an
[Admission Webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/)
that ensures that there are no possible conflicts.
#### Enabling VerticalPodAutoscalers
#### ECMAScript regular expression support for allow and deny lists
Please note that the collector for `verticalpodautoscalers` is **disabled** by default; Vertical Pod Autoscaler metrics will not be collected until the collector is enabled. This is because Vertical Pod Autoscalers are managed as custom resources.
If you want to enable this collector,
the [instructions](./docs/verticalpodautoscaler-metrics.md#Configuration) are located in the [Vertical Pod Autoscaler Metrics](./docs/verticalpodautoscaler-metrics.md) documentation.
Starting from [#2616](https://github.com/kubernetes/kube-state-metrics/pull/2616/files), kube-state-metrics supports ECMAScript's `regexp` for allow and deny lists. This was incorporated as a workaround for the limitations of the `regexp` package in Go, which does not support lookarounds due to their non-linear time complexity. Please note that while lookarounds are now supported for allow and deny lists, regular expressions' evaluation time is capped at a minute to prevent performance issues.
### Kube-state-metrics self metrics
@ -136,14 +142,16 @@ If you encounter those errors in the metrics, it is most likely a configuration
at the logs of kube-state-metrics.
Example of the above mentioned metrics:
```
```prometheus
kube_state_metrics_list_total{resource="*v1.Node",result="success"} 1
kube_state_metrics_list_total{resource="*v1.Node",result="error"} 52
kube_state_metrics_watch_total{resource="*v1beta1.Ingress",result="success"} 1
```
kube-state-metrics also exposes some http request metrics, examples of those are:
```
```prometheus
http_request_duration_seconds_bucket{handler="metrics",method="get",le="2.5"} 30
http_request_duration_seconds_bucket{handler="metrics",method="get",le="5"} 30
http_request_duration_seconds_bucket{handler="metrics",method="get",le="10"} 30
@ -153,17 +161,29 @@ http_request_duration_seconds_count{handler="metrics",method="get"} 30
```
kube-state-metrics also exposes build and configuration metrics:
```
kube_state_metrics_build_info{branch="master",goversion="go1.15.3",revision="6c9d775d",version="v2.0.0-beta"} 1
```prometheus
kube_state_metrics_build_info{branch="main",goversion="go1.15.3",revision="6c9d775d",version="v2.0.0-beta"} 1
kube_state_metrics_shard_ordinal{shard_ordinal="0"} 0
kube_state_metrics_total_shards 1
```
`kube_state_metrics_build_info` is used to expose version and other build information. For more usage about the info pattern,
please check the blog post [here](https://www.robustperception.io/exposing-the-software-version-to-prometheus).
please check this [blog post](https://www.robustperception.io/exposing-the-software-version-to-prometheus).
Sharding metrics expose `--shard` and `--total-shards` flags and can be used to validate
run-time configuration, see [`/examples/prometheus-alerting-rules`](./examples/prometheus-alerting-rules).
kube-state-metrics also exposes metrics about it config file and the Custom Resource State config file:
```prometheus
kube_state_metrics_config_hash{filename="crs.yml",type="customresourceconfig"} 2.38272279311849e+14
kube_state_metrics_config_hash{filename="config.yml",type="config"} 2.65285922340846e+14
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="crs.yml",type="customresourceconfig"} 1.6704882592037103e+09
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="config.yml",type="config"} 1.6704882592035313e+09
kube_state_metrics_last_config_reload_successful{filename="crs.yml",type="customresourceconfig"} 1
kube_state_metrics_last_config_reload_successful{filename="config.yml",type="config"} 1
```
### Scaling kube-state-metrics
#### Resource recommendation
@ -182,7 +202,7 @@ Note that if CPU limits are set too low, kube-state-metrics' internal queues wil
In a 100 node cluster scaling test the latency numbers were as follows:
```
```text
"Perc50": 259615384 ns,
"Perc90": 475000000 ns,
"Perc99": 906666666 ns.
@ -190,7 +210,7 @@ In a 100 node cluster scaling test the latency numbers were as follows:
### A note on costing
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/developer/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
### kube-state-metrics vs. metrics-server
@ -198,9 +218,9 @@ The [metrics-server](https://github.com/kubernetes-incubator/metrics-server)
is a project that has been inspired by
[Heapster](https://github.com/kubernetes-retired/heapster) and is implemented
to serve the goals of core metrics pipelines in [Kubernetes monitoring
architecture](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/monitoring_architecture.md).
architecture](https://github.com/kubernetes/design-proposals-archive/blob/main/instrumentation/monitoring_architecture.md).
It is a cluster level component which periodically scrapes metrics from all
Kubernetes nodes served by Kubelet through Summary API. The metrics are
Kubernetes nodes served by Kubelet through Metrics API. The metrics are
aggregated, stored in memory and served in [Metrics API
format](https://git.k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go). The
metrics-server stores the latest values only and is not responsible for
@ -215,38 +235,89 @@ metrics-server it too is not responsible for exporting its metrics anywhere.
Having kube-state-metrics as a separate project also enables access to these
metrics from monitoring systems such as Prometheus.
### Horizontal scaling (sharding)
### Horizontal sharding
In order to scale kube-state-metrics horizontally, some automated sharding capabilities have been implemented. It is configured with the following flags:
In order to shard kube-state-metrics horizontally, some automated sharding capabilities have been implemented. It is configured with the following flags:
* `--shard` (zero indexed)
* `--total-shards`
Sharding is done by taking an md5 sum of the Kubernetes Object's UID and performing a modulo operation on it, with the total number of shards. The configured shard decides whether the object is handled by the respective instance of kube-state-metrics or not. Note that this means all instances of kube-state-metrics even if sharded will have the network traffic and the resource consumption for unmarshaling objects for all objects, not just the ones it is responsible for. To optimize this further, the Kubernetes API would need to support sharded list/watch capabilities. Overall memory consumption should be 1/n th of each shard compared to an unsharded setup. Typically, kube-state-metrics needs to be memory and latency optimized in order for it to return its metrics rather quickly to Prometheus.
Sharding is done by taking an md5 sum of the Kubernetes Object's UID and performing a modulo operation on it with the total number of shards. Each shard decides whether the object is handled by the respective instance of kube-state-metrics or not. Note that this means all instances of kube-state-metrics, even if sharded, will have the network traffic and the resource consumption for unmarshaling objects for all objects, not just the ones they are responsible for. To optimize this further, the Kubernetes API would need to support sharded list/watch capabilities. In the optimal case, memory consumption for each shard will be 1/n compared to an unsharded setup. Typically, kube-state-metrics needs to be memory and latency optimized in order for it to return its metrics rather quickly to Prometheus. One way to reduce the latency between kube-state-metrics and the kube-apiserver is to run KSM with the `--use-apiserver-cache` flag. In addition to reducing the latency, this option will also lead to a reduction in the load on etcd.
Sharding should be used carefully, and additional monitoring should be set up in order to ensure that sharding is set up and functioning as expected (eg. instances for each shard out of the total shards are configured).
Sharding should be used carefully and additional monitoring should be set up in order to ensure that sharding is set up and functioning as expected (eg. instances for each shard out of the total shards are configured).
##### Automated sharding
#### Automated sharding
There is also an experimental feature, that allows kube-state-metrics to auto discover its nominal position if it is deployed in a StatefulSet, in order to automatically configure sharding. This is an experimental feature and may be broken or removed without notice.
Automatic sharding allows each shard to discover its nominal position when deployed in a StatefulSet which is useful for automatically configuring sharding. This is an experimental feature and may be broken or removed without notice.
To enable automated sharding kube-state-metrics must be run by a `StatefulSet` and the pod names and namespace must be handed to the kube-state-metrics process via the `--pod` and `--pod-namespace` flags.
To enable automated sharding, kube-state-metrics must be run by a `StatefulSet` and the pod name and namespace must be handed to the kube-state-metrics process via the `--pod` and `--pod-namespace` flags. Example manifests demonstrating the autosharding functionality can be found in [`/examples/autosharding`](./examples/autosharding).
There are example manifests demonstrating the autosharding functionality in [`/examples/autosharding`](./examples/autosharding).
This way of deploying shards is useful when you want to manage KSM shards through a single Kubernetes resource (a single `StatefulSet` in this case) instead of having one `Deployment` per shard. The advantage can be especially significant when deploying a high number of shards.
The downside of using an auto-sharded setup comes from the rollout strategy supported by `StatefulSet`s. When managed by a `StatefulSet`, pods are replaced one at a time with each pod first getting terminated and then recreated. Besides such rollouts being slower, they will also lead to short downtime for each shard. If a Prometheus scrape happens during a rollout, it can miss some of the metrics exported by kube-state-metrics.
### Daemonset sharding for pod metrics
For pod metrics, they can be sharded per node with the following flag:
* `--node=$(NODE_NAME)`
Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.
A daemonset kube-state-metrics example:
```yaml
apiVersion: apps/v1
kind: DaemonSet
spec:
template:
spec:
containers:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
name: kube-state-metrics
args:
- --resource=pods
- --node=$(NODE_NAME)
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
```
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
```yaml
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
name: kube-state-metrics
args:
- --resources=pods
- --track-unscheduled-pods
```
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
### Setup
Install this project to your `$GOPATH` using `go get`:
```
go get k8s.io/kube-state-metrics
```bash
go get k8s.io/kube-state-metrics/v2
```
#### Building the Docker container
Simply run the following command in this root folder, which will create a
self-contained, statically-linked binary and build a Docker image:
```
```bash
make container
```
@ -255,34 +326,44 @@ make container
Simply build and run kube-state-metrics inside a Kubernetes pod which has a
service account token that has read-only access to the Kubernetes cluster.
### For users of prometheus-operator/kube-prometheus stack
#### For users of prometheus-operator/kube-prometheus stack
The ([`kube-prometheus`](https://github.com/prometheus-operator/kube-prometheus/)) stack installs kube-state-metrics as one of its [components](https://github.com/prometheus-operator/kube-prometheus#kube-prometheus); you do not need to install kube-state-metrics if you're using the kube-prometheus stack.
If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at [Customizing Kube-Prometheus](https://github.com/prometheus-operator/kube-prometheus#customizing-kube-prometheus).
If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at [Customizing Kube-Prometheus](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md).
#### Kubernetes Deployment
To deploy this project, you can simply run `kubectl apply -f examples/standard` and a
Kubernetes service and deployment will be created. (Note: Adjust the apiVersion of some resource if your kubernetes cluster's version is not 1.8+, check the yaml file for more information).
To deploy this project, you can simply run `kubectl apply -f examples/standard` and a Kubernetes service and deployment will be created. (Note: Adjust the apiVersion of some resource if your kubernetes cluster's version is not 1.8+, check the yaml file for more information).
To have Prometheus discover kube-state-metrics instances it is advised to create a specific Prometheus scrape config for kube-state-metrics that picks up both metrics endpoints. Annotation based discovery is discouraged as only one of the endpoints would be able to be selected, plus kube-state-metrics in most cases has special authentication and authorization requirements as it essentially grants read access through the metrics endpoint to most information available to it.
**Note:** Google Kubernetes Engine (GKE) Users - GKE has strict role permissions that will prevent the kube-state-metrics roles and role bindings from being created. To work around this, you can give your GCP identity the cluster-admin role by running the following one-liner:
```
```bash
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')
```
Note that your GCP identity is case sensitive but `gcloud info` as of Google Cloud SDK 221.0.0 is not. This means that if your IAM member contains capital letters, the above one-liner may not work for you. If you have 403 forbidden responses after running the above command and `kubectl apply -f examples/standard`, check the IAM member associated with your account at https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID.
Note that your GCP identity is case sensitive but `gcloud info` as of Google Cloud SDK 221.0.0 is not. This means that if your IAM member contains capital letters, the above one-liner may not work for you. If you have 403 forbidden responses after running the above command and `kubectl apply -f examples/standard`, check the IAM member associated with your account at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>.
After running the above, if you see `Clusterrolebinding "cluster-admin-binding" created`, then you are able to continue with the setup of this service.
#### Healthcheck Endpoints
The following healthcheck endpoints are available (`self` refers to the telemetry port, while `main` refers to the exposition port):
* `/healthz` (exposed on `main`): Returns a 200 status code if the application is running. We recommend to use this for the startup probe.
* `/livez` (exposed on `main`): Returns a 200 status code if the application is not affected by an outage of the Kubernetes API Server. We recommend to using this for the liveness probe.
* `/readyz` (exposed on `self`): Returns a 200 status code if the application is ready to accept requests and expose metrics. We recommend using this for the readiness probe.
Note that it is discouraged to use the telemetry metrics endpoint for any probe when proxying the exposition data.
#### Limited privileges environment
If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:
- create a serviceaccount
* create a serviceaccount
```yaml
apiVersion: v1
kind: ServiceAccount
@ -291,7 +372,8 @@ metadata:
namespace: your-namespace-where-kube-state-metrics-will-deployed
```
- give it `view` privileges on specific namespaces (using roleBinding) (*note: you can add this roleBinding to all the NS you want your serviceaccount to access*)
* give it `view` privileges on specific namespaces (using roleBinding) (*note: you can add this roleBinding to all the NS you want your serviceaccount to access*)
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
@ -308,7 +390,7 @@ subjects:
namespace: your-namespace-where-kube-state-metrics-will-deployed
```
- then specify a set of namespaces (using the `--namespaces` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
* then specify a set of namespaces (using the `--namespaces` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
```yaml
spec:
@ -321,8 +403,7 @@ spec:
- '--namespaces=project1'
```
For the full list of arguments available, see the documentation in [docs/cli-arguments.md](./docs/cli-arguments.md)
For the full list of arguments available, see the documentation in [docs/developer/cli-arguments.md](./docs/developer/cli-arguments.md)
#### Helm Chart
@ -330,20 +411,35 @@ Starting from the kube-state-metrics chart `v2.13.3` (kube-state-metrics image `
#### Development
When developing, test a metric dump against your local Kubernetes cluster by
running:
When developing, test a metric dump against your local Kubernetes cluster by running:
> Users can override the apiserver address in KUBE-CONFIG file with `--apiserver` command line.
go install
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
```bash
go install
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
```
Then curl the metrics endpoint
curl localhost:8080/metrics
```bash
curl localhost:8080/metrics
```
To run the e2e tests locally see the documentation in [tests/README.md](./tests/README.md).
#### Developer Contributions
When developing, there are certain code patterns to follow to better your contributing experience and likelihood of e2e and other ci tests to pass. To learn more about them, see the documentation in [docs/developer/guide.md](./docs/developer/guide.md).
#### Community
This project is sponsored by [SIG Instrumentation](https://github.com/kubernetes/community/tree/master/sig-instrumentation).
There is also a channel for [#kube-state-metrics](https://kubernetes.slack.com/archives/CJJ529RUY) on Kubernetes' Slack.
You can also join the SIG Instrumentation [mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-instrumentation).
This will typically add invites for the following meetings to your calendar, in which topics around kube-state-metrics can be discussed.
* Regular SIG Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).
* Regular Triage Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly - alternating with regular meeting). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).

446
README.md.tpl Normal file
View File

@ -0,0 +1,446 @@
# Overview
[![Build Status](https://github.com/kubernetes/kube-state-metrics/workflows/continuous-integration/badge.svg)](https://github.com/kubernetes/kube-state-metrics/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/kube-state-metrics)](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics)
[![Go Reference](https://pkg.go.dev/badge/github.com/kubernetes/kube-state-metrics.svg)](https://pkg.go.dev/github.com/kubernetes/kube-state-metrics)
[![govulncheck](https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml/badge.svg)](https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8696/badge)](https://www.bestpractices.dev/projects/8696)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics/badge)](https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics)
kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API
server and generates metrics about the state of the objects. (See examples in
the Metrics section below.) It is not focused on the health of the individual
Kubernetes components, but rather on the health of the various objects inside,
such as deployments, nodes and pods.
kube-state-metrics is about generating metrics from Kubernetes API objects
without modification. This ensures that features provided by kube-state-metrics
have the same grade of stability as the Kubernetes API objects themselves. In
turn, this means that kube-state-metrics in certain situations may not show the
exact same values as kubectl, as kubectl applies certain heuristics to display
comprehensible messages. kube-state-metrics exposes raw data unmodified from the
Kubernetes API, this way users have all the data they require and perform
heuristics as they see fit.
The metrics are exported on the HTTP endpoint `/metrics` on the listening port
(default 8080). They are served as plaintext. They are designed to be consumed
either by Prometheus itself or by a scraper that is compatible with scraping a
Prometheus client endpoint. You can also open `/metrics` in a browser to see
the raw metrics. Note that the metrics exposed on the `/metrics` endpoint
reflect the current state of the Kubernetes cluster. When Kubernetes objects
are deleted they are no longer visible on the `/metrics` endpoint.
> [!NOTE]
> This README is generated from a [template](./README.md.tpl). Please make your changes there and run `make generate-template`.
## Table of Contents
* [Versioning](#versioning)
* [Kubernetes Version](#kubernetes-version)
* [Compatibility matrix](#compatibility-matrix)
* [Resource group version compatibility](#resource-group-version-compatibility)
* [Container Image](#container-image)
* [Metrics Documentation](#metrics-documentation)
* [ECMAScript regular expression support for allow and deny lists](#ecmascript-regular-expression-support-for-allow-and-deny-lists)
* [Conflict resolution in label names](#conflict-resolution-in-label-names)
* [Kube-state-metrics self metrics](#kube-state-metrics-self-metrics)
* [Resource recommendation](#resource-recommendation)
* [Latency](#latency)
* [A note on costing](#a-note-on-costing)
* [kube-state-metrics vs. metrics-server](#kube-state-metrics-vs-metrics-server)
* [Scaling kube-state-metrics](#scaling-kube-state-metrics)
* [Resource recommendation](#resource-recommendation)
* [Horizontal sharding](#horizontal-sharding)
* [Automated sharding](#automated-sharding)
* [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
* [Setup](#setup)
* [Building the Docker container](#building-the-docker-container)
* [Usage](#usage)
* [Kubernetes Deployment](#kubernetes-deployment)
* [Limited privileges environment](#limited-privileges-environment)
* [Helm Chart](#helm-chart)
* [Development](#development)
* [Developer Contributions](#developer-contributions)
* [Community](#community)
### Versioning
#### Kubernetes Version
kube-state-metrics uses [`client-go`](https://github.com/kubernetes/client-go) to talk with
Kubernetes clusters. The supported Kubernetes cluster version is determined by
[`client-go`](https://github.com/kubernetes/client-go#compatibility-matrix).
All additional compatibility is only best effort, or happens to still/already be supported.
#### Compatibility matrix
At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kubernetes/kubernetes/releases) will be recorded below.
Generally, it is recommended to use the latest release of kube-state-metrics. If you run a very recent version of Kubernetes, you might want to use an unreleased version to have the full range of supported resources. If you run an older version of Kubernetes, you might need to run an older version in order to have full support for all resources. Be aware, that the maintainers will only support the latest release. Older versions might be supported by interested users of the community.
| kube-state-metrics | Kubernetes client-go Version |
|--------------------|:----------------------------:|
{{ define "compat-matrix" -}}
{{- range . -}}
| **{{ .version }}**{{ strings.Repeat (conv.ToInt (math.Sub 15 (len .version))) " " }}| v{{ .kubernetes }} |
{{ end -}}
{{- end -}}
{{ template "compat-matrix" (datasource "config").compat }}
#### Resource group version compatibility
Resources in Kubernetes can evolve, i.e., the group version for a resource may change from alpha to beta and finally GA
in different Kubernetes versions. For now, kube-state-metrics will only use the oldest API available in the latest
release.
#### Container Image
The latest container image can be found at:
{{ define "get-latest-release" -}}
{{ (index . (math.Sub (len .) 2)).version -}}
{{ end }}
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:{{ template "get-latest-release" (datasource "config").compat }}` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
* [Multi-architecture images](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:{{ template "get-latest-release" (datasource "config").compat -}})
### Metrics Documentation
Any resources and metrics based on alpha Kubernetes APIs are excluded from any stability guarantee,
which may be changed at any given release.
See the [`docs`](docs) directory for more information on the exposed metrics.
#### Conflict resolution in label names
The `*_labels` family of metrics exposes Kubernetes labels as Prometheus labels.
As [Kubernetes](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set)
is more liberal than
[Prometheus](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)
in terms of allowed characters in label names,
we automatically convert unsupported characters to underscores.
For example, `app.kubernetes.io/name` becomes `label_app_kubernetes_io_name`.
This conversion can create conflicts when multiple Kubernetes labels like
`foo-bar` and `foo_bar` would be converted to the same Prometheus label `label_foo_bar`.
Kube-state-metrics automatically adds a suffix `_conflictN` to resolve this conflict,
so it converts the above labels to
`label_foo_bar_conflict1` and `label_foo_bar_conflict2`.
If you'd like to have more control over how this conflict is resolved,
you might want to consider addressing this issue on a different level of the stack,
e.g. by standardizing Kubernetes labels using an
[Admission Webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/)
that ensures that there are no possible conflicts.
#### ECMAScript regular expression support for allow and deny lists
Starting from [#2616](https://github.com/kubernetes/kube-state-metrics/pull/2616/files), kube-state-metrics supports ECMAScript's `regexp` for allow and deny lists. This was incorporated as a workaround for the limitations of the `regexp` package in Go, which does not support lookarounds due to their non-linear time complexity. Please note that while lookarounds are now supported for allow and deny lists, regular expressions' evaluation time is capped at a minute to prevent performance issues.
### Kube-state-metrics self metrics
kube-state-metrics exposes its own general process metrics under `--telemetry-host` and `--telemetry-port` (default 8081).
kube-state-metrics also exposes list and watch success and error metrics. These can be used to calculate the error rate of list or watch resources.
If you encounter those errors in the metrics, it is most likely a configuration or permission issue, and the next thing to investigate would be looking
at the logs of kube-state-metrics.
Example of the above mentioned metrics:
```prometheus
kube_state_metrics_list_total{resource="*v1.Node",result="success"} 1
kube_state_metrics_list_total{resource="*v1.Node",result="error"} 52
kube_state_metrics_watch_total{resource="*v1beta1.Ingress",result="success"} 1
```
kube-state-metrics also exposes some http request metrics, examples of those are:
```prometheus
http_request_duration_seconds_bucket{handler="metrics",method="get",le="2.5"} 30
http_request_duration_seconds_bucket{handler="metrics",method="get",le="5"} 30
http_request_duration_seconds_bucket{handler="metrics",method="get",le="10"} 30
http_request_duration_seconds_bucket{handler="metrics",method="get",le="+Inf"} 30
http_request_duration_seconds_sum{handler="metrics",method="get"} 0.021113919999999998
http_request_duration_seconds_count{handler="metrics",method="get"} 30
```
kube-state-metrics also exposes build and configuration metrics:
```prometheus
kube_state_metrics_build_info{branch="main",goversion="go1.15.3",revision="6c9d775d",version="v2.0.0-beta"} 1
kube_state_metrics_shard_ordinal{shard_ordinal="0"} 0
kube_state_metrics_total_shards 1
```
`kube_state_metrics_build_info` is used to expose version and other build information. For more usage about the info pattern,
please check this [blog post](https://www.robustperception.io/exposing-the-software-version-to-prometheus).
Sharding metrics expose `--shard` and `--total-shards` flags and can be used to validate
run-time configuration, see [`/examples/prometheus-alerting-rules`](./examples/prometheus-alerting-rules).
kube-state-metrics also exposes metrics about it config file and the Custom Resource State config file:
```prometheus
kube_state_metrics_config_hash{filename="crs.yml",type="customresourceconfig"} 2.38272279311849e+14
kube_state_metrics_config_hash{filename="config.yml",type="config"} 2.65285922340846e+14
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="crs.yml",type="customresourceconfig"} 1.6704882592037103e+09
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="config.yml",type="config"} 1.6704882592035313e+09
kube_state_metrics_last_config_reload_successful{filename="crs.yml",type="customresourceconfig"} 1
kube_state_metrics_last_config_reload_successful{filename="config.yml",type="config"} 1
```
### Scaling kube-state-metrics
#### Resource recommendation
Resource usage for kube-state-metrics changes with the Kubernetes objects (Pods/Nodes/Deployments/Secrets etc.) size of the cluster.
To some extent, the Kubernetes objects in a cluster are in direct proportion to the node number of the cluster.
As a general rule, you should allocate:
* 250MiB memory
* 0.1 cores
Note that if CPU limits are set too low, kube-state-metrics' internal queues will not be able to be worked off quickly enough, resulting in increased memory consumption as the queue length grows. If you experience problems resulting from high memory allocation or CPU throttling, try increasing the CPU limits.
### Latency
In a 100 node cluster scaling test the latency numbers were as follows:
```text
"Perc50": 259615384 ns,
"Perc90": 475000000 ns,
"Perc99": 906666666 ns.
```
### A note on costing
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/developer/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
### kube-state-metrics vs. metrics-server
The [metrics-server](https://github.com/kubernetes-incubator/metrics-server)
is a project that has been inspired by
[Heapster](https://github.com/kubernetes-retired/heapster) and is implemented
to serve the goals of core metrics pipelines in [Kubernetes monitoring
architecture](https://github.com/kubernetes/design-proposals-archive/blob/main/instrumentation/monitoring_architecture.md).
It is a cluster level component which periodically scrapes metrics from all
Kubernetes nodes served by Kubelet through Metrics API. The metrics are
aggregated, stored in memory and served in [Metrics API
format](https://git.k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go). The
metrics-server stores the latest values only and is not responsible for
forwarding metrics to third-party destinations.
kube-state-metrics is focused on generating completely new metrics from
Kubernetes' object state (e.g. metrics based on deployments, replica sets,
etc.). It holds an entire snapshot of Kubernetes state in memory and
continuously generates new metrics based off of it. And just like the
metrics-server it too is not responsible for exporting its metrics anywhere.
Having kube-state-metrics as a separate project also enables access to these
metrics from monitoring systems such as Prometheus.
### Horizontal sharding
In order to shard kube-state-metrics horizontally, some automated sharding capabilities have been implemented. It is configured with the following flags:
* `--shard` (zero indexed)
* `--total-shards`
Sharding is done by taking an md5 sum of the Kubernetes Object's UID and performing a modulo operation on it with the total number of shards. Each shard decides whether the object is handled by the respective instance of kube-state-metrics or not. Note that this means all instances of kube-state-metrics, even if sharded, will have the network traffic and the resource consumption for unmarshaling objects for all objects, not just the ones they are responsible for. To optimize this further, the Kubernetes API would need to support sharded list/watch capabilities. In the optimal case, memory consumption for each shard will be 1/n compared to an unsharded setup. Typically, kube-state-metrics needs to be memory and latency optimized in order for it to return its metrics rather quickly to Prometheus. One way to reduce the latency between kube-state-metrics and the kube-apiserver is to run KSM with the `--use-apiserver-cache` flag. In addition to reducing the latency, this option will also lead to a reduction in the load on etcd.
Sharding should be used carefully and additional monitoring should be set up in order to ensure that sharding is set up and functioning as expected (eg. instances for each shard out of the total shards are configured).
#### Automated sharding
Automatic sharding allows each shard to discover its nominal position when deployed in a StatefulSet which is useful for automatically configuring sharding. This is an experimental feature and may be broken or removed without notice.
To enable automated sharding, kube-state-metrics must be run by a `StatefulSet` and the pod name and namespace must be handed to the kube-state-metrics process via the `--pod` and `--pod-namespace` flags. Example manifests demonstrating the autosharding functionality can be found in [`/examples/autosharding`](./examples/autosharding).
This way of deploying shards is useful when you want to manage KSM shards through a single Kubernetes resource (a single `StatefulSet` in this case) instead of having one `Deployment` per shard. The advantage can be especially significant when deploying a high number of shards.
The downside of using an auto-sharded setup comes from the rollout strategy supported by `StatefulSet`s. When managed by a `StatefulSet`, pods are replaced one at a time with each pod first getting terminated and then recreated. Besides such rollouts being slower, they will also lead to short downtime for each shard. If a Prometheus scrape happens during a rollout, it can miss some of the metrics exported by kube-state-metrics.
### Daemonset sharding for pod metrics
For pod metrics, they can be sharded per node with the following flag:
* `--node=$(NODE_NAME)`
Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.
A daemonset kube-state-metrics example:
```yaml
apiVersion: apps/v1
kind: DaemonSet
spec:
template:
spec:
containers:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
name: kube-state-metrics
args:
- --resource=pods
- --node=$(NODE_NAME)
env:
- name: NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
```
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
```yaml
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
name: kube-state-metrics
args:
- --resources=pods
- --track-unscheduled-pods
```
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
### Setup
Install this project to your `$GOPATH` using `go get`:
```bash
go get k8s.io/kube-state-metrics/v2
```
#### Building the Docker container
Simply run the following command in this root folder, which will create a
self-contained, statically-linked binary and build a Docker image:
```bash
make container
```
### Usage
Simply build and run kube-state-metrics inside a Kubernetes pod which has a
service account token that has read-only access to the Kubernetes cluster.
#### For users of prometheus-operator/kube-prometheus stack
The ([`kube-prometheus`](https://github.com/prometheus-operator/kube-prometheus/)) stack installs kube-state-metrics as one of its [components](https://github.com/prometheus-operator/kube-prometheus#kube-prometheus); you do not need to install kube-state-metrics if you're using the kube-prometheus stack.
If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at [Customizing Kube-Prometheus](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md).
#### Kubernetes Deployment
To deploy this project, you can simply run `kubectl apply -f examples/standard` and a Kubernetes service and deployment will be created. (Note: Adjust the apiVersion of some resource if your kubernetes cluster's version is not 1.8+, check the yaml file for more information).
To have Prometheus discover kube-state-metrics instances it is advised to create a specific Prometheus scrape config for kube-state-metrics that picks up both metrics endpoints. Annotation based discovery is discouraged as only one of the endpoints would be able to be selected, plus kube-state-metrics in most cases has special authentication and authorization requirements as it essentially grants read access through the metrics endpoint to most information available to it.
**Note:** Google Kubernetes Engine (GKE) Users - GKE has strict role permissions that will prevent the kube-state-metrics roles and role bindings from being created. To work around this, you can give your GCP identity the cluster-admin role by running the following one-liner:
```bash
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')
```
Note that your GCP identity is case sensitive but `gcloud info` as of Google Cloud SDK 221.0.0 is not. This means that if your IAM member contains capital letters, the above one-liner may not work for you. If you have 403 forbidden responses after running the above command and `kubectl apply -f examples/standard`, check the IAM member associated with your account at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>.
After running the above, if you see `Clusterrolebinding "cluster-admin-binding" created`, then you are able to continue with the setup of this service.
#### Healthcheck Endpoints
The following healthcheck endpoints are available (`self` refers to the telemetry port, while `main` refers to the exposition port):
* `/healthz` (exposed on `main`): Returns a 200 status code if the application is running. We recommend to use this for the startup probe.
* `/livez` (exposed on `main`): Returns a 200 status code if the application is not affected by an outage of the Kubernetes API Server. We recommend to using this for the liveness probe.
* `/readyz` (exposed on `self`): Returns a 200 status code if the application is ready to accept requests and expose metrics. We recommend using this for the readiness probe.
Note that it is discouraged to use the telemetry metrics endpoint for any probe when proxying the exposition data.
#### Limited privileges environment
If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:
* create a serviceaccount
```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-state-metrics
namespace: your-namespace-where-kube-state-metrics-will-deployed
```
* give it `view` privileges on specific namespaces (using roleBinding) (*note: you can add this roleBinding to all the NS you want your serviceaccount to access*)
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kube-state-metrics
namespace: project1
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- kind: ServiceAccount
name: kube-state-metrics
namespace: your-namespace-where-kube-state-metrics-will-deployed
```
* then specify a set of namespaces (using the `--namespaces` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
```yaml
spec:
template:
spec:
containers:
- name: kube-state-metrics
args:
- '--resources=pods'
- '--namespaces=project1'
```
For the full list of arguments available, see the documentation in [docs/developer/cli-arguments.md](./docs/developer/cli-arguments.md)
#### Helm Chart
Starting from the kube-state-metrics chart `v2.13.3` (kube-state-metrics image `v1.9.8`), the official [Helm chart](https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics/) is maintained in [prometheus-community/helm-charts](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). Starting from kube-state-metrics chart `v3.0.0` only kube-state-metrics images of `v2.0.0 +` are supported.
#### Development
When developing, test a metric dump against your local Kubernetes cluster by running:
> Users can override the apiserver address in KUBE-CONFIG file with `--apiserver` command line.
```bash
go install
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
```
Then curl the metrics endpoint
```bash
curl localhost:8080/metrics
```
To run the e2e tests locally see the documentation in [tests/README.md](./tests/README.md).
#### Developer Contributions
When developing, there are certain code patterns to follow to better your contributing experience and likelihood of e2e and other ci tests to pass. To learn more about them, see the documentation in [docs/developer/guide.md](./docs/developer/guide.md).
#### Community
This project is sponsored by [SIG Instrumentation](https://github.com/kubernetes/community/tree/master/sig-instrumentation).
There is also a channel for [#kube-state-metrics](https://kubernetes.slack.com/archives/CJJ529RUY) on Kubernetes' Slack.
You can also join the SIG Instrumentation [mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-instrumentation).
This will typically add invites for the following meetings to your calendar, in which topics around kube-state-metrics can be discussed.
* Regular SIG Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).
* Regular Triage Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly - alternating with regular meeting). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).

View File

@ -6,35 +6,39 @@ We use [Semantic Versioning](http://semver.org/).
We maintain a separate branch for each minor release, named `release-<major>.<minor>`, e.g. `release-1.1`, `release-2.0`.
The usual flow is to merge new features and changes into the master branch and to merge bug fixes into the latest release branch. Bug fixes are then merged into master from the latest release branch. The master branch should always contain all commits from the latest release branch.
The usual flow is to merge new features and changes into the main branch and to merge bug fixes into the latest release branch. Bug fixes are then merged into main from the latest release branch. The main branch should always contain all commits from the latest release branch.
If a bug fix got accidentally merged into master, cherry-pick commits have to be created in the latest release branch, which then have to be merged back into master. Try to avoid that situation.
If a bug fix got accidentally merged into main, cherry-pick commits have to be created in the latest release branch, which then have to be merged back into main. Try to avoid that situation.
Maintaining the release branches for older minor releases happens on a best effort basis.
## Prepare your release
* Bump the version in the `VERSION` file in the root of the repository.
* Update the [data.yaml](data.yaml)
* Update the compat list
* Update the version key to refer to your new release
* Run `make examples`, which will re-generate all example manifests to use the new version.
* Make a PR to update:
* [Compatibility matrix](README.md#compatibility-matrix)
* Run `make generate`, which will update the compatibility matrix in README.md
* Changelog entry
* Only include user relevant changes
* Entries in the [`CHANGELOG.md`](CHANGELOG.md) are meant to be in this order:
```
```text
[CHANGE]
[FEATURE]
[ENHANCEMENT]
[BUGFIX]
```
* All lines should be full sentences
* kube-state-metrics image tag used in Kubernetes deployment yaml config.
* Cut the new release branch, e.g. `release-1.2`, or merge/cherry-pick changes onto the minor release branch you intend to tag the release on
* Cut the new release tag, e.g. `v1.2.0-rc.0`
* Create a new **pre-release** on github
* New images are automatically built and pushed to `gcr.io/k8s-staging-kube-state-metrics/kube-state-metrics`
* Promote image by sending a PR to [kubernetes/k8s.io](https://github.com/kubernetes/k8s.io) repository. Follow the [example PR](https://github.com/kubernetes/k8s.io/pull/1260). Use [cip-mm](https://github.com/kubernetes/release/tree/master/cmd/cip-mm) to update the manifest files in this repository, e.g. `cip-mm --base_dir=k8s.gcr.io --staging_repo=gcr.io/k8s-staging-kube-state-metrics --filter_tag='v2.0.0-rc.1'`
* Create a PR to merge the changes of this release back into the master branch.
* Promote image by sending a PR to [kubernetes/k8s.io](https://github.com/kubernetes/k8s.io) repository. Follow the [example PR](https://github.com/kubernetes/k8s.io/pull/3798). Use [kpromo pr](https://github.com/kubernetes-sigs/promo-tools/blob/main/docs/promotion-pull-requests.md) to update the manifest files in this repository, e.g. `kpromo pr --fork=$YOURNAME -i --project=kube-state-metrics -t=v2.5.0`
* Create a PR to merge the changes of this release back into the main branch.
* Once the PR to promote the image is merged, mark the pre-release as a regular release.
## Stable release

49
SECURITY-INSIGHTS.yml Normal file
View File

@ -0,0 +1,49 @@
# Refer: https://github.com/ossf/security-insights-spec/blob/main/specification.md#specification
header:
schema-version: "1.0.0"
expiration-date: "2024-12-15T19:10:00.000Z"
project-url: https://github.com/kubernetes/kube-state-metrics
changelog: https://github.com/kubernetes/kube-state-metrics/blob/main/CHANGELOG.md
license: https://github.com/kubernetes/kube-state-metrics/blob/main/LICENSE
project-lifecycle:
status: active
bug-fixes-only: false
core-maintainers:
- github:dgrisonnet
- github:mrueg
- github:rexagod
release-process: https://github.com/kubernetes/kube-state-metrics/blob/main/RELEASE.md
contribution-policy:
accepts-pull-requests: true
accepts-automated-pull-requests: true
contributing-policy: https://github.com/kubernetes/kube-state-metrics/blob/main/CONTRIBUTING.md
code-of-conduct: https://github.com/kubernetes/kube-state-metrics/blob/main/code-of-conduct.md
distribution-points:
- https://github.com/kubernetes/kube-state-metrics/releases
- https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-kube-state-metrics/images.yaml
security-contacts:
- type: website
value: https://github.com/kubernetes/kube-state-metrics/blob/main/SECURITY_CONTACTS
vulnerability-reporting:
accepts-vulnerability-reports: true
security-policy: https://github.com/kubernetes/kube-state-metrics/blob/main/SECURITY.md
dependencies:
third-party-packages: true
dependencies-lists:
- https://github.com/kubernetes/kube-state-metrics/blob/main/go.mod
- https://github.com/kubernetes/kube-state-metrics/blob/main/Dockerfile
env-dependencies-policy:
policy-url: https://github.com/kubernetes/kube-state-metrics/blob/main/docs/dependencies-policy.md
documentation:
- https://github.com/kubernetes/kube-state-metrics/tree/main/docs
security-testing:
- tool-type: dast
tool-name: govulncheck
tool-version: latest
tool-url: https://go.googlesource.com/vuln
tool-rulesets:
- built-in
integration:
ci: true
comment: |
Detects vulnerabilities as a result of the affected call-paths being invoked directly in the repository, while reducing false positives by ignoring dormant call-paths for package dependencies.

View File

@ -10,6 +10,7 @@
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
# INSTRUCTIONS AT https://kubernetes.io/security/
brancz
tariq1890
LiliC
dgrisonnet
mrueg
rexagod
CatherineF-dev

View File

@ -1 +0,0 @@
2.2.0

View File

@ -1,9 +1,9 @@
# See https://cloud.google.com/cloud-build/docs/build-config
timeout: 1200s
timeout: 2700s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20210722-085d930'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241111-71c32dbdcc'
entrypoint: make
env:
- TAG=$_PULL_BASE_REF

19
data.yaml Normal file
View File

@ -0,0 +1,19 @@
# The purpose of this config is to keep all versions in a single file and make them machine accessible
# Marks the latest release
version: "2.16.0"
# List at max 5 releases here + the main branch
compat:
- version: "v2.12.0"
kubernetes: "1.29"
- version: "v2.13.0"
kubernetes: "1.30"
- version: "v2.14.0"
kubernetes: "1.31"
- version: "v2.15.0"
kubernetes: "1.32"
- version: "v2.16.0"
kubernetes: "1.32"
- version: "main"
kubernetes: "1.33"

View File

@ -6,10 +6,10 @@ Any contribution to improving this documentation or adding sample usages will be
## Table of Contents
- [Metrics Stages](#metrics-stages)
- [Exposed Metrics](#exposed-metrics)
- [Join Metrics](#join-metrics)
- [CLI arguments](#cli-arguments)
* [Metrics Stages](#metrics-stages)
* [Exposed Metrics](#exposed-metrics)
* [Join Metrics](#join-metrics)
* [CLI arguments](#cli-arguments)
## Metrics Stages
@ -21,39 +21,55 @@ Stages about metrics are grouped into three categories
| STABLE | Metrics which should have very few backwards-incompatible changes outside of major version updates. |
| DEPRECATED | Metrics which will be removed once the deprecation timeline is met. |
## Opt-in Metrics
As of v2.3.0, kube-state-metrics supports additional opt-in metrics via the CLI flag `--metric-opt-in-list`. See the metric documentation to identify which metrics need to be specified.
## Exposed Metrics
Per group of metrics there is one file for each metrics. See each file for specific documentation about the exposed metrics:
Per group of metrics there is one file for each metrics.
See each file for specific documentation about the exposed metrics:
- [CertificateSigningRequest Metrics](certificatesigningrequest-metrics.md)
- [ConfigMap Metrics](configmap-metrics.md)
- [CronJob Metrics](cronjob-metrics.md)
- [DaemonSet Metrics](daemonset-metrics.md)
- [Deployment Metrics](deployment-metrics.md)
- [Endpoint Metrics](endpoint-metrics.md)
- [Horizontal Pod Autoscaler Metrics](horizontalpodautoscaler-metrics.md)
- [Ingress Metrics](ingress-metrics.md)
- [Job Metrics](job-metrics.md)
- [Lease Metrics](lease-metrics.md)
- [LimitRange Metrics](limitrange-metrics.md)
- [MutatingWebhookConfiguration Metrics](mutatingwebhookconfiguration-metrics.md)
- [Namespace Metrics](namespace-metrics.md)
- [NetworkPolicy Metrics](networkpolicy-metrics.md)
- [Node Metrics](node-metrics.md)
- [PersistentVolume Metrics](persistentvolume-metrics.md)
- [PersistentVolumeClaim Metrics](persistentvolumeclaim-metrics.md)
- [Pod Disruption Budget Metrics](poddisruptionbudget-metrics.md)
- [Pod Metrics](pod-metrics.md)
- [ReplicaSet Metrics](replicaset-metrics.md)
- [ReplicationController Metrics](replicationcontroller-metrics.md)
- [ResourceQuota Metrics](resourcequota-metrics.md)
- [Secret Metrics](secret-metrics.md)
- [Service Metrics](service-metrics.md)
- [StatefulSet Metrics](statefulset-metrics.md)
- [StorageClass Metrics](storageclass-metrics.md)
- [ValidatingWebhookConfiguration Metrics](validatingwebhookconfiguration-metrics.md)
- [VerticalPodAutoscaler Metrics](verticalpodautoscaler-metrics.md)
- [VolumeAttachment Metrics](volumeattachment-metrics.md)
### Default Resources
* [CertificateSigningRequest Metrics](metrics/auth/certificatesigningrequest-metrics.md)
* [ConfigMap Metrics](metrics/storage/configmap-metrics.md)
* [CronJob Metrics](metrics/workload/cronjob-metrics.md)
* [DaemonSet Metrics](metrics/workload/daemonset-metrics.md)
* [Deployment Metrics](metrics/workload/deployment-metrics.md)
* [Endpoint Metrics](metrics/service/endpoint-metrics.md)
* [Horizontal Pod Autoscaler Metrics](metrics/workload/horizontalpodautoscaler-metrics.md)
* [Ingress Metrics](metrics/service/ingress-metrics.md)
* [Job Metrics](metrics/workload/job-metrics.md)
* [Lease Metrics](metrics/cluster/lease-metrics.md)
* [LimitRange Metrics](metrics/policy/limitrange-metrics.md)
* [MutatingWebhookConfiguration Metrics](metrics/extend/mutatingwebhookconfiguration-metrics.md)
* [Namespace Metrics](metrics/cluster/namespace-metrics.md)
* [NetworkPolicy Metrics](metrics/policy/networkpolicy-metrics.md)
* [Node Metrics](metrics/cluster/node-metrics.md)
* [PersistentVolume Metrics](metrics/storage/persistentvolume-metrics.md)
* [PersistentVolumeClaim Metrics](metrics/storage/persistentvolumeclaim-metrics.md)
* [Pod Disruption Budget Metrics](metrics/policy/poddisruptionbudget-metrics.md)
* [Pod Metrics](metrics/workload/pod-metrics.md)
* [ReplicaSet Metrics](metrics/workload/replicaset-metrics.md)
* [ReplicationController Metrics](metrics/workload/replicationcontroller-metrics.md)
* [ResourceQuota Metrics](metrics/policy/resourcequota-metrics.md)
* [Secret Metrics](metrics/storage/secret-metrics.md)
* [Service Metrics](metrics/service/service-metrics.md)
* [StatefulSet Metrics](metrics/workload/statefulset-metrics.md)
* [StorageClass Metrics](metrics/storage/storageclass-metrics.md)
* [ValidatingWebhookConfiguration Metrics](metrics/extend/validatingwebhookconfiguration-metrics.md)
* [VolumeAttachment Metrics](metrics/storage/volumeattachment-metrics.md)
### Optional Resources
* [ClusterRole Metrics](metrics/cluster/clusterrole-metrics.md)
* [ClusterRoleBinding Metrics](metrics/cluster/clusterrolebinding-metrics.md)
* [EndpointSlice Metrics](metrics/service/endpointslice-metrics.md)
* [IngressClass Metrics](metrics/service/ingressclass-metrics.md)
* [Role Metrics](metrics/auth/role-metrics.md)
* [RoleBinding Metrics](metrics/auth/rolebinding-metrics.md)
* [ServiceAccount Metrics](metrics/auth/serviceaccount-metrics.md)
## Join Metrics
@ -63,17 +79,67 @@ can be used to extend single metrics output.
This example adds `label_release` to the set of default labels of the `kube_pod_status_ready` metric
and allows you select or group the metrics by Helm release label:
```
```promql
kube_pod_status_ready * on (namespace, pod) group_left(label_release) kube_pod_labels
```
Another useful example would be to query the memory usage of pods by its `phase`, such as `Running`:
```
```promql
sum(kube_pod_container_resource_requests{resource="memory"}) by (namespace, pod, node)
* on (namespace, pod) group_left() (sum(kube_pod_status_phase{phase="Running"}) by (pod, namespace) == 1)
```
## Metrics from Custom Resources
See [Custom Resource State Metrics](metrics/extend/customresourcestate-metrics.md) for experimental support for custom resources.
## CLI Arguments
Additionally, options for `kube-state-metrics` can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: [CLI Arguments](cli-arguments.md)
Additionally, options for `kube-state-metrics` can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: [CLI Arguments](developer/cli-arguments.md)
## Protecting /metrics endpoints
Kube-State-Metrics' metrics can contain sensitive information about the state of the cluster, which you as an operator might want to additionally protect from unauthorized access.
In order to achieve this, you need to enable the `--auth-filter` flag on kube-state-metrics.
With this, kube-state-metrics will only accept authenticated and authorized requests to the /metrics endpoints.
Kube-state-metrics uses Kubernetes' RBAC mechanisms for this, so this means that every scrape will trigger a request against the API Server for TokenReview and SubjectAccessReview.
The clients scraping the endpoint, need to use a token which can be provided by a ServiceAccount that can be set up the following way:
A ClusterRole providing access like this:
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: metrics-reader
rules:
- nonResourceURLs:
- "/metrics"
verbs:
- get
```
and a matching ClusterRoleBinding
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-reader-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-reader
subjects:
- kind: ServiceAccount
name: YOUR_SERVICE_ACCOUNT
namespace: NAMESPACE_OF_THE_SERVICE_ACCOUNT
```
Your client can then use either this ServiceAccount to gather metrics or you can create a token, that can be used to fetch data like this:
```bash
TOKEN=$(kubectl create token YOUR_SERVICE_ACCOUNT -n NAMESPACE_OF_THE_SERVICE_ACCOUNT)
curl -H "Authorization: Bearer $TOKEN" KUBE_STATE_METRICS_URL:8080/metrics
```

View File

@ -1,9 +0,0 @@
# CertificateSigningRequest Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_certificatesigningrequest_annotations | Gauge | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt;| EXPERIMENTAL |
| kube_certificatesigningrequest_created| Gauge | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt;| STABLE |
| kube_certificatesigningrequest_condition | Gauge | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; <br> `condition`=&lt;approved\|denied&gt; | STABLE |
| kube_certificatesigningrequest_labels | Gauge | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt;| STABLE |
| kube_certificatesigningrequest_cert_length | Gauge | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt;| STABLE |

View File

@ -1,62 +0,0 @@
# Command line arguments
kube-state-metrics can be configured through command line arguments.
Those arguments can be passed during startup when running locally:
`kube-state-metrics --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER> ...`
Or configured in the `args` section of your deployment configuration in a Kubernetes / Openshift context:
```yaml
spec:
template:
spec:
containers:
- args:
- '--telemetry-port=8081'
- '--kubeconfig=<KUBE-CONFIG>'
- '--apiserver=<APISERVER>'
```
## Available options:
[embedmd]:# (../help.txt)
```txt
$ kube-state-metrics -h
Usage of ./kube-state-metrics:
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files
--apiserver string The URL of the apiserver to use as a master
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
-h, --help Print Help text
--host string Host to expose metrics on. (default "::")
--kubeconfig string Absolute path to the kubeconfig file
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
--log_file string If non-empty, use this log file
--log_file_max_size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files (default true)
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
--metric-annotations-allowlist string Comma-separated list of Kubernetes annotations keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional annotations provide a list of resource names in their plural form and Kubernetes annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'. A single '*' can be provided per resource instead to allow any annotations, but that has severe performance implications (Example: '=pods=[*]').
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
--metric-labels-allowlist string Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]').
--namespaces string Comma-separated list of namespaces to be enabled. Defaults to ""
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level)
--pod string Name of the pod that contains the kube-state-metrics container. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--pod-namespace string Name of the namespace of the pod specified by --pod. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--port int Port to expose metrics on. (default 8080)
--resources string Comma-separated list of Resources to be enabled. Defaults to "certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments"
--shard int32 The instances shard nominal (zero indexed) within the total number of shards. (default 0)
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--telemetry-host string Host to expose kube-state-metrics self metrics on. (default "::")
--telemetry-port int Port to expose kube-state-metrics self metrics on. (default 8081)
--tls-config string Path to the TLS configuration file
--total-shards int The total number of shards. Sharding is disabled when total shards is set to 1. (default 1)
--use-apiserver-cache Sets resourceVersion=0 for ListWatch requests, using cached resources from the apiserver instead of an etcd quorum read.
-v, --v Level number for the log level verbosity
--version kube-state-metrics build version information
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```

View File

@ -1,7 +0,0 @@
# ConfigMap Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_configmap_info | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | STABLE |
| kube_configmap_created | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | STABLE |
| kube_configmap_metadata_resource_version | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | EXPERIMENTAL |

View File

@ -1,16 +0,0 @@
# CronJob Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_cronjob_annotations | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `annotation_CRONJOB_ANNOTATION`=&lt;CRONJOB_ANNOTATION&gt; | EXPERIMENTAL
| kube_cronjob_info | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `schedule`=&lt;schedule&gt; <br> `concurrency_policy`=&lt;concurrency-policy&gt; | STABLE
| kube_cronjob_labels | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `label_CRONJOB_LABEL`=&lt;CRONJOB_LABEL&gt; | STABLE
| kube_cronjob_created | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_next_schedule_time | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_status_active | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_status_last_schedule_time | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_spec_suspend | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_spec_starting_deadline_seconds | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_metadata_resource_version| Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
| kube_cronjob_spec_successful_job_history_limit | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | EXPERIMENTAL
| kube_cronjob_spec_failed_job_history_limit | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | EXPERIMENTAL

View File

@ -1,16 +0,0 @@
# DaemonSet Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_daemonset_annotations | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; <br> `annotation_DAEMONSET_ANNOTATION`=&lt;DAEMONSET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_daemonset_created | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_current_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_desired_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_available | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_misscheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_ready | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_unavailable | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_observed_generation | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_updated_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_metadata_generation | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_labels | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; <br> `label_DAEMONSET_LABEL`=&lt;DAEMONSET_LABEL&gt; | STABLE |

View File

@ -0,0 +1,43 @@
# Dependencies Policy
## Purpose
This policy describes how kube-state-metrics maintainers consume third-party packages.
## Scope
This policy applies to all kube-state-metrics maintainers and all third-party packages used in the kube-state-metrics project.
## Policy
kube-state-metrics maintainers must follow these guidelines when consuming third-party packages:
* Only use third-party packages that are necessary for the functionality of kube-state-metrics.
* Use the latest version of all third-party packages whenever possible.
* Avoid using third-party packages that are known to have security vulnerabilities.
* Pin all third-party packages to specific versions in the kube-state-metrics codebase.
* Use a dependency management tool, such as Go modules, to manage third-party dependencies.
## Procedure
When adding a new third-party package to kube-state-metrics, maintainers must follow these steps:
1. Evaluate the need for the package. Is it necessary for the functionality of kube-state-metrics?
2. Research the package. Is it actively maintained? Does it have a good reputation?
3. Choose a version of the package. Use the latest version whenever possible.
4. Pin the package to the specific version in the kube-state-metrics codebase.
5. Update the kube-state-metrics documentation to reflect the new dependency.
## Enforcement
This policy is enforced by the kube-state-metrics maintainers.
Maintainers are expected to review each other's code changes to ensure that they comply with this policy.
## Exceptions
Exceptions to this policy may be granted by the kube-state-metrics project owners on a case-by-case basis.
## Credits
This policy was adapted from Kubescape's [Environment Dependencies Policy](https://github.com/kubescape/kubescape/blob/master/docs/environment-dependencies-policy.md).

View File

@ -1,19 +0,0 @@
# Deployment Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_deployment_annotations | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; <br> `annotation_DEPLOYMENT_ANNOTATION`=&lt;DEPLOYMENT_ANNOTATION&gt; | EXPERIMENTAL |
| kube_deployment_status_replicas | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_ready | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | EXPERIMENTAL |
| kube_deployment_status_replicas_available | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_unavailable | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_updated | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_observed_generation | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_condition | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; <br> `condition`=&lt;deployment-condition&gt; <br> `status`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_deployment_spec_replicas | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_spec_paused | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_spec_strategy_rollingupdate_max_unavailable | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_spec_strategy_rollingupdate_max_surge | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_metadata_generation | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_labels | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; <br> `label_DEPLOYMENT_LABEL`=&lt;DEPLOYMENT_LABEL&gt; | STABLE |
| kube_deployment_created | Gauge | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |

View File

@ -0,0 +1,72 @@
# Kube-State-Metrics - Timeseries best practices
---
Author: Manuel Rüger (<manuel@rueg.eu>)
Date: October 17th 2024
---
## Introduction
Kube-State-Metrics' goal is to provide insights into the state of Kubernetes objects by exposing them as metrics.
This document provides guidelines with the goal to create a good user experience when using these metrics.
Please be aware that this document is introduced in a later stage of the project and there might be metrics that do not follow these best practices.
Feel encouraged to report these metrics and provide a pull request to improve them.
## General best practices
We follow [Prometheus](https://prometheus.io/docs/practices/naming/) best practices in terms of naming and labeling.
## Best practices for kube-state-metrics
### Avoid pre-computation
kube-state-metrics should expose metrics on an individual object level and avoid any sort of pre-computation unless it is required due to for example high cardinality on objects.
We prefer not to add metrics that can be derived from existing raw metrics. For example, we would not want to expose a metric called `kube_pod_total` as it can be computed with `count(kube_pod_info)`.
This way kube-state-metrics allows the user to have full control on how they want to use the metrics and gives them flexibility to do specific computation.
### Static object properties
An object usually has a stable set of properties that do not change during its lifecycle in Kubernetes.
This includes properties like name, namespace, uid etc. that have a 1:1 relationship with the object.
It is a good practice to group those together into an `_info` metric.
If there is a 1:n relationship (e.g. a list of ports), it should be in a separate metric to avoid generating too many metrics.
### Dynamic object properties
An object can also have a dynamic set of properties, which are usually part of the status field.
These change during the lifecycle of the object.
For example a pod can be in different states like "Pending", "Running" etc.
These should be part of a "State Set" that includes labels that identify the object as well as the dynamic property.
### Linked properties
If an object contains a substructure that links multiple properties together (e.g. endpoint address and port), those should be reported in the same metric.
### Optional properties
Some Kubernetes objects have optional fields. In case there is an optional value, the label should still be exposed, ideally as an empty string.
### Timestamps
Timestamps like creation time or modification time should be exposed as a value. The metric should end with `_timestamp_seconds`. The date value is represented in [UNIX epoch seconds](https://en.wikipedia.org/wiki/Unix_time).
### Cardinality
Some object properties can cause cardinality issues if they can contain a lot of different values or are linked together with multiple properties that also can change a lot.
In this case it is better to limit the number of values that can be exposed within kube-state-metrics by allowing only a few of them and have a default for others.
If for example the Kubernetes object contains a status field that contains an error message that can change a lot, it would be better to have a boolean `error="true"` label in case there is an error.
If there are some error messages that are worth exposing, those could be exposed and for any other message, a default value could be provided.
## Stability
We follow the stability framework derived from Kubernetes, in which we expose experimental and stable metrics.
Experimental metrics are recently introduced or expose alpha/beta resources in the Kubernetes API.
They can change anytime and should be used with caution.
They can be promoted to a stable metric once the object stabilized in the Kubernetes API or they were part of two consecutive releases and haven't observed any changes in them.
Stable metrics are considered frozen with the exception of new labels being added.
A stable metric or a label on a stable metric can be deprecated in release Major.Minor and the earliest point it will be removed is the release Major.Minor+2.

View File

@ -1,9 +1,8 @@
# Kube-State-Metrics - Performance Optimization Proposal
---
Author: Max Inden (IndenML@gmail.com)
Author: Max Inden (<IndenML@gmail.com>)
Date: 23. July 2018
@ -11,16 +10,14 @@ Target release: v1.5.0
---
## Glossary
- kube-state-metrics: “Simple service that listens to the Kubernetes API server
* kube-state-metrics: “Simple service that listens to the Kubernetes API server
and generates metrics about the state of the objects”
- Time series: A single line in a /metrics response e.g.
* Time series: A single line in a /metrics response e.g.
“metric_name{label="value"} 1”
## Problem Statement
There has been repeated reports of two issues running kube-state-metrics on
@ -30,7 +27,6 @@ instances dropping the scrape interval request and marking the given time series
as stale. Second kube-state-metrics uses a lot of memory and thereby being
out-of-memory killed due to low set Kubernetes resource limits.
## Goal
The goal of this proposal can be split into the following sub-goals ordered by
@ -40,7 +36,6 @@ their priority:
2. Decrease overall runtime memory usage
## Status Quo
Instead of requesting the needed information from the Kubernetes API-Server on
@ -56,7 +51,6 @@ On a scrape request by e.g. Prometheus on the /metrics endpoint
kube-state-metrics calculates the configured time series on demand based on the
objects in its cache and converts them to the Prometheus string representation.
## Proposal
Instead of a full representation of all Kubernetes objects with all its
@ -64,7 +58,7 @@ properties in memory via the Kubernetes client-go cache, use a map, addressable
by the Kubernetes object uuid, containing all time series of that object as a
single multi-line string.
```
```go
var cache = map[uuid][]byte{}
```
@ -82,7 +76,7 @@ On a scrape request on the /metrics endpoint, kube-state-metrics iterates over
the cache map and concatenates all time series string blobs into a single
string, which is finally passed on as a response.
```
```text
+---------------+ +-----------+ +---------------+ +-------------------+
| pod_reflector | | pod_store | | pod_collector | | metrics_endpoint |
+---------------+ +-----------+ +---------------+ +-------------------+
@ -122,7 +116,7 @@ string, which is finally passed on as a response.
Build via [text-diagram](http://weidagang.github.io/text-diagram/)
```
```text
object pod_reflector pod_store pod_collector metrics_endpoint
note left of pod_reflector: new pod p1
@ -139,10 +133,9 @@ pod_collector -> metrics_endpoint: concat(metrics)
</details>
## FAQ / Follow up improvements
- If kube-state-metrics only listens on add, update and delete events, how is it
* If kube-state-metrics only listens on add, update and delete events, how is it
aware of already existing Kubernetes objects created before kube-state-metrics
was started? Leveraging Kubernetes client-go, reflectors can initialize all
existing objects before any add, update or delete events. To ensure no events
@ -151,27 +144,25 @@ pod_collector -> metrics_endpoint: concat(metrics)
costs, as Kubernetes client-go already gives decent guarantees on event
delivery.
- What about metadata (HELP and description) in the /metrics output? As a first
* What about metadata (HELP and description) in the /metrics output? As a first
iteration they would be skipped until we have a better idea on the design.
- How can the cache map be concurrently accessed? The core golang map
* How can the cache map be concurrently accessed? The core golang map
implementation is not thread-safe. As a first iteration a simple mutex should
be sufficient. Golang's sync.Map might be considered.
- To solve the problem of out of order events send by the Kubernetes API-Server
* To solve the problem of out of order events send by the Kubernetes API-Server
to kube-state-metrics, to each blob of time series inside the cache map it can
keep the Kubernetes resource version. On add and update events, first compare
the resource version of the event with than the resource version in the cache.
Only move forward if the former is higher than the latter.
- In case the memory consumption of the time series string blobs is a problem
* In case the memory consumption of the time series string blobs is a problem
the following optimization can be considered: Among the time series strings,
multiple sub-strings will be heavily duplicated like the metric name. Instead
of saving unstructured strings inside the cache map, one can structure them,
using pointers to deduplicate e.g. metric names.
- ...
- Kube-state-metrics does not make use of all properties of all Kubernetes
* Kube-state-metrics does not make use of all properties of all Kubernetes
objects. Instead of unmarshalling unused properties, their json struct tags or
their Protobuf representation could be removed.

View File

@ -0,0 +1,94 @@
# Command line arguments
kube-state-metrics can be configured through command line arguments.
Those arguments can be passed during startup when running locally:
`kube-state-metrics --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER> ...`
Or configured in the `args` section of your deployment configuration in a Kubernetes / Openshift context:
```yaml
spec:
template:
spec:
containers:
- args:
- '--telemetry-port=8081'
- '--kubeconfig=<KUBE-CONFIG>'
- '--apiserver=<APISERVER>'
```
## Available options
<!-- markdownlint-disable blanks-around-fences -->
<!-- markdownlint-disable link-image-reference-definitions -->
[embedmd]:# (../../help.txt)
```txt
$ kube-state-metrics -h
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
Usage:
kube-state-metrics [flags]
kube-state-metrics [command]
Available Commands:
completion Generate completion script for kube-state-metrics.
help Help about any command
version Print version information.
Flags:
--add_dir_header If true, adds the file directory to the header of the log messages
--alsologtostderr log to standard error as well as files (no effect when -logtostderr=true)
--apiserver string The URL of the apiserver to use as a master
--auth-filter If true, requires authentication and authorization through Kubernetes API to access metrics endpoints
--auto-gomemlimit Automatically set GOMEMLIMIT to match container or system memory limit. (experimental)
--auto-gomemlimit-ratio float The ratio of reserved GOMEMLIMIT memory to the detected maximum container or system memory. (experimental) (default 0.9)
--config string Path to the kube-state-metrics options config YAML file. If this flag is set, the flags defined in the file override the command line flags.
--custom-resource-state-config string Inline Custom Resource State Metrics config YAML (experimental)
--custom-resource-state-config-file string Path to a Custom Resource State Metrics config file (experimental)
--custom-resource-state-only Only provide Custom Resource State metrics (experimental)
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
-h, --help Print Help text
--host string Host to expose metrics on. (default "::")
--kubeconfig string Absolute path to the kubeconfig file
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (no effect when -logtostderr=true)
--log_file string If non-empty, use this log file (no effect when -logtostderr=true)
--log_file_max_size uint Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
--logtostderr log to standard error instead of files (default true)
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or *ECMAScript-based* regex patterns. The allowlist and denylist are mutually exclusive.
--metric-annotations-allowlist string Comma-separated list of Kubernetes annotations keys that will be used in the resource' labels metric. By default the annotations metrics are not exposed. To include them, provide a list of resource names in their plural form and Kubernetes annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'. A single '*' can be provided per resource instead to allow any annotations, but that has severe performance implications (Example: '=pods=[*]').
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or *ECMAScript-based* regex patterns. The allowlist and denylist are mutually exclusive.
--metric-labels-allowlist string Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the labels metrics are not exposed. To include them, provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]'). Additionally, an asterisk (*) can be provided as a key, which will resolve to all resources, i.e., assuming '--resources=deployments,pods', '=*=[*]' will resolve to '=deployments=[*],pods=[*]'.
--metric-opt-in-list string Comma-separated list of metrics which are opt-in and not enabled by default. This is in addition to the metric allow- and denylists
--namespaces string Comma-separated list of namespaces to be enabled. Defaults to ""
--namespaces-denylist string Comma-separated list of namespaces not to be enabled. If namespaces and namespaces-denylist are both set, only namespaces that are excluded in namespaces-denylist will be used.
--node string Name of the node that contains the kube-state-metrics pod. Most likely it should be passed via the downward API. This is used for daemonset sharding. Only available for resources (pod metrics) that support spec.nodeName fieldSelector. This is experimental.
--object-limit int The total number of objects to list per resource from the API Server. (experimental)
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)
--pod string Name of the pod that contains the kube-state-metrics container. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--pod-namespace string Name of the namespace of the pod specified by --pod. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
--port int Port to expose metrics on. (default 8080)
--resources string Comma-separated list of Resources to be enabled. Defaults to "certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments"
--server-idle-timeout duration The maximum amount of time to wait for the next request when keep-alives are enabled. Align with the idletimeout of your scrape clients. (default 5m0s)
--server-read-header-timeout duration The maximum duration for reading the header of requests. (default 5s)
--server-read-timeout duration The maximum duration for reading the entire request, including the body. Align with the scrape interval or timeout of scraping clients. (default 1m0s)
--server-write-timeout duration The maximum duration before timing out writes of the response. Align with the scrape interval or timeout of scraping clients.. (default 1m0s)
--shard int32 The instances shard nominal (zero indexed) within the total number of shards. (default 0)
--skip_headers If true, avoid header prefixes in the log messages
--skip_log_headers If true, avoid headers when opening log files (no effect when -logtostderr=true)
--stderrthreshold severity logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)
--telemetry-host string Host to expose kube-state-metrics self metrics on. (default "::")
--telemetry-port int Port to expose kube-state-metrics self metrics on. (default 8081)
--tls-config string Path to the TLS configuration file
--total-shards int The total number of shards. Sharding is disabled when total shards is set to 1. (default 1)
--track-unscheduled-pods This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of unscheduled pods is fetched from the Kubernetes API Server. This is experimental.
--use-apiserver-cache Sets resourceVersion=0 for ListWatch requests, using cached resources from the apiserver instead of an etcd quorum read.
-v, --v Level number for the log level verbosity
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
Use "kube-state-metrics [command] --help" for more information about a command.
```
<!-- markdownlint-enable link-image-reference-definitions -->
<!-- markdownlint-enable blanks-around-fences -->

View File

@ -1,21 +1,32 @@
# Developer Guide
# Developer Guide
This developer guide documentation is intended to assist all contributors in various code contributions.
Any contribution to improving this documentation will be appreciated.
## Table of Contents
- [Add New Kubernetes Resource Metric Collector](#add-new-kubernetes-resource-metric-collector)
* [Add New Kubernetes Resource Metric Collector](#add-new-kubernetes-resource-metric-collector)
* [Add New Metrics](#add-new-metrics)
### Add New Kubernetes Resource Metric Collector
The following steps are needed to introduce a new resource and its respective resource metrics.
- Reference your new resource(s) to the [docs/README.md](https://github.com/kubernetes/kube-state-metrics/blob/master/docs/README.md#exposed-metrics).
- Reference your new resource(s) in the [docs/cli-arguments.md](https://github.com/kubernetes/kube-state-metrics/blob/master/docs/cli-arguments.md#available-options) as part of the `--resources` flag.
- Create a new `<name-of-resource>.md` in the [docs](https://github.com/kubernetes/kube-state-metrics/tree/master/docs) directory to provide documentation on the resource(s) and metrics you implemented. Follow the formatting of all other resources.
- Add the resource(s) you are representing to the [examples/standard/cluster-role.yaml](https://github.com/kubernetes/kube-state-metrics/blob/master/examples/standard/cluster-role.yaml) under the appropriate `apiGroup` using the `verbs`: `list` and `watch`.
- Reference and add build functions for the new resource(s) in [internal/store/builder.go](https://github.com/kubernetes/kube-state-metrics/blob/master/internal/store/builder.go).
- Reference the new resource in [pkg/options/resource.go](https://github.com/kubernetes/kube-state-metrics/blob/master/pkg/options/resource.go).
- Add a sample Kubernetes manifest to be used by tests in the [tests/manifests/](https://github.com/kubernetes/kube-state-metrics/tree/master/tests/manifests) directory.
- Lastly, and most importantly, actually implement your new resource(s) and its test binary in [internal/store](https://github.com/kubernetes/kube-state-metrics/tree/master/internal/store). Follow the formatting and structure of other resources.
* Reference your new resource(s) to the [docs/README.md](./../README.md#exposed-metrics).
* Reference your new resource(s) in the [docs/developer/cli-arguments.md](./cli-arguments.md#available-options) as part of the `--resources` flag.
* Create a new `<name-of-resource>.md` in the [docs](./../docs) directory to provide documentation on the resource(s) and metrics you implemented. Follow the formatting of all other resources.
* Add the resource(s) you are representing to the [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](./../../jsonnet/kube-state-metrics/kube-state-metrics.libsonnet) under the appropriate `apiGroup` using the `verbs`: `list` and `watch`.
* Run `make examples/standard`, this should re-generate [examples/standard/cluster-role.yaml](./../../examples/standard/cluster-role.yaml) with the resource(s) added to [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](./../../jsonnet/kube-state-metrics/kube-state-metrics.libsonnet).
* Reference and add build functions for the new resource(s) in [internal/store/builder.go](./../../internal/store/builder.go).
* Reference the new resource in [pkg/options/resource.go](./../../pkg/options/resource.go).
* Add a sample Kubernetes manifest to be used by tests in the [tests/manifests/](./../../tests/manifests) directory.
* Lastly, and most importantly, actually implement your new resource(s) and its test binary in [internal/store](./../../internal/store). Follow the formatting and structure of other resources.
### Add New Metrics
* Make metrics experimental first when introducing them, refer [#1910](https://github.com/kubernetes/kube-state-metrics/pull/1910) for more information.
| Metric stability level | |
|------------------------|--------------------|
| EXPERIMENTAL | basemetrics.ALPHA |
| STABLE | basemetrics.STABLE |

View File

@ -1,10 +0,0 @@
# Endpoint Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_endpoint_annotations | Gauge | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `annotation_ENDPOINT_ANNOTATION`=&lt;ENDPOINT_ANNOTATION&gt; | EXPERIMENTAL |
| kube_endpoint_address_not_ready | Gauge | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
| kube_endpoint_address_available | Gauge | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
| kube_endpoint_info | Gauge | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
| kube_endpoint_labels | Gauge | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `label_ENDPOINT_LABEL`=&lt;ENDPOINT_LABEL&gt; | STABLE |
| kube_endpoint_created | Gauge | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |

View File

@ -1,13 +0,0 @@
# Horizontal Pod Autoscaler Metrics
| Metric name | Metric type | Labels/tags | Status |
| -------------------------------- | ----------- | ------------------------------------------------------------- | ------ |
| kube_horizontalpodautoscaler_annotations | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | EXPERIMENTAL |
| kube_horizontalpodautoscaler_labels | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_metadata_generation | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_spec_max_replicas | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_spec_min_replicas | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_spec_target_metric | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; <br> `metric_name`=&lt;metric-name&gt; <br> `metric_target_type`=&lt;value\|utilization\|average&gt; | EXPERIMENTAL |
| kube_horizontalpodautoscaler_status_condition | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; <br> `condition`=&lt;hpa-condition&gt; <br> `status`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_horizontalpodautoscaler_status_current_replicas | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_status_desired_replicas | Gauge | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |

View File

@ -1,11 +0,0 @@
# Ingress Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_ingress_annotations | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `annotation_INGRESS_ANNOTATION`=&lt;ANNOTATION_LABEL&gt; | EXPERIMENTAL |
| kube_ingress_info | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; | STABLE |
| kube_ingress_labels | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `label_INGRESS_LABEL`=&lt;INGRESS_LABEL&gt; | STABLE |
| kube_ingress_created | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; | STABLE |
| kube_ingress_metadata_resource_version | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; | EXPERIMENTAL |
| kube_ingress_path | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `host`=&lt;ingress-host&gt; <br> `path`=&lt;ingress-path&gt; <br> `service_name`=&lt;service name for the path&gt; <br> `service_port`=&lt;service port for the path&gt; | STABLE |
| kube_ingress_tls | Gauge | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `tls_host`=&lt;tls hostname&gt; <br> `secret`=&lt;tls secret name&gt;| STABLE |

View File

@ -1,19 +0,0 @@
# Job Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_job_annotations | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `annotation_JOB_ANNOTATION`=&lt;JOB_ANNOTATION&gt; | EXPERIMENTAL |
| kube_job_info | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_labels | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `label_JOB_LABEL`=&lt;JOB_LABEL&gt; | STABLE |
| kube_job_owner | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | STABLE |
| kube_job_spec_parallelism | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_spec_completions | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_spec_active_deadline_seconds | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_active | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_succeeded | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_failed | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `reason`=&lt;failure reason&gt; | STABLE |
| kube_job_status_start_time | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_completion_time | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_complete | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_job_failed | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_job_created | Gauge | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |

View File

@ -1,6 +0,0 @@
# Lease Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_lease_owner | Gauge | `lease`=&lt;lease-name&gt; <br> `owner_kind`=&lt;onwer kind&gt; <br> `owner_name`=&lt;owner name&gt; | EXPERIMENTAL |
| kube_lease_renew_time | Gauge | `lease`=&lt;lease-name&gt; | EXPERIMENTAL |

View File

@ -1,6 +0,0 @@
# LimitRange Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_limitrange | Gauge | `limitrange`=&lt;limitrange-name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;ResourceName&gt; <br> `type`=&lt;Pod\|Container\|PersistentVolumeClaim&gt; <br> `constraint`=&lt;constraint&gt;| STABLE |
| kube_limitrange_created | Gauge | `limitrange`=&lt;limitrange-name&gt; <br> `namespace`=&lt;namespace&gt; | STABLE |

View File

@ -0,0 +1,9 @@
# CertificateSigningRequest Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_certificatesigningrequest_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | EXPERIMENTAL |
| kube_certificatesigningrequest_created | Gauge | | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |
| kube_certificatesigningrequest_condition | Gauge | | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; <br> `condition`=&lt;approved\|denied&gt; | STABLE |
| kube_certificatesigningrequest_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |
| kube_certificatesigningrequest_cert_length | Gauge | | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |

View File

@ -0,0 +1,9 @@
# Role Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ----------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------------ |
| kube_role_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
| kube_role_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
| kube_role_info | Gauge | | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
| kube_role_created | Gauge | | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
| kube_role_metadata_resource_version | Gauge | | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,9 @@
# RoleBinding Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_rolebinding_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `rolebinding`=&lt;rolebinding-name&gt; <br> `namespace`=&lt;rolebinding-namespace&gt; | EXPERIMENTAL |
| kube_rolebinding_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `rolebinding`=&lt;rolebinding-name&gt; <br> `namespace`=&lt;rolebinding-namespace&gt; | EXPERIMENTAL |
| kube_rolebinding_info | Gauge | | `rolebinding`=&lt;rolebinding-name&gt; <br> `namespace`=&lt;rolebinding-namespace&gt; <br> `roleref_kind`=&lt;role-kind&gt; <br> `roleref_name`=&lt;role-name&gt; | EXPERIMENTAL |
| kube_rolebinding_created | Gauge | | `rolebinding`=&lt;rolebinding-name&gt; <br> `namespace`=&lt;rolebinding-namespace&gt; | EXPERIMENTAL |
| kube_rolebinding_metadata_resource_version | Gauge | | `rolebinding`=&lt;rolebinding-name&gt; <br> `namespace`=&lt;rolebinding-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,11 @@
# ServiceAccount Metrics
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_serviceaccount_info | Gauge | Information about a service account | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; <br> `automount_token`=&lt;serviceaccount-automount-token&gt; | EXPERIMENTAL |
| kube_serviceaccount_created | Gauge | Unix creation timestamp | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; | EXPERIMENTAL |
| kube_serviceaccount_deleted | Gauge | Unix deletion timestamp | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; | EXPERIMENTAL |
| kube_serviceaccount_secret | Gauge | Secret being referenced by a service account | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; <br> `name`=&lt;secret-name&gt; | EXPERIMENTAL |
| kube_serviceaccount_image_pull_secret | Gauge | Secret being referenced by a service account for the purpose of pulling images | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; <br> `name`=&lt;secret-name&gt; | EXPERIMENTAL |
| kube_serviceaccount_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; <br> `annotation_SERVICE_ACCOUNT_ANNOTATION`=&lt;SERVICE_ACCOUNT_ANNOTATION&gt; | EXPERIMENTAL |
| kube_serviceaccount_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `namespace`=&lt;serviceaccount-namespace&gt; <br> `serviceaccount`=&lt;serviceaccount-name&gt; <br> `uid`=&lt;serviceaccount-uid&gt; <br> `label_SERVICE_ACCOUNT_LABEL`=&lt;SERVICE_ACCOUNT_LABEL&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,9 @@
# ClusterRole Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------------ |
| kube_clusterrole_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `clusterrole`=&lt;clusterrole-name&gt; | EXPERIMENTAL |
| kube_clusterrole_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `clusterrole`=&lt;clusterrole-name&gt; | EXPERIMENTAL |
| kube_clusterrole_info | Gauge | | `clusterrole`=&lt;clusterrole-name&gt; | EXPERIMENTAL |
| kube_clusterrole_created | Gauge | | `clusterrole`=&lt;clusterrole-name&gt; | EXPERIMENTAL |
| kube_clusterrole_metadata_resource_version | Gauge | | `clusterrole`=&lt;clusterrole-name&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,9 @@
# ClusterRoleBinding Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_clusterrolebinding_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `clusterrolebinding`=&lt;clusterrolebinding-name&gt; | EXPERIMENTAL |
| kube_clusterrolebinding_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `clusterrolebinding`=&lt;clusterrolebinding-name&gt; | EXPERIMENTAL |
| kube_clusterrolebinding_info | Gauge | | `clusterrolebinding`=&lt;clusterrolebinding-name&gt; <br> `roleref_kind`=&lt;role-kind&gt; <br> `roleref_name`=&lt;role-name&gt; | EXPERIMENTAL |
| kube_clusterrolebinding_created | Gauge | | `clusterrolebinding`=&lt;clusterrolebinding-name&gt; | EXPERIMENTAL |
| kube_clusterrolebinding_metadata_resource_version | Gauge | | `clusterrolebinding`=&lt;clusterrolebinding-name&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,6 @@
# Lease Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| --------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| kube_lease_owner | Gauge | | `lease`=&lt;lease-name&gt; <br> `owner_kind`=&lt;onwer kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `namespace` = &lt;namespace&gt; <br> `lease_holder`=&lt;lease holder name&gt; | EXPERIMENTAL |
| kube_lease_renew_time | Gauge | | `lease`=&lt;lease-name&gt; <br> `namespace` = &lt;namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,9 @@
# Namespace Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_namespace_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `namespace`=&lt;namespace-name&gt; <br> `label_NS_ANNOTATION`=&lt;NS_ANNOTATION&gt; | EXPERIMENTAL |
| kube_namespace_created | Gauge | | `namespace`=&lt;namespace-name&gt; | STABLE |
| kube_namespace_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `namespace`=&lt;namespace-name&gt; <br> `label_NS_LABEL`=&lt;NS_LABEL&gt; | STABLE |
| kube_namespace_status_condition | Gauge | | `namespace`=&lt;namespace-name&gt; <br> `condition`=&lt;NamespaceDeletionDiscoveryFailure\|NamespaceDeletionContentFailure\|NamespaceDeletionGroupVersionParsingFailure&gt; <br> `status`=&lt;true\|false\|unknown&gt; | EXPERIMENTAL |
| kube_namespace_status_phase | Gauge | | `namespace`=&lt;namespace-name&gt; <br> `phase`=&lt;Active\|Terminating&gt; | STABLE |

View File

@ -0,0 +1,16 @@
# Node Metrics
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ---------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_node_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `node`=&lt;node-address&gt; <br> `annotation_NODE_ANNOTATION`=&lt;NODE_ANNOTATION&gt; | EXPERIMENTAL |
| kube_node_info | Gauge | Information about a cluster node | | `node`=&lt;node-address&gt; <br> `kernel_version`=&lt;kernel-version&gt; <br> `os_image`=&lt;os-image-name&gt; <br> `container_runtime_version`=&lt;container-runtime-and-version-combination&gt; <br> `kubelet_version`=&lt;kubelet-version&gt; <br> `kubeproxy_version`=&lt;deprecated&gt; <br> `pod_cidr`=&lt;pod-cidr&gt; <br> `provider_id`=&lt;provider-id&gt; <br> `system_uuid`=&lt;system-uuid&gt; <br> `internal_ip`=&lt;internal-ip&gt; | STABLE |
| kube_node_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `node`=&lt;node-address&gt; <br> `label_NODE_LABEL`=&lt;NODE_LABEL&gt; | STABLE |
| kube_node_role | Gauge | The role of a cluster node | | `node`=&lt;node-address&gt; <br> `role`=&lt;NODE_ROLE&gt; | EXPERIMENTAL |
| kube_node_spec_unschedulable | Gauge | Whether a node can schedule new pods | | `node`=&lt;node-address&gt; | STABLE |
| kube_node_spec_taint | Gauge | The taint of a cluster node. | | `node`=&lt;node-address&gt; <br> `key`=&lt;taint-key&gt; <br> `value=`&lt;taint-value&gt; <br> `effect=`&lt;taint-effect&gt; | STABLE |
| kube_node_status_capacity | Gauge | The total amount of resources available for a node | `cpu`=&lt;core&gt; <br> `ephemeral_storage`=&lt;byte&gt; <br> `pods`=&lt;integer&gt; <br> `attachable_volumes_*`=&lt;byte&gt; <br> `hugepages_*`=&lt;byte&gt; <br> `memory`=&lt;byte&gt; | `node`=&lt;node-address&gt; <br> `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; | STABLE |
| kube_node_status_addresses | Gauge | The addresses of a node | | `node`=&lt;node-address&gt; <br> `type`=&lt;address-type&gt; <br> `address`=&lt;address-value&gt; | EXPERIMENTAL |
| kube_node_status_allocatable | Gauge | The amount of resources allocatable for pods (after reserving some for system daemons) | `cpu`=&lt;core&gt; <br> `ephemeral_storage`=&lt;byte&gt; <br> `pods`=&lt;integer&gt; <br> `attachable_volumes_*`=&lt;byte&gt; <br> `hugepages_*`=&lt;byte&gt; <br> `memory`=&lt;byte&gt; | `node`=&lt;node-address&gt; <br> `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; | STABLE |
| kube_node_status_condition | Gauge | The condition of a cluster node | | `node`=&lt;node-address&gt; <br> `condition`=&lt;node-condition&gt; <br> `status`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_node_created | Gauge | Unix creation timestamp | seconds | `node`=&lt;node-address&gt; | STABLE |
| kube_node_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `node`=&lt;node-address&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,852 @@
# Custom Resource State Metrics
This section describes how to add metrics based on the state of a custom resource without writing a custom resource
registry and running your own build of KSM.
## Configuration
A YAML configuration file described below is required to define your custom resources and the fields to turn into metrics.
Two flags can be used:
* `--custom-resource-state-config "inline yaml (see example)"` or
* `--custom-resource-state-config-file /path/to/config.yaml`
If both flags are provided, the inline configuration will take precedence.
When multiple entries for the same resource exist, kube-state-metrics will exit with an error.
This includes configuration which refers to a different API version.
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-state-metrics
namespace: kube-system
spec:
template:
spec:
containers:
- name: kube-state-metrics
args:
- --custom-resource-state-config
# in YAML files, | allows a multi-line string to be passed as a flag value
# see https://yaml-multiline.info
- |
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
version: "v1"
kind: Foo
metrics:
- name: active_count
help: "Count of active Foo"
each:
type: Gauge
...
```
It's also possible to configure kube-state-metrics to run in a `custom-resource-mode` only. In addition to specifying one of `--custom-resource-state-config*` flags, you could set `--custom-resource-state-only` to `true`.
With this configuration only the known custom resources configured in `--custom-resource-state-config*` will be taken into account by kube-state-metrics.
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-state-metrics
namespace: kube-system
spec:
template:
spec:
containers:
- name: kube-state-metrics
args:
- --custom-resource-state-config
# in YAML files, | allows a multi-line string to be passed as a flag value
# see https://yaml-multiline.info
- |
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
version: "v1"
kind: Foo
metrics:
- name: active_count
help: "Count of active Foo"
each:
type: Gauge
...
- --custom-resource-state-only=true
```
NOTE: The `customresource_group`, `customresource_version`, and `customresource_kind` common labels are reserved, and will be overwritten by the values from the `groupVersionKind` field.
### RBAC-enabled Clusters
Please be aware that kube-state-metrics needs list and watch permissions granted to `customresourcedefinitions.apiextensions.k8s.io` as well as to the resources you want to gather metrics from.
### Examples
The examples in this section will use the following custom resource:
```yaml
kind: Foo
apiVersion: myteam.io/vl
metadata:
annotations:
bar: baz
qux: quxx
labels:
foo: bar
name: foo
spec:
version: v1.2.3
order:
- id: 1
value: true
- id: 3
value: false
replicas: 1
refs:
- my_other_foo
- foo_2
- foo_with_extensions
status:
phase: Pending
active:
type-a: 1
type-b: 3
conditions:
- name: a
value: 45
- name: b
value: 66
sub:
type-a:
active: 1
ready: 2
type-b:
active: 3
ready: 4
uptime: 43.21
```
#### Single Values
The config:
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
metrics:
- name: "uptime"
help: "Foo uptime"
each:
type: Gauge
gauge:
path: [status, uptime]
```
Produces the metric:
```prometheus
kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
```
#### Multiple Metrics/Kitchen Sink
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
# labels can be added to all metrics from a resource
commonLabels:
crd_type: "foo"
labelsFromPath:
name: [metadata, name]
metrics:
- name: "ready_count"
help: "Number Foo Bars ready"
each:
type: Gauge
gauge:
# targeting an object or array will produce a metric for each element
# labelsFromPath and value are relative to this path
path: [status, sub]
# if path targets an object, the object key will be used as label value
# This is not supported for StateSet type as all values will be truthy, which is redundant.
labelFromKey: type
# label values can be resolved specific to this path
labelsFromPath:
active: [active]
# The actual field to use as metric value. Should be a number, boolean or RFC3339 timestamp string.
valueFrom: [ready]
commonLabels:
custom_metric: "yes"
labelsFromPath:
# whole objects may be copied into labels by prefixing with "*"
# *anything will be copied into labels, with the highest sorted * strings first
"*": [metadata, labels]
# a prefix before the asterisk will be used as a label prefix
"lorem_*": [metadata, annotations]
"**": [metadata, annotations]
# or specific fields may be copied. these fields will always override values from *s
name: [metadata, name]
foo: [metadata, labels, foo]
```
Produces the following metrics:
```prometheus
kube_customresource_ready_count{customresource_group="myteam.io", customresource_kind="Foo",
customresource_version="v1", active="1",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-a",
lorem_bar="baz",lorem_qux="quxx",} 2
kube_customresource_ready_count{customresource_group="myteam.io", customresource_kind="Foo",
customresource_version="v1", active="3",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-b",
lorem_bar="baz",lorem_qux="quxx",} 4
```
#### Non-map Arrays
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
labelsFromPath:
name: [metadata, name]
metrics:
- name: "ref_info"
help: "Reference to other Foo"
each:
type: Info
info:
# targeting an array will produce a metric for each element
# labelsFromPath and value are relative to this path
path: [spec, refs]
# if path targets a list of values (e.g. strings or numbers, not objects or maps), individual values can
# referenced by a label using this syntax
labelsFromPath:
ref: []
```
Produces the following metrics:
```prometheus
kube_customresource_ref_info{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", name="foo",ref="my_other_foo"} 1
kube_customresource_ref_info{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", name="foo",ref="foo_2"} 1
kube_customresource_ref_info{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", name="foo",ref="foo_with_extensions"} 1
```
#### Same Metrics with Different Labels
```yaml
recommendation:
containerRecommendations:
- containerName: consumer
lowerBound:
cpu: 100m
memory: 262144k
```
For example in VPA we have above attributes and we want to have a same metrics for both CPU and Memory, you can use below config:
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: autoscaling.k8s.io
kind: "VerticalPodAutoscaler"
version: "v1"
labelsFromPath:
verticalpodautoscaler: [metadata, name]
namespace: [metadata, namespace]
target_api_version: [apiVersion]
target_kind: [spec, targetRef, kind]
target_name: [spec, targetRef, name]
metrics:
# for memory
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound"
help: "Minimum memory resources the container can use before the VerticalPodAutoscaler updater evicts it."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [lowerBound, memory]
# for CPU
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound"
help: "Minimum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [lowerBound, cpu]
```
Produces the following metrics:
```prometheus
# HELP kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound Minimum memory resources the container can use before the VerticalPodAutoscaler updater evicts it.
# TYPE kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound gauge
kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{container="consumer",customresource_group="autoscaling.k8s.io",customresource_kind="VerticalPodAutoscaler",customresource_version="v1",namespace="namespace-example",resource="memory",target_api_version="apps/v1",target_kind="Deployment",target_name="target-name-example",unit="byte",verticalpodautoscaler="vpa-example"} 123456
# HELP kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound Minimum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it.
# TYPE kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound gauge
kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{container="consumer",customresource_group="autoscaling.k8s.io",customresource_kind="VerticalPodAutoscaler",customresource_version="v1",namespace="namespace-example",resource="cpu",target_api_version="apps/v1",target_kind="Deployment",target_name="target-name-example",unit="core",verticalpodautoscaler="vpa-example"} 0.1
```
#### VerticalPodAutoscaler
In v2.9.0 the `vericalpodautoscalers` resource was removed from the list of default resources. In order to generate metrics for `verticalpodautoscalers`, you can use the following Custom Resource State config:
```yaml
# Using --resource=verticalpodautoscalers, we get the following output:
# HELP kube_verticalpodautoscaler_annotations Kubernetes annotations converted to Prometheus labels.
# TYPE kube_verticalpodautoscaler_annotations gauge
# kube_verticalpodautoscaler_annotations{namespace="default",verticalpodautoscaler="hamster-vpa",target_api_version="apps/v1",target_kind="Deployment",target_name="hamster"} 1
# A similar result can be achieved by specifying the following in --custom-resource-state-config:
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: autoscaling.k8s.io
kind: "VerticalPodAutoscaler"
version: "v1"
labelsFromPath:
verticalpodautoscaler: [metadata, name]
namespace: [metadata, namespace]
target_api_version: [apiVersion]
target_kind: [spec, targetRef, kind]
target_name: [spec, targetRef, name]
metrics:
- name: "annotations"
help: "Kubernetes annotations converted to Prometheus labels."
each:
type: Gauge
gauge:
path: [metadata, annotations]
# This will output the following metric:
# HELP kube_customresource_autoscaling_annotations Kubernetes annotations converted to Prometheus labels.
# TYPE kube_customresource_autoscaling_annotations gauge
# kube_customresource_autoscaling_annotations{customresource_group="autoscaling.k8s.io", customresource_kind="VerticalPodAutoscaler", customresource_version="v1", namespace="default",target_api_version="autoscaling.k8s.io/v1",target_kind="Deployment",target_name="hamster",verticalpodautoscaler="hamster-vpa"} 123
```
The above configuration was tested on [this](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/examples/hamster.yaml) VPA configuration, with an added annotation (`foo: 123`).
#### All VerticalPodAutoscaler Metrics
As an addition for the above configuration, here's the complete `CustomResourceStateMetrics` spec to re-enable all of the VPA metrics which are removed from the list of the default resources:
<details>
<summary>VPA CustomResourceStateMetrics</summary>
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: autoscaling.k8s.io
kind: "VerticalPodAutoscaler"
version: "v1"
labelsFromPath:
namespace: [metadata, namespace]
target_api_version: [spec, targetRef, apiVersion]
target_kind: [spec, targetRef, kind]
target_name: [spec, targetRef, name]
verticalpodautoscaler: [metadata, name]
metricNamePrefix: "kube"
metrics:
# kube_verticalpodautoscaler_annotations
- name: "verticalpodautoscaler_annotations"
help: "Kubernetes annotations converted to Prometheus labels."
each:
type: Info
info:
labelsFromPath:
annotation_*: [metadata, annotations]
name: [metadata, name]
# kube_verticalpodautoscaler_labels
- name: "verticalpodautoscaler_labels"
help: "Kubernetes labels converted to Prometheus labels."
each:
type: Info
info:
labelsFromPath:
label_*: [metadata, labels]
name: [metadata, name]
# kube_verticalpodautoscaler_spec_updatepolicy_updatemode
- name: "verticalpodautoscaler_spec_updatepolicy_updatemode"
help: "Update mode of the VerticalPodAutoscaler."
each:
type: StateSet
stateSet:
labelName: "update_mode"
path: [spec, updatePolicy, updateMode]
list: ["Auto", "Initial", "Off", "Recreate"]
# Memory kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_memory
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_memory"
help: "Minimum memory resources the VerticalPodAutoscaler can set for containers matching the name."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [spec, resourcePolicy, containerPolicies]
labelsFromPath:
container: [containerName]
valueFrom: [minAllowed, memory]
# CPU kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_cpu
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_cpu"
help: "Minimum cpu resources the VerticalPodAutoscaler can set for containers matching the name."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [spec, resourcePolicy, containerPolicies]
labelsFromPath:
container: [containerName]
valueFrom: [minAllowed, cpu]
# Memory kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_memory
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_memory"
help: "Maximum memory resources the VerticalPodAutoscaler can set for containers matching the name."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [spec, resourcePolicy, containerPolicies]
labelsFromPath:
container: [containerName]
valueFrom: [maxAllowed, memory]
# CPU kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_cpu
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_cpu"
help: "Maximum cpu resources the VerticalPodAutoscaler can set for containers matching the name."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [spec, resourcePolicy, containerPolicies]
labelsFromPath:
container: [containerName]
valueFrom: [maxAllowed, cpu]
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_memory
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_memory"
help: "Minimum memory resources the container can use before the VerticalPodAutoscaler updater evicts it."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [lowerBound, memory]
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_cpu
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_cpu"
help: "Minimum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [lowerBound, cpu]
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_memory
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_memory"
help: "Maximum memory resources the container can use before the VerticalPodAutoscaler updater evicts it."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [upperBound, memory]
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_cpu
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_cpu"
help: "Maximum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [upperBound, cpu]
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target_memory
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_target_memory"
help: "Target memory resources the VerticalPodAutoscaler recommends for the container."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [target, memory]
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target_cpu
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_target_cpu"
help: "Target cpu resources the VerticalPodAutoscaler recommends for the container."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [target, cpu]
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_memory
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_memory"
help: "Target memory resources the VerticalPodAutoscaler recommends for the container ignoring bounds."
commonLabels:
unit: "byte"
resource: "memory"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [uncappedTarget, memory]
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_cpu
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_cpu"
help: "Target memory resources the VerticalPodAutoscaler recommends for the container ignoring bounds."
commonLabels:
unit: "core"
resource: "cpu"
each:
type: Gauge
gauge:
path: [status, recommendation, containerRecommendations]
labelsFromPath:
container: [containerName]
valueFrom: [uncappedTarget, cpu]
```
</details>
### Metric types
The configuration supports three kind of metrics from the [OpenMetrics specification](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md).
The metric type is specified by the `type` field and its specific configuration at the types specific struct.
#### Gauge
> Gauges are current measurements, such as bytes of memory currently used or the number of items in a queue. For gauges the absolute value is what is of interest to a user. [[0]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#gauge)
Example:
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
metrics:
- name: "uptime"
help: "Foo uptime"
each:
type: Gauge
gauge:
path: [status, uptime]
```
Produces the metric:
```prometheus
kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
```
##### Type conversion and special handling
Gauges produce values of type float64 but custom resources can be of all kinds of types.
Kube-state-metrics performs implicit type conversions for a lot of type.
Supported types are:
* (u)int32/64, int, float32 and byte are cast to float64
* `nil` is generally mapped to `0.0` if NilIsZero is `true`, otherwise it will throw an error
* for bool `true` is mapped to `1.0` and `false` is mapped to `0.0`
* for string the following logic applies
* `"true"` and `"yes"` are mapped to `1.0`, `"false"`, `"no"` and `"unknown"` are mapped to `0.0` (all case-insensitive)
* RFC3339 times are parsed to float timestamp
* Quantities like "250m" or "512Gi" are parsed to float using <https://github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/quantity.go>
* Percentages ending with a "%" are parsed to float
* finally the string is parsed to float using <https://pkg.go.dev/strconv#ParseFloat> which should support all common number formats. If that fails an error is yielded
##### Example for status conditions on Kubernetes Controllers
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
labelsFromPath:
name:
- metadata
- name
namespace:
- metadata
- namespace
metrics:
- name: "foo_status"
help: "status condition "
each:
type: Gauge
gauge:
path: [status, conditions]
labelsFromPath:
type: ["type"]
valueFrom: ["status"]
```
This will work for kubernetes controller CRs which expose status conditions according to the kubernetes api (<https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Condition>):
```yaml
status:
conditions:
- lastTransitionTime: "2019-10-22T16:29:31Z"
status: "True"
type: Ready
```
kube_customresource_foo_status{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", type="Ready"} 1.0
#### StateSet
> StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet. [[1]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset)
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
metrics:
- name: "status_phase"
help: "Foo status_phase"
each:
type: StateSet
stateSet:
labelName: phase
path: [status, phase]
list: [Pending, Bar, Baz]
```
Metrics of type `StateSet` will generate a metric for each value defined in `list` for each resource.
The value will be 1, if the value matches the one in list.
Produces the metric:
```prometheus
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Pending"} 1
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Bar"} 0
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Baz"} 0
```
#### Info
> Info metrics are used to expose textual information which SHOULD NOT change during process lifetime. Common examples are an application's version, revision control commit, and the version of a compiler. [[2]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#info)
Metrics of type `Info` will always have a value of 1.
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: myteam.io
kind: "Foo"
version: "v1"
metrics:
- name: "version"
help: "Foo version"
each:
type: Info
info:
labelsFromPath:
version: [spec, version]
```
Produces the metric:
```prometheus
kube_customresource_version{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", version="v1.2.3"} 1
```
### Naming
The default metric names are prefixed to avoid collisions with other metrics.
By default, a metric prefix of `kube_` concatenated with your custom resource's group+version+kind is used.
You can override this behavior with the `metricNamePrefix` field.
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind: ...
metricNamePrefix: myteam_foos
metrics:
- name: uptime
# ...
```
Produces:
```prometheus
myteam_foos_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
```
To omit namespace and/or subsystem altogether, set them to the empty string:
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind: ...
metricNamePrefix: ""
metrics:
- name: uptime
# ...
```
Produces:
```prometheus
uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
```
### Logging
If a metric path is registered but not found on a custom resource, an error will be logged. For some resources,
this may produce a lot of noise. The error log [verbosity][vlog] for a metric or resource can be set with `errorLogV` on
the resource or metric:
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind: ...
errorLogV: 0 # 0 = default for errors
metrics:
- name: uptime
errorLogV: 10 # only log at high verbosity
```
[vlog]: https://github.com/go-logr/logr#why-v-levels
### Path Syntax
Paths are specified as a list of strings. Each string is a path segment, resolved dynamically against the data of the custom resource.
If any part of a path is missing, the result is nil.
Examples:
```yaml
# simple path lookup
[spec, replicas] # spec.replicas == 1
# indexing an array
[spec, order, "0", value] # spec.order[0].value = true
# finding an element in a list by key=value
[status, conditions, "[name=a]", value] # status.conditions[0].value = 45
# if the value to be matched is a number or boolean, the value is compared as a number or boolean
[status, conditions, "[value=66]", name] # status.conditions[1].name = "b"
# For generally matching against a field in an object schema, use the following syntax:
[metadata, "name=foo"] # if v, ok := metadata[name]; ok && v == "foo" { return v; } else { /* ignore */ }
```
### Wildcard matching of version and kind fields
The Custom Resource State (CRS hereon) configuration also allows you to monitor all versions and/or kinds that come under a group. It watches
the installed CRDs for this purpose. Taking the aforementioned `Foo` object as reference, the configuration below allows
you to monitor all objects under all versions *and* all kinds that come under the `myteam.io` group.
```yaml
kind: CustomResourceStateMetrics
spec:
resources:
- groupVersionKind:
group: "myteam.io"
version: "*" # Set to `v1 to monitor all kinds under `myteam.io/v1`. Wildcard matches all installed versions that come under this group.
kind: "*" # Set to `Foo` to monitor all `Foo` objects under the `myteam.io` group (under all versions). Wildcard matches all installed kinds that come under this group (and version, if specified).
metrics:
- name: "myobject_info"
help: "Foo Bar Baz"
each:
type: Info
info:
path: [metadata]
labelsFromPath:
object: [name]
namespace: [namespace]
```
The configuration above produces these metrics.
```yaml
kube_customresource_myobject_info{customresource_group="myteam.io",customresource_kind="Foo",customresource_version="v1",namespace="ns",object="foo"} 1
kube_customresource_myobject_info{customresource_group="myteam.io",customresource_kind="Bar",customresource_version="v1",namespace="ns",object="bar"} 1
```
#### Note
* For cases where the GVKs defined in a CRD have multiple versions under a single group for the same kind, as expected, the wildcard value will resolve to *all* versions, but a query for any specific version will return all resources under all versions, in that versions' representation. This basically means that for two such versions `A` and `B`, if a resource exists under `B`, it will reflect in the metrics generated for `A` as well, in addition to any resources of itself, and vice-versa. This logic is based on the [current `list`ing behavior](https://github.com/kubernetes/client-go/issues/1251#issuecomment-1544083071) of the client-go library.
* The introduction of this feature further discourages (and discontinues) the use of native objects in the CRS featureset, since these do not have an explicit CRD associated with them, and conflict with internal stores defined specifically for such native resources. Please consider opening an issue or raising a PR if you'd like to expand on the current metric labelsets for them. Also, any such configuration will be ignored, and no metrics will be generated for the same.

View File

@ -0,0 +1,8 @@
# MutatingWebhookConfiguration Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| -------------------------------------------------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_mutatingwebhookconfiguration_info | Gauge | | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_mutatingwebhookconfiguration_created | Gauge | | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_mutatingwebhookconfiguration_metadata_resource_version | Gauge | | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_mutatingwebhookconfiguration_webhook_clientconfig_service | Gauge | | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; <br> `webhook_name`=&lt;webhook-name&gt; <br> `service_name`=&lt;webhook-service-name&gt; <br> `service_namespace`=&lt;webhook-service-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,8 @@
# ValidatingWebhookConfiguration Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ---------------------------------------------------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_validatingwebhookconfiguration_info | Gauge | | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_validatingwebhookconfiguration_created | Gauge | | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_validatingwebhookconfiguration_metadata_resource_version | Gauge | | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_validatingwebhookconfiguration_webhook_clientconfig_service | Gauge | | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; <br> `webhook_name`=&lt;webhook-name&gt; <br> `service_name`=&lt;webhook-service-name&gt; <br> `service_namespace`=&lt;webhook-service-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,6 @@
# LimitRange Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ----------------------- | ----------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| kube_limitrange | Gauge | | `limitrange`=&lt;limitrange-name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;ResourceName&gt; <br> `type`=&lt;Pod\|Container\|PersistentVolumeClaim&gt; <br> `constraint`=&lt;constraint&gt; | STABLE |
| kube_limitrange_created | Gauge | | `limitrange`=&lt;limitrange-name&gt; <br> `namespace`=&lt;namespace&gt; | STABLE |

View File

@ -0,0 +1,9 @@
# Network Policy Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------ |
| kube_networkpolicy_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_created | Gauge | | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_spec_egress_rules | Gauge | | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_spec_ingress_rules | Gauge | | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,12 @@
# PodDisruptionBudget Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_poddisruptionbudget_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `poddisruptionbudget`=&lt;poddisruptionbudget-name&gt; <br> `namespace`=&lt;poddisruptionbudget-namespace&gt; <br> `annotation_PODDISRUPTIONBUDGET_ANNOTATION`=&lt;PODDISRUPTIONBUDGET_ANNOATION&gt; | EXPERIMENTAL |
| kube_poddisruptionbudget_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `poddisruptionbudget`=&lt;poddisruptionbudget-name&gt; <br> `namespace`=&lt;poddisruptionbudget-namespace&gt; <br> `label_PODDISRUPTIONBUDGET_LABEL`=&lt;PODDISRUPTIONBUDGET_ANNOATION&gt; | EXPERIMENTAL |
| kube_poddisruptionbudget_created | Gauge | | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE |
| kube_poddisruptionbudget_status_current_healthy | Gauge | | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE |
| kube_poddisruptionbudget_status_desired_healthy | Gauge | | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE |
| kube_poddisruptionbudget_status_pod_disruptions_allowed | Gauge | | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE |
| kube_poddisruptionbudget_status_expected_pods | Gauge | | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE |
| kube_poddisruptionbudget_status_observed_generation | Gauge | | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE |

View File

@ -0,0 +1,8 @@
# ResourceQuota Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_resourcequota | Gauge | | `resourcequota`=&lt;quota-name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;ResourceName&gt; <br> `type`=&lt;quota-type&gt; | STABLE |
| kube_resourcequota_created | Gauge | | `resourcequota`=&lt;quota-name&gt; <br> `namespace`=&lt;namespace&gt; | STABLE |
| kube_resourcequota_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `resourcequota`=&lt;quota-name&gt; <br> `namespace`=&lt;namespace&gt; <br> `annotation_RESOURCE_QUOTA_ANNOTATION`=&lt;RESOURCE_QUOTA_ANNOTATION&gt; | EXPERIMENTAL |
| kube_resourcequota_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `resourcequota`=&lt;quota-name&gt; <br> `namespace`=&lt;namespace&gt; <br> `label_RESOURCE_QUOTA_LABEL`=&lt;RESOURCE_QUOTA_LABEL&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,10 @@
# Endpoint Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_endpoint_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `annotation_ENDPOINT_ANNOTATION`=&lt;ENDPOINT_ANNOTATION&gt; | EXPERIMENTAL |
| kube_endpoint_info | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
| kube_endpoint_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `label_ENDPOINT_LABEL`=&lt;ENDPOINT_LABEL&gt; | STABLE |
| kube_endpoint_created | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; | STABLE |
| kube_endpoint_ports | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `port_name`=&lt;endpoint-port-name&gt; <br> `port_protocol`=&lt;endpoint-port-protocol&gt; <br> `port_number`=&lt;endpoint-port-number&gt; | STABLE (Deprecated from 2.14.0) |
| kube_endpoint_address | Gauge | | `endpoint`=&lt;endpoint-name&gt; <br> `namespace`=&lt;endpoint-namespace&gt; <br> `ip`=&lt;endpoint-ip&gt; <br> `port_name`=&lt;endpoint-port-name&gt; <br> `port_protocol`=&lt;endpoint-port-protocol&gt; <br> `port_number`=&lt;endpoint-port-number&gt;`ready`=&lt;true if available, false if unavailalbe&gt; | STABLE |

View File

@ -0,0 +1,11 @@
# Endpoint Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_endpointslice_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; <br> `annotation_ENDPOINTSLICE_ANNOTATION`=&lt;ENDPOINTSLICE_ANNOTATION&gt; | EXPERIMENTAL |
| kube_endpointslice_info | Gauge | | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; | EXPERIMENTAL |
| kube_endpointslice_ports | Gauge | | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; <br> `port_name`=&lt;endpointslice-port-name&gt; <br> `port_protocol`=&lt;endpointslice-port-protocol&gt; <br> `port_number`=&lt;endpointslice-port-number&gt; | EXPERIMENTAL |
| kube_endpointslice_endpoints | Gauge | | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; <br> `ready`=&lt;endpointslice-ready&gt; <br> `serving`=&lt;endpointslice-serving&gt; <br> `terminating`=&lt;endpointslice-terminating&gt; <br> `hostname`=&lt;endpointslice-hostname&gt; <br> `targetref_kind`=&lt;endpointslice-targetref-kind&gt; <br> `targetref_name`=&lt;endpointslice-targetref-name&gt; <br> `targetref_namespace`=&lt;endpointslice-targetref-namespace&gt; <br> `nodename`=&lt;endpointslice-nodename&gt; <br> `endpoint_zone`=&lt;endpointslice-zone&gt; | EXPERIMENTAL |
| kube_endpointslice_endpoints_hints | Gauge | Each line is a hint applied to an endpoint-slice | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; <br> `address`=&lt;endpointslice-address[0]&gt; <br> `for_zone`=&lt;endpointslice-hint&gt; | EXPERIMENTAL |
| kube_endpointslice_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; <br> `label_ENDPOINTSLICE_LABEL`=&lt;ENDPOINTSLICE_LABEL&gt; | EXPERIMENTAL |
| kube_endpointslice_created | Gauge | | `endpointslice`=&lt;endpointslice-name&gt; <br> `namespace`=&lt;endpointslice-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,11 @@
# Ingress Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| -------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------ |
| kube_ingress_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `annotation_INGRESS_ANNOTATION`=&lt;ANNOTATION_LABEL&gt; | EXPERIMENTAL |
| kube_ingress_info | Gauge | | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `ingressclass`=&lt;ingress-class&gt; or `_default` if not set | STABLE |
| kube_ingress_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `label_INGRESS_LABEL`=&lt;INGRESS_LABEL&gt; | STABLE |
| kube_ingress_created | Gauge | | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; | STABLE |
| kube_ingress_metadata_resource_version | Gauge | | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; | EXPERIMENTAL |
| kube_ingress_path | Gauge | | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `host`=&lt;ingress-host&gt; <br> `path`=&lt;ingress-path&gt; <br> `path_type`=&lt;ingress-path type&gt; <br> If path served by Service Backend <br> `service_name`=&lt;service name for the path&gt; <br> `service_port`=&lt;service port for the path&gt; <br> If path served by Resource Backend <br> `resource_api_group`=&lt;resource backend api group&gt; <br> `resource_kind`=&lt;resource backend kind&gt; <br> `resource_name`=&lt;resource backend name&gt; | STABLE |
| kube_ingress_tls | Gauge | | `ingress`=&lt;ingress-name&gt; <br> `namespace`=&lt;ingress-namespace&gt; <br> `tls_host`=&lt;tls hostname&gt; <br> `secret`=&lt;tls secret name&gt; | STABLE |

View File

@ -0,0 +1,8 @@
# IngressClass Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------ |
| kube_ingressclass_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `ingressclass`=&lt;ingressclass-name&gt; <br> `annotation_INGRESSCLASS_ANNOTATION`=&lt;INGRESSCLASS_ANNOTATION&gt; | EXPERIMENTAL |
| kube_ingressclass_info | Gauge | | `ingressclass`=&lt;ingressclass-name&gt; <br> `controller`=&lt;ingress-controller-name&gt; <br> | EXPERIMENTAL |
| kube_ingressclass_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `ingressclass`=&lt;ingressclass-name&gt; <br> `label_INGRESSCLASS_LABEL`=&lt;INGRESSCLASS_LABEL&gt; | EXPERIMENTAL |
| kube_ingressclass_created | Gauge | | `ingressclass`=&lt;ingressclass-name&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,11 @@
# Service Metrics
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ----------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_service_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; <br> `annotation_SERVICE_ANNOTATION`=&lt;SERVICE_ANNOTATION&gt; | EXPERIMENTAL |
| kube_service_info | Gauge | Information about service | | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; <br> `cluster_ip`=&lt;service cluster ip&gt; <br> `external_name`=&lt;service external name&gt; <br> `external_traffic_policy`=&lt;service external traffic policy&gt; <br> `load_balancer_ip`=&lt;service load balancer ip&gt; | STABLE |
| kube_service_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; <br> `label_SERVICE_LABEL`=&lt;SERVICE_LABEL&gt; | STABLE |
| kube_service_created | Gauge | Unix creation timestamp | seconds | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; | STABLE |
| kube_service_spec_type | Gauge | Type about service | | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; <br> `type`=&lt;ClusterIP\|NodePort\|LoadBalancer\|ExternalName&gt; | STABLE |
| kube_service_spec_external_ip | Gauge | Service external ips. One series for each ip | | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; <br> `external_ip`=&lt;external-ip&gt; | STABLE |
| kube_service_status_load_balancer_ingress | Gauge | Service load balancer ingress status | | `service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `uid`=&lt;service-uid&gt; <br> `ip`=&lt;load-balancer-ingress-ip&gt; <br> `hostname`=&lt;load-balancer-ingress-hostname&gt; | STABLE |

View File

@ -0,0 +1,9 @@
# ConfigMap Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ---------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_configmap_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; <br> `annotation_CONFIGMAP_ANNOTATION`=&lt;CONFIGMAP_ANNOTATION&gt; | EXPERIMENTAL |
| kube_configmap_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; <br> `label_CONFIGMAP_LABEL`=&lt;CONFIGMAP_LABEL&gt; | STABLE |
| kube_configmap_info | Gauge | | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | STABLE |
| kube_configmap_created | Gauge | | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | STABLE |
| kube_configmap_metadata_resource_version | Gauge | | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,37 @@
# PersistentVolume Metrics
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|------------------------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| kube_persistentvolume_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `persistentvolume`=&lt;persistentvolume-name&gt; <br> `annotation_PERSISTENTVOLUME_ANNOTATION`=&lt;PERSISTENTVOLUME_ANNOTATION&gt; | EXPERIMENTAL |
| kube_persistentvolume_capacity_bytes | Gauge | | | `persistentvolume`=&lt;pv-name&gt; | STABLE |
| kube_persistentvolume_status_phase | Gauge | | | `persistentvolume`=&lt;pv-name&gt; <br>`phase`=&lt;Bound\|Failed\|Pending\|Available\|Released&gt; | STABLE |
| kube_persistentvolume_claim_ref | Gauge | | | `persistentvolume`=&lt;pv-name&gt; <br>`claim_namespace`=`<namespace>`; <br>`name`=`<name>`; | STABLE |
| kube_persistentvolume_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `persistentvolume`=&lt;persistentvolume-name&gt; <br> `label_PERSISTENTVOLUME_LABEL`=&lt;PERSISTENTVOLUME_LABEL&gt; | STABLE |
| kube_persistentvolume_info | Gauge | Information about Persistent Volumes | | `persistentvolume`=&lt;pv-name&gt; <br> `storageclass`=&lt;storageclass-name&gt; <br> `gce_persistent_disk_name`=&lt;pd-name&gt; <br> `host_path`=&lt;path-of-a-host-volume&gt; <br> `host_path_type`=&lt;host-mount-type&gt; <br> `ebs_volume_id`=&lt;ebs-volume-id&gt; <br> `azure_disk_name`=&lt;azure-disk-name&gt; <br> `fc_wwids`=&lt;fc-wwids-comma-separated&gt; <br> `fc_lun`=&lt;fc-lun&gt; <br> `fc_target_wwns`=&lt;fc-target-wwns-comma-separated&gt; <br> `iscsi_target_portal`=&lt;iscsi-target-portal&gt; <br> `iscsi_iqn`=&lt;iscsi-iqn&gt; <br> `iscsi_lun`=&lt;iscsi-lun&gt; <br> `iscsi_initiator_name`=&lt;iscsi-initiator-name&gt; <br> `local_path`=&lt;path-of-a-local-volume&gt; <br> `local_fs`=&lt;local-volume-fs-type&gt; <br> `nfs_server`=&lt;nfs-server&gt; <br> `nfs_path`=&lt;nfs-path&gt; <br> `csi_driver`=&lt;csi-driver&gt; <br> `csi_volume_handle`=&lt;csi-volume-handle&gt; <br> `reclaim_policy`=&lt;reclaim-policy&gt; | STABLE |
| kube_persistentvolume_created | Gauge | Unix creation timestamp | seconds | `persistentvolume`=&lt;persistentvolume-name&gt; <br> | EXPERIMENTAL |
| kube_persistentvolume_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `persistentvolume`=&lt;persistentvolume-name&gt; <br> | EXPERIMENTAL |
| kube_persistentvolume_csi_attributes | Gauge | CSI attributes of the Persistent Volume, disabled by default, manage with [--metric-opt-in-list](../../developer/cli-arguments.md)) | | `persistentvolume`=&lt;persistentvolume-name&gt; <br> `csi_mounter`=&lt;csi-mounter&gt; <br> `csi_map_options`=&lt;csi-map-options&gt; | EXPERIMENTAL |
| kube_persistentvolume_volume_mode | Gauge | Volume Mode information for the PersistentVolume. | | `persistentvolume`=&lt;persistentvolume-name&gt; <br>`volumemode`=&lt;volumemode&gt; | EXPERIMENTAL |
## Useful metrics queries
### How to retrieve non-standard PV state
It is not straightforward to get the PV states for certain cases like "Terminating" since it is not stored behind a field in the `PersistentVolume.Status`.
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.27.2/pkg/printers/internalversion/printers.go#L1838) used by the `kubectl` command line, you will need to compose multiple metrics.
Here is an example of a Prometheus rule that can be used to alert on a PV that has been in the `Terminating` state for more than `5m`.
```yaml
groups:
- name: PV state
rules:
- alert: PVBlockedInTerminatingState
expr: kube_persistentvolume_deletion_timestamp * on(persistentvolume) group_left() (kube_persistentvolume_status_phase{phase="Bound"} == 1) > 0
for: 5m
labels:
severity: warning
annotations:
summary: PV {{$labels.persistentvolume}} blocked in Terminating state.
```

View File

@ -0,0 +1,40 @@
# PersistentVolumeClaim Metrics
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ---------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
| kube_persistentvolumeclaim_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `annotation_PERSISTENTVOLUMECLAIM_ANNOTATION`=&lt;PERSISTENTVOLUMECLAIM_ANNOATION&gt; | EXPERIMENTAL |
| kube_persistentvolumeclaim_access_mode | Gauge | | | `access_mode`=&lt;persistentvolumeclaim-access-mode&gt; <br>`namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | STABLE |
| kube_persistentvolumeclaim_info | Gauge | | | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `storageclass`=&lt;persistentvolumeclaim-storageclassname&gt;<br>`volumename`=&lt;volumename&gt;<br>`volumemode`=&lt;volumemode&gt; | STABLE |
| kube_persistentvolumeclaim_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `label_PERSISTENTVOLUMECLAIM_LABEL`=&lt;PERSISTENTVOLUMECLAIM_LABEL&gt; | STABLE |
| kube_persistentvolumeclaim_resource_requests_storage_bytes | Gauge | | | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | STABLE |
| kube_persistentvolumeclaim_status_condition | Gauge | | | `namespace` =&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `type`=&lt;persistentvolumeclaim-condition-type&gt; <br> `status`=&lt;true\false\unknown&gt; | EXPERIMENTAL |
| kube_persistentvolumeclaim_status_phase | Gauge | | | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `phase`=&lt;Pending\Bound\Lost&gt; | STABLE |
| kube_persistentvolumeclaim_created | Gauge | Unix creation timestamp | seconds | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | EXPERIMENTAL |
| kube_persistentvolumeclaim_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | EXPERIMENTAL |
Note:
* An empty string will be used if PVC has no storage class.
## Useful metrics queries
### How to retrieve non-standard PVC state
It is not straightforward to get the PVC states for certain cases like "Terminating" since it is not stored behind a field in the `PersistentVolumeClaim.Status`.
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.27.2/pkg/printers/internalversion/printers.go#L1883) used by the `kubectl` command line, you will need to compose multiple metrics.
Here is an example of a Prometheus rule that can be used to alert on a PVC that has been in the `Terminating` state for more than `5m`.
```yaml
groups:
- name: PVC state
rules:
- alert: PVCBlockedInTerminatingState
expr: kube_persistentvolumeclaim_deletion_timestamp * on(namespace, persistentvolumeclaim) group_left() (kube_persistentvolumeclaim_status_phase{phase="Bound"} == 1) > 0
for: 5m
labels:
severity: warning
annotations:
summary: PVC {{$labels.namespace}}/{{$labels.persistentvolumeclaim}} blocked in Terminating state.
```

View File

@ -0,0 +1,11 @@
# Secret Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_secret_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `annotations_SECRET_ANNOTATION`=&lt;SECRET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_secret_info | Gauge | | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; | STABLE |
| kube_secret_type | Gauge | | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `type`=&lt;secret-type&gt; | STABLE |
| kube_secret_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `label_SECRET_LABEL`=&lt;SECRET_LABEL&gt; | STABLE |
| kube_secret_created | Gauge | | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; | STABLE |
| kube_secret_metadata_resource_version | Gauge | | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; | EXPERIMENTAL |
| kube_secret_owner | Gauge | | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,8 @@
# StorageClass Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_storageclass_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `storageclass`=&lt;storageclass-name&gt; <br> `annotation_STORAGECLASS_ANNOTATION`=&lt;STORAGECLASS_ANNOTATION&gt; | EXPERIMENTAL |
| kube_storageclass_info | Gauge | | `storageclass`=&lt;storageclass-name&gt; <br> `provisioner`=&lt;storageclass-provisioner&gt; <br> `reclaim_policy`=&lt;storageclass-reclaimPolicy&gt; <br> `volume_binding_mode`=&lt;storageclass-volumeBindingMode&gt; | STABLE |
| kube_storageclass_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `storageclass`=&lt;storageclass-name&gt; <br> `label_STORAGECLASS_LABEL`=&lt;STORAGECLASS_LABEL&gt; | STABLE |
| kube_storageclass_created | Gauge | | `storageclass`=&lt;storageclass-name&gt; | STABLE |

View File

@ -0,0 +1,10 @@
# VolumeAttachment Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| -------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_volumeattachment_info | Gauge | | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `attacher`=&lt;attacher-name&gt; <br> `node`=&lt;node-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_created | Gauge | | `volumeattachment`=&lt;volumeattachment-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `label_VOLUMEATTACHMENT_LABEL`=&lt;VOLUMEATTACHMENT_LABEL&gt; | EXPERIMENTAL |
| kube_volumeattachment_spec_source_persistentvolume | Gauge | | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `volumename`=&lt;persistentvolume-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_status_attached | Gauge | | `volumeattachment`=&lt;volumeattachment-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_status_attachment_metadata | Gauge | | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `metadata_METADATA_KEY`=&lt;METADATA_VALUE&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,17 @@
# CronJob Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_cronjob_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `annotation_CRONJOB_ANNOTATION`=&lt;CRONJOB_ANNOTATION&gt; | EXPERIMENTAL |
| kube_cronjob_info | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `schedule`=&lt;schedule&gt; <br> `concurrency_policy`=&lt;concurrency-policy&gt; <br> `timezone`=&lt;timezone&gt; | STABLE |
| kube_cronjob_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `label_CRONJOB_LABEL`=&lt;CRONJOB_LABEL&gt; | STABLE |
| kube_cronjob_created | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_next_schedule_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_status_active | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_status_last_schedule_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_status_last_successful_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | EXPERIMENTAL |
| kube_cronjob_spec_suspend | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_spec_starting_deadline_seconds | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_metadata_resource_version | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
| kube_cronjob_spec_successful_job_history_limit | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | EXPERIMENTAL |
| kube_cronjob_spec_failed_job_history_limit | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,16 @@
# DaemonSet Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_daemonset_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; <br> `annotation_DAEMONSET_ANNOTATION`=&lt;DAEMONSET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_daemonset_created | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_current_number_scheduled | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_desired_number_scheduled | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_available | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_misscheduled | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_ready | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_number_unavailable | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_observed_generation | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_status_updated_number_scheduled | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_metadata_generation | Gauge | | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
| kube_daemonset_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; <br> `label_DAEMONSET_LABEL`=&lt;DAEMONSET_LABEL&gt; | STABLE |

View File

@ -0,0 +1,19 @@
# Deployment Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ----------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_deployment_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; <br> `annotation_DEPLOYMENT_ANNOTATION`=&lt;DEPLOYMENT_ANNOTATION&gt; | EXPERIMENTAL |
| kube_deployment_status_replicas | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_ready | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_available | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_unavailable | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_replicas_updated | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_observed_generation | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_status_condition | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; <br> `reason`=&lt;deployment-transition-reason&gt; <br> `condition`=&lt;deployment-condition&gt; <br> `status`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_deployment_spec_replicas | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_spec_paused | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_spec_strategy_rollingupdate_max_unavailable | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_spec_strategy_rollingupdate_max_surge | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_metadata_generation | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |
| kube_deployment_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; <br> `label_DEPLOYMENT_LABEL`=&lt;DEPLOYMENT_LABEL&gt; | STABLE |
| kube_deployment_created | Gauge | | `deployment`=&lt;deployment-name&gt; <br> `namespace`=&lt;deployment-namespace&gt; | STABLE |

View File

@ -0,0 +1,15 @@
# Horizontal Pod Autoscaler Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ---------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_horizontalpodautoscaler_info | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; <br> `scaletargetref_api_version`=&lt;hpa-target-api-version&gt; <br> `scaletargetref_kind`=&lt;hpa-target-kind&gt; <br> `scaletargetref_name`=&lt;hpa-target-name&gt; | EXPERIMENTAL |
| kube_horizontalpodautoscaler_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | EXPERIMENTAL |
| kube_horizontalpodautoscaler_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_metadata_generation | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_spec_max_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_spec_min_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_spec_target_metric | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; <br> `metric_name`=&lt;metric-name&gt; <br> `metric_target_type`=&lt;value\|utilization\|average&gt; | EXPERIMENTAL |
| kube_horizontalpodautoscaler_status_target_metric | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; <br> `metric_name`=&lt;metric-name&gt; <br> `metric_target_type`=&lt;value\|utilization\|average&gt; | EXPERIMENTAL |
| kube_horizontalpodautoscaler_status_condition | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; <br> `condition`=&lt;hpa-condition&gt; <br> `status`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_horizontalpodautoscaler_status_current_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
| kube_horizontalpodautoscaler_status_desired_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |

View File

@ -0,0 +1,20 @@
# Job Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_job_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `annotation_JOB_ANNOTATION`=&lt;JOB_ANNOTATION&gt; | EXPERIMENTAL |
| kube_job_info | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `label_JOB_LABEL`=&lt;JOB_LABEL&gt; | STABLE |
| kube_job_owner | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | STABLE |
| kube_job_spec_parallelism | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_spec_completions | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_spec_active_deadline_seconds | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_active | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_succeeded | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_failed | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `reason`=&lt;failure reason&gt; | STABLE |
| kube_job_status_start_time | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_completion_time | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_complete | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_job_failed | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_job_created | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
| kube_job_status_suspended | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,88 @@
# Pod Metrics
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status | Opt-in |
| ----------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------ |
| kube_pod_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `annotation_POD_ANNOTATION`=&lt;POD_ANNOTATION&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_info | Gauge | Information about pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `host_ip`=&lt;host-ip&gt; <br> `pod_ip`=&lt;pod-ip&gt; <br> `node`=&lt;node-name&gt;<br> `created_by_kind`=&lt;created_by_kind&gt;<br> `created_by_name`=&lt;created_by_name&gt;<br> `uid`=&lt;pod-uid&gt;<br> `priority_class`=&lt;priority_class&gt;<br> `host_network`=&lt;host_network&gt; | STABLE | - |
| kube_pod_ips | Gauge | Pod IP addresses | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `ip`=&lt;pod-ip-address&gt; <br> `ip_family`=&lt;4 OR 6&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_start_time | Gauge | Start time in unix timestamp for a pod | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_completion_time | Gauge | Completion time in unix timestamp for a pod | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_owner | Gauge | Information about the Pod's owner | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `label_POD_LABEL`=&lt;POD_LABEL&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_nodeselectors | Gauge | Describes the Pod nodeSelectors | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `nodeselector_NODE_SELECTOR`=&lt;NODE_SELECTOR&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | Opt-in |
| kube_pod_status_phase | Gauge | The pods current phase | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `phase`=&lt;Pending\|Running\|Succeeded\|Failed\|Unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_qos_class | Gauge | The pods current qosClass | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `qos_class`=&lt;BestEffort\|Burstable\|Guaranteed&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_scheduled | Gauge | Describes the status of the scheduling process for the pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_info | Gauge | Information about a container in a pod | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `image`=&lt;image-name&gt; <br> `image_id`=&lt;image-id&gt; <br> `image_spec`=&lt;image-spec&gt; <br> `container_id`=&lt;containerid&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_status_waiting | Gauge | Describes whether the container is currently in waiting state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_status_waiting_reason | Gauge | Describes the reason the container is currently in waiting state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-waiting-reason&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_status_running | Gauge | Describes whether the container is currently in running state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_state_started | Gauge | Start time in unix timestamp for a pod container | seconds | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_status_terminated | Gauge | Describes whether the container is currently in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_status_terminated_reason | Gauge | Describes the reason the container is currently in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_container_status_last_terminated_reason | Gauge | Describes the last reason the container was in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;last-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_container_status_last_terminated_exitcode | Gauge | Describes the exit code for the last container in terminated state. | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_container_status_last_terminated_timestamp | Gauge | Last terminated time for a pod container in unix timestamp. | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_container_status_ready | Gauge | Describes whether the containers readiness check succeeded | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_initialized_time | Gauge | Time when the pod is initialized. | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_container_status_restarts_total | Counter | The number of container restarts per container | | `container`=&lt;container-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `pod`=&lt;pod-name&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_container_resource_requests | Gauge | The number of requested request resource by a container. It is recommended to use the `kube_pod_resource_requests` metric exposed by kube-scheduler instead, as it is more precise. | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; | `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `node`=&lt; node-name&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_container_resource_limits | Gauge | The number of requested limit resource by a container. It is recommended to use the `kube_pod_resource_limits` metric exposed by kube-scheduler instead, as it is more precise. | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; | `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `node`=&lt; node-name&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_overhead_cpu_cores | Gauge | The pod overhead in regards to cpu cores associated with running a pod | core | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_overhead_memory_bytes | Gauge | The pod overhead in regards to memory associated with running a pod | bytes | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_runtimeclass_name_info | Gauge | The runtimeclass associated with the pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_created | Gauge | Unix creation timestamp | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_restart_policy | Gauge | Describes the restart policy in use by this pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `type`=&lt;Always\|Never\|OnFailure&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_init_container_info | Gauge | Information about an init container in a pod | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `image`=&lt;image-name&gt; <br> `image_id`=&lt;image-id&gt; <br> `image_spec`=&lt;image-spec&gt; <br> `container_id`=&lt;containerid&gt; <br> `uid`=&lt;pod-uid&gt; <br> `restart_policy`=&lt;restart-policy&gt; | STABLE | - |
| kube_pod_init_container_status_waiting | Gauge | Describes whether the init container is currently in waiting state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_init_container_status_waiting_reason | Gauge | Describes the reason the init container is currently in waiting state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-waiting-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_init_container_status_running | Gauge | Describes whether the init container is currently in running state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_init_container_status_terminated | Gauge | Describes whether the init container is currently in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_init_container_status_terminated_reason | Gauge | Describes the reason the init container is currently in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_init_container_status_last_terminated_reason | Gauge | Describes the last reason the init container was in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;last-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_init_container_status_ready | Gauge | Describes whether the init containers readiness check succeeded | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_init_container_status_restarts_total | Counter | The number of restarts for the init container | integer | `container`=&lt;container-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `pod`=&lt;pod-name&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_init_container_resource_limits | Gauge | The number of CPU cores requested limit by an init container | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; | `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `node`=&lt; node-name&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_init_container_resource_requests | Gauge | The number of CPU cores requested by an init container | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; | `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `node`=&lt; node-name&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | Information about persistentvolumeclaim volumes in a pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `volume`=&lt;volume-name&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-claimname&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | Describes whether a persistentvolumeclaim is mounted read only | bool | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `volume`=&lt;volume-name&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-claimname&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_reason | Gauge | The pod status reasons | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;Evicted\|NodeAffinity\|NodeLost\|Shutdown\|UnexpectedAdmissionError&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_status_scheduled_time | Gauge | Unix timestamp when pod moved into scheduled status | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_unschedulable | Gauge | Describes the unschedulable status for the pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE | - |
| kube_pod_status_unscheduled_time | Gauge | Unix timestamp when pod moved into unscheduled status | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL | - |
| kube_pod_tolerations | Gauge | Information about the pod tolerations | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `key`=&lt;toleration-key&gt; <br> `operator`=&lt;toleration-operator&gt; <br> `value`=&lt;toleration-value&gt; <br> `effect`=&lt;toleration-effect&gt; `toleration_seconds`=&lt;toleration-seconds&gt; | EXPERIMENTAL | - |
| kube_pod_service_account | Gauge | The service account for a pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `service_account`=&lt;service_account&gt; | EXPERIMENTAL | - |
| kube_pod_scheduler | Gauge | The scheduler for a pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; <br> `name`=&lt;scheduler-name&gt; | EXPERIMENTAL | - |
## Useful metrics queries
### How to retrieve non-standard Pod state
It is not straightforward to get the Pod states for certain cases like "Terminating" and "Unknown" since it is not stored behind a field in the `Pod.Status`.
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.17.3/pkg/printers/internalversion/printers.go#L624) used by the `kubectl` command line, you will need to compose multiple metrics.
For example:
* To get the list of pods that are in the `Unknown` state, you can run the following PromQL query: `sum(kube_pod_status_phase{phase="Unknown"}) by (namespace, pod) or (count(kube_pod_deletion_timestamp) by (namespace, pod) * sum(kube_pod_status_reason{reason="NodeLost"}) by(namespace, pod))`
* For Pods in `Terminating` state: `count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod)`
Here is an example of a Prometheus rule that can be used to alert on a Pod that has been in the `Terminating` state for more than `5m`.
```yaml
groups:
- name: Pod state
rules:
- alert: PodsBlockedInTerminatingState
expr: count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod) > 0
for: 5m
labels:
severity: page
annotations:
summary: Pod {{$labels.namespace}}/{{$labels.pod}} blocked in Terminating state.
```

View File

@ -0,0 +1,14 @@
# ReplicaSet metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| --------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_replicaset_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; <br> `annotation_REPLICASET_ANNOTATION`=&lt;REPLICASET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_replicaset_status_replicas | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_status_fully_labeled_replicas | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_status_ready_replicas | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_status_observed_generation | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_spec_replicas | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_metadata_generation | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; <br> `label_REPLICASET_LABEL`=&lt;REPLICASET_LABEL&gt; | STABLE |
| kube_replicaset_created | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_owner | Gauge | | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | STABLE |

View File

@ -0,0 +1,13 @@
# ReplicationController metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| -------------------------------------------------------- | ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
| kube_replicationcontroller_status_replicas | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_fully_labeled_replicas | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_ready_replicas | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_available_replicas | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_observed_generation | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_spec_replicas | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_metadata_generation | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_created | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_owner | Gauge | | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | EXPERIMENTAL |

View File

@ -0,0 +1,19 @@
# Stateful Set Metrics
| Metric name | Metric type | Description | Labels/tags | Status |
| ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| kube_statefulset_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `annotation_STATEFULSET_ANNOTATION`=&lt;STATEFULSET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_statefulset_status_replicas | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_replicas_current | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_replicas_ready | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_replicas_available | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | EXPERIMENTAL |
| kube_statefulset_status_replicas_updated | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_observed_generation | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_replicas | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_ordinals_start | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_metadata_generation | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_persistentvolumeclaim_retention_policy | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `when_deleted`=&lt;statefulset-when-deleted-pvc-policy&gt; <br> `when_scaled`=&lt;statefulset-when-scaled-pvc-policy&gt; | EXPERIMENTAL |
| kube_statefulset_created | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `label_STATEFULSET_LABEL`=&lt;STATEFULSET_LABEL&gt; | STABLE |
| kube_statefulset_status_current_revision | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `revision`=&lt;statefulset-current-revision&gt; | STABLE |
| kube_statefulset_status_update_revision | Gauge | | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `revision`=&lt;statefulset-update-revision&gt; | STABLE |

View File

@ -1,7 +0,0 @@
# MutatingWebhookConfiguration Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_mutatingwebhookconfiguration_info | Gauge | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_mutatingwebhookconfiguration_created | Gauge | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_mutatingwebhookconfiguration_metadata_resource_version | Gauge | `mutatingwebhookconfiguration`=&lt;mutatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;mutatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |

View File

@ -1,9 +0,0 @@
# Namespace Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_namespace_annotations | Gauge | `namespace`=&lt;namespace-name&gt; <br> `label_NS_ANNOTATION`=&lt;NS_ANNOTATION&gt; | EXPERIMENTAL |
| kube_namespace_created | Gauge | `namespace`=&lt;namespace-name&gt; | STABLE |
| kube_namespace_labels | Gauge | `namespace`=&lt;namespace-name&gt; <br> `label_NS_LABEL`=&lt;NS_LABEL&gt; | STABLE |
| kube_namespace_status_condition | Gauge | `namespace`=&lt;namespace-name&gt; <br> `condition`=&lt;NamespaceDeletionDiscoveryFailure\|NamespaceDeletionContentFailure\|NamespaceDeletionGroupVersionParsingFailure&gt; <br> `status`=&lt;true\|false\|unknown&gt; | EXPERIMENTAL |
| kube_namespace_status_phase| Gauge | `namespace`=&lt;namespace-name&gt; <br> `phase`=&lt;Active\|Terminating&gt; | STABLE |

View File

@ -1,10 +0,0 @@
# Network Policy Metrics
| Metric name | Metric type | Labels/tags | Status |
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------ | ------------ |
| kube_networkpolicy_annotations | Gauge | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_created | Gauge | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_labels | Gauge | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_spec_egress_rules | Gauge | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |
| kube_networkpolicy_spec_ingress_rules | Gauge | `namespace`=&lt;namespace name&gt; `networkpolicy`=&lt;networkpolicy name&gt; | EXPERIMENTAL |

View File

@ -1,14 +0,0 @@
# Node Metrics
| Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------------------- | ----------- | ------ |
| kube_node_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | | `node`=&lt;node-address&gt; <br> `annotation_NODE_ANNOTATION`=&lt;NODE_ANNOTATION&gt; | EXPERIMENTAL |
| kube_node_info | Gauge | Information about a cluster node| |`node`=&lt;node-address&gt; <br> `kernel_version`=&lt;kernel-version&gt; <br> `os_image`=&lt;os-image-name&gt; <br> `container_runtime_version`=&lt;container-runtime-and-version-combination&gt; <br> `kubelet_version`=&lt;kubelet-version&gt; <br> `kubeproxy_version`=&lt;kubeproxy-version&gt; <br> `pod_cidr`=&lt;pod-cidr&gt; <br> `provider_id`=&lt;provider-id&gt; <br> `system_uuid`=&lt;system-uuid&gt; <br> `internal_ip`=&lt;internal-ip&gt; | STABLE |
| kube_node_labels | Gauge | Kubernetes labels converted to Prometheus labels | | `node`=&lt;node-address&gt; <br> `label_NODE_LABEL`=&lt;NODE_LABEL&gt; | STABLE |
| kube_node_role | Gauge | The role of a cluster node | | `node`=&lt;node-address&gt; <br> `role`=&lt;NODE_ROLE&gt; | EXPERIMENTAL |
| kube_node_spec_unschedulable | Gauge | Whether a node can schedule new pods | | `node`=&lt;node-address&gt;| STABLE |
| kube_node_spec_taint | Gauge | The taint of a cluster node. | |`node`=&lt;node-address&gt; <br> `key`=&lt;taint-key&gt; <br> `value=`&lt;taint-value&gt; <br> `effect=`&lt;taint-effect&gt; | STABLE |
| kube_node_status_capacity | Gauge | The capacity for different resources of a node | `cpu`=&lt;core&gt; <br> `ephemeral_storage`=&lt;byte&gt; <br> `pods`=&lt;integer&gt; <br> `attachable_volumes_*`=&lt;byte&gt; <br> `hugepages_*`=&lt;byte&gt; <br> `memory`=&lt;byte&gt; |`node`=&lt;node-address&gt; <br> `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt;| STABLE |
| kube_node_status_allocatable | Gauge | The allocatable for different resources of a node that are available for scheduling | byte |`node`=&lt;node-address&gt; <br> `resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt;| STABLE |
| kube_node_status_condition | Gauge | The condition of a cluster node | |`node`=&lt;node-address&gt; <br> `condition`=&lt;node-condition&gt; <br> `status`=&lt;true\|false\|unknown&gt; | STABLE |
| kube_node_created | Gauge | Unix creation timestamp | seconds |`node`=&lt;node-address&gt;| STABLE |

View File

@ -1,11 +0,0 @@
# PersistentVolume Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_persistentvolume_annotations | Gauge | `persistentvolume`=&lt;persistentvolume-name&gt; <br> `annotation_PERSISTENTVOLUME_ANNOTATION`=&lt;PERSISTENTVOLUME_ANNOTATION&gt; | EXPERIMENTAL |
| kube_persistentvolume_capacity_bytes | Gauge | `persistentvolume`=&lt;pv-name&gt; | STABLE |
| kube_persistentvolume_status_phase | Gauge | `persistentvolume`=&lt;pv-name&gt; <br>`phase`=&lt;Bound\|Failed\|Pending\|Available\|Released&gt;| STABLE |
| kube_persistentvolume_claim_ref | Gauge | `persistentvolume`=&lt;pv-name&gt; <br>`claim_namespace`=&lt;<namespace>&gt; <br>`name`=&lt;<name>&gt; | STABLE |
| kube_persistentvolume_labels | Gauge | `persistentvolume`=&lt;persistentvolume-name&gt; <br> `label_PERSISTENTVOLUME_LABEL`=&lt;PERSISTENTVOLUME_LABEL&gt; | STABLE |
| kube_persistentvolume_info | Gauge | `persistentvolume`=&lt;pv-name&gt; <br> `storageclass`=&lt;storageclass-name&gt; <br> `gce_persistent_disk_name`=&lt;pd-name&gt; <br> `ebs_volume_id`=&lt;ebs-volume-id&gt; <br> `azure_disk_name`=&lt;azure-disk-name&gt; <br> `fc_wwids`=&lt;fc-wwids-comma-separated&gt; <br> `fc_lun`=&lt;fc-lun&gt; <br> `fc_target_wwns`=&lt;fc-target-wwns-comma-separated&gt; <br> `iscsi_target_portal`=&lt;iscsi-target-portal&gt; <br> `iscsi_iqn`=&lt;iscsi-iqn&gt; <br> `iscsi_lun`=&lt;iscsi-lun&gt; <br> `iscsi_initiator_name`=&lt;iscsi-initiator-name&gt; <br> `nfs_server`=&lt;nfs-server&gt; <br> `nfs_path`=&lt;nfs-path&gt; | STABLE |

View File

@ -1,15 +0,0 @@
# PersistentVolumeClaim Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_persistentvolumeclaim_annotations | Gauge | `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `annotation_PERSISTENTVOLUMECLAIM_ANNOTATION`=&lt;PERSISTENTVOLUMECLAIM_ANNOATION&gt; | EXPERIMENTAL |
| kube_persistentvolumeclaim_access_mode | Gauge | `access_mode`=&lt;persistentvolumeclaim-access-mode&gt; <br>`namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | STABLE |
| kube_persistentvolumeclaim_info | Gauge | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `storageclass`=&lt;persistentvolumeclaim-storageclassname&gt;<br>`volumename`=&lt;volumename&gt; | STABLE |
| kube_persistentvolumeclaim_labels | Gauge | `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `label_PERSISTENTVOLUMECLAIM_LABEL`=&lt;PERSISTENTVOLUMECLAIM_LABEL&gt; | STABLE |
| kube_persistentvolumeclaim_resource_requests_storage_bytes | Gauge | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; | STABLE |
| kube_persistentvolumeclaim_status_condition | Gauge | `namespace` =&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `type`=&lt;persistentvolumeclaim-condition-type&gt; <br> `status`=&lt;true\|false\|unknown&gt; | EXPERIMENTAL |
| kube_persistentvolumeclaim_status_phase | Gauge | `namespace`=&lt;persistentvolumeclaim-namespace&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-name&gt; <br> `phase`=&lt;Pending\|Bound\|Lost&gt; | STABLE |
Note:
- A special `<none>` string will be used if PVC has no storage class.

View File

@ -1,84 +0,0 @@
# Pod Metrics
| Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------------------- | ----------- | ------ |
| kube_pod_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `annotation_POD_ANNOTATION`=&lt;POD_ANNOTATION&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_info | Gauge | Information about pod | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `host_ip`=&lt;host-ip&gt; <br> `pod_ip`=&lt;pod-ip&gt; <br> `node`=&lt;node-name&gt;<br> `created_by_kind`=&lt;created_by_kind&gt;<br> `created_by_name`=&lt;created_by_name&gt;<br> `uid`=&lt;pod-uid&gt;<br> `priority_class`=&lt;priority_class&gt;<br> `host_network`=&lt;host_network&gt;| STABLE |
| kube_pod_start_time | Gauge | Start time in unix timestamp for a pod | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_completion_time | Gauge | Completion time in unix timestamp for a pod | seconds | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_owner | Gauge | Information about the Pod's owner | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_labels | Gauge | Kubernetes labels converted to Prometheus labels | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `label_POD_LABEL`=&lt;POD_LABEL&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_status_phase | Gauge | The pods current phase | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `phase`=&lt;Pending\|Running\|Succeeded\|Failed\|Unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_status_scheduled | Gauge | Describes the status of the scheduling process for the pod | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_info | Gauge | Information about a container in a pod | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `image`=&lt;image-name&gt; <br> `image_id`=&lt;image-id&gt; <br> `container_id`=&lt;containerid&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_status_waiting | Gauge | Describes whether the container is currently in waiting state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_status_waiting_reason | Gauge | Describes the reason the container is currently in waiting state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-waiting-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_container_status_running | Gauge | Describes whether the container is currently in running state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_state_started | Gauge | Start time in unix timestamp for a pod container | seconds |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_status_terminated | Gauge | Describes whether the container is currently in terminated state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_status_terminated_reason | Gauge | Describes the reason the container is currently in terminated state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_container_status_last_terminated_reason | Gauge | Describes the last reason the container was in terminated state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;last-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_container_status_ready | Gauge | Describes whether the containers readiness check succeeded | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_status_restarts_total | Counter | The number of container restarts per container | | `container`=&lt;container-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `pod`=&lt;pod-name&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_container_resource_requests | Gauge | The number of requested request resource by a container | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; |`resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `node`=&lt; node-name&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_container_resource_limits | Gauge | The number of requested limit resource by a container | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; |`resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `node`=&lt; node-name&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_overhead_cpu_cores | Gauge | The pod overhead in regards to cpu cores associated with running a pod | core |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_overhead_memory_bytes | Gauge | The pod overhead in regards to memory associated with running a pod | bytes |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_runtimeclass_name_info | Gauge | The runtimeclass associated with the pod | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_created | Gauge | Unix creation timestamp | seconds |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_deletion_timestamp | Gauge | Unix deletion timestamp | seconds |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_restart_policy | Gauge | Describes the restart policy in use by this pod | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `type`=&lt;Always\|Never\|OnFailure&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_info | Gauge | Information about an init container in a pod | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `image`=&lt;image-name&gt; <br> `image_id`=&lt;image-id&gt; <br> `container_id`=&lt;containerid&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_status_waiting | Gauge | Describes whether the init container is currently in waiting state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_status_waiting_reason | Gauge | Describes the reason the init container is currently in waiting state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-waiting-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_status_running | Gauge | Describes whether the init container is currently in running state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_status_terminated | Gauge | Describes whether the init container is currently in terminated state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_status_terminated_reason | Gauge | Describes the reason the init container is currently in terminated state | | `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;container-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_status_last_terminated_reason | Gauge | Describes the last reason the init container was in terminated state | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;last-terminated-reason&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_status_ready | Gauge | Describes whether the init containers readiness check succeeded | |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_status_restarts_total | Counter | The number of restarts for the init container | integer |`container`=&lt;container-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `pod`=&lt;pod-name&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_init_container_resource_limits | Gauge | The number of CPU cores requested limit by an init container | `cpu`=&lt;core&gt; <br> `memory`=&lt;bytes&gt; |`resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_limits_cpu_cores | Gauge | The number of CPU cores requested limit by an init container | core |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_limits_memory_bytes | Gauge | Bytes of memory requested limit by an init container | bytes |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_limits_storage_bytes | Gauge | Bytes of storage requested limit by an init container | bytes |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_limits_ephemeral_storage_bytes | Gauge | Bytes of ephemeral-storage requested limit by an init container | bytes |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_requests | Gauge | The number of CPU cores requested by an init container | integer |`resource`=&lt;resource-name&gt; <br> `unit`=&lt;resource-unit&gt; <br> `container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_requests_cpu_cores | Gauge | The number of CPU cores requested by an init container | core |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_requests_memory_bytes | Gauge | Bytes of memory requested by an init container | bytes |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_requests_storage_bytes | Gauge | Bytes of storage requested by an init container | bytes |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_init_container_resource_requests_ephemeral_storage_bytes | Gauge | Bytes of ephemeral-storage requested by an init container | bytes |`container`=&lt;container-name&gt; <br> `pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | Information about persistentvolumeclaim volumes in a pod | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `volume`=&lt;volume-name&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-claimname&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | Describes whether a persistentvolumeclaim is mounted read only | bool |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `volume`=&lt;volume-name&gt; <br> `persistentvolumeclaim`=&lt;persistentvolumeclaim-claimname&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_status_reason | Gauge | The pod status reasons | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `reason`=&lt;NodeLost\|Evicted\|UnexpectedAdmissionError&gt; <br> `uid`=&lt;pod-uid&gt; | EXPERIMENTAL |
| kube_pod_status_scheduled_time | Gauge | Unix timestamp when pod moved into scheduled status | seconds |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
| kube_pod_status_unschedulable | Gauge | Describes the unschedulable status for the pod | |`pod`=&lt;pod-name&gt; <br> `namespace`=&lt;pod-namespace&gt; <br> `uid`=&lt;pod-uid&gt; | STABLE |
## Useful metrics queries
### How to retrieve non-standard Pod state
It is not straightforward to get the Pod states for certain cases like "Terminating" and "Unknown" since it is not stored behind a field in the `Pod.Status`.
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.17.3/pkg/printers/internalversion/printers.go#L624) used by the `kubectl` command line, you will need to compose multiple metrics.
For example:
* To get the list of pods that are in the `Unknown` state, you can run the following PromQL query: `sum(kube_pod_status_phase{phase="Unknown"}) by (namespace, pod) or (count(kube_pod_deletion_timestamp) by (namespace, pod) * sum(kube_pod_status_reason{reason="NodeLost"}) by(namespace, pod))`
* For Pods in `Terminating` state: `count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod)`
Here is an example of a Prometheus rule that can be used to alert on a Pod that has been in the `Terminated` state for more than `5m`.
```yaml
groups:
- name: Pod state
rules:
- alert: PodsBlockInTerminatingState
expr: count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod) > 0
for: 5m
labels:
severity: page
annotations:
summary: Pod {{labels.namespace}}/{{labels.pod}} block in Terminating state.
```

View File

@ -1,10 +0,0 @@
# PodDisruptionBudget Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_poddisruptionbudget_created | Gauge | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE
| kube_poddisruptionbudget_status_current_healthy | Gauge | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE
| kube_poddisruptionbudget_status_desired_healthy | Gauge | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE
| kube_poddisruptionbudget_status_pod_disruptions_allowed | Gauge | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE
| kube_poddisruptionbudget_status_expected_pods | Gauge | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE
| kube_poddisruptionbudget_status_observed_generation | Gauge | `poddisruptionbudget`=&lt;pdb-name&gt; <br> `namespace`=&lt;pdb-namespace&gt; | STABLE

View File

@ -1,14 +0,0 @@
# ReplicaSet metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_replicaset_annotations | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; <br> `annotation_REPLICASET_ANNOTATION`=&lt;REPLICASET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_replicaset_status_replicas | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_status_fully_labeled_replicas | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_status_ready_replicas | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_status_observed_generation | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_spec_replicas | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_metadata_generation | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_labels | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; <br> `label_REPLICASET_LABEL`=&lt;REPLICASET_LABEL&gt; | STABLE |
| kube_replicaset_created | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; | STABLE |
| kube_replicaset_owner | Gauge | `replicaset`=&lt;replicaset-name&gt; <br> `namespace`=&lt;replicaset-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | STABLE |

View File

@ -1,13 +0,0 @@
# ReplicationController metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_replicationcontroller_status_replicas | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_fully_labeled_replicas | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_ready_replicas | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_available_replicas | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_status_observed_generation | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_spec_replicas | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_metadata_generation | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_created | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; | STABLE |
| kube_replicationcontroller_owner | Gauge | `replicationcontroller`=&lt;replicationcontroller-name&gt; <br> `namespace`=&lt;replicationcontroller-namespace&gt; <br> `owner_kind`=&lt;owner kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `owner_is_controller`=&lt;whether owner is controller&gt; | EXPERIMENTAL |

View File

@ -1,6 +0,0 @@
# ResourceQuota Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_resourcequota | Gauge | `resourcequota`=&lt;quota-name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;ResourceName&gt; <br> `type`=&lt;quota-type&gt; | STABLE |
| kube_resourcequota_created | Gauge | `resourcequota`=&lt;quota-name&gt; <br> `namespace`=&lt;namespace&gt; | STABLE |

View File

@ -1,10 +0,0 @@
# Secret Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_secret_annotations | Gauge | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `annotations_SECRET_ANNOTATION`=&lt;SECRET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_secret_info | Gauge | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; | STABLE |
| kube_secret_type | Gauge | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `type`=&lt;secret-type&gt; | STABLE |
| kube_secret_labels | Gauge | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; <br> `label_SECRET_LABEL`=&lt;SECRET_LABEL&gt; | STABLE |
| kube_secret_created | Gauge | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; | STABLE |
| kube_secret_metadata_resource_version | Gauge | `secret`=&lt;secret-name&gt; <br> `namespace`=&lt;secret-namespace&gt; | EXPERIMENTAL |

View File

@ -1,11 +0,0 @@
# Service Metrics
| Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------------------- | ----------- | ------ |
| kube_service_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `annotation_SERVICE_ANNOTATION`=&lt;SERVICE_ANNOTATION&gt; | EXPERIMENTAL |
| kube_service_info | Gauge | Information about service | |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `cluster_ip`=&lt;service cluster ip&gt; <br> `external_name`=&lt;service external name&gt; <br> `load_balancer_ip`=&lt;service load balancer ip&gt; | STABLE |
| kube_service_labels | Gauge | Kubernetes labels converted to Prometheus labels | |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `label_SERVICE_LABEL`=&lt;SERVICE_LABEL&gt; | STABLE |
| kube_service_created | Gauge | Unix creation timestamp | seconds |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; | STABLE |
| kube_service_spec_type | Gauge | Type about service | |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `type`=&lt;ClusterIP\|NodePort\|LoadBalancer\|ExternalName&gt; | STABLE |
| kube_service_spec_external_ip | Gauge | Service external ips. One series for each ip | |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `external_ip`=&lt;external-ip&gt; | STABLE |
| kube_service_status_load_balancer_ingress | Gauge | Service load balancer ingress status | |`service`=&lt;service-name&gt; <br> `namespace`=&lt;service-namespace&gt; <br> `ip`=&lt;load-balancer-ingress-ip&gt; <br> `hostname`=&lt;load-balancer-ingress-hostname&gt; | STABLE |

View File

@ -1,17 +0,0 @@
# Stateful Set Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_statefulset_annotations | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `annotation_STATEFULSET_ANNOTATION`=&lt;STATEFULSET_ANNOTATION&gt; | EXPERIMENTAL |
| kube_statefulset_status_replicas | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_replicas_current | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_replicas_ready | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_replicas_available | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | EXPERIMENTAL |
| kube_statefulset_status_replicas_updated | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_status_observed_generation | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_replicas | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_metadata_generation | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_created | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; | STABLE |
| kube_statefulset_labels | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `label_STATEFULSET_LABEL`=&lt;STATEFULSET_LABEL&gt; | STABLE |
| kube_statefulset_status_current_revision | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `revision`=&lt;statefulset-current-revision&gt; | STABLE |
| kube_statefulset_status_update_revision | Gauge | `statefulset`=&lt;statefulset-name&gt; <br> `namespace`=&lt;statefulset-namespace&gt; <br> `revision`=&lt;statefulset-update-revision&gt; | STABLE |

View File

@ -1,8 +0,0 @@
# StorageClass Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_storageclass_annotations | Gauge | `storageclass`=&lt;storageclass-name&gt; <br> `annotation_STORAGECLASS_ANNOTATION`=&lt;STORAGECLASS_ANNOTATION&gt; | EXPERIMENTAL |
| kube_storageclass_info | Gauge | `storageclass`=&lt;storageclass-name&gt; <br> `provisioner`=&lt;storageclass-provisioner&gt; <br> `reclaim_policy`=&lt;storageclass-reclaimPolicy&gt; <br> `volume_binding_mode`=&lt;storageclass-volumeBindingMode&gt; | STABLE |
| kube_storageclass_labels | Gauge | `storageclass`=&lt;storageclass-name&gt; <br> `label_STORAGECLASS_LABEL`=&lt;STORAGECLASS_LABEL&gt; | STABLE |
| kube_storageclass_created | Gauge | `storageclass`=&lt;storageclass-name&gt; | STABLE |

View File

@ -1,7 +0,0 @@
# ValidatingWebhookConfiguration Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_validatingwebhookconfiguration_info | Gauge | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_validatingwebhookconfiguration_created | Gauge | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |
| kube_validatingwebhookconfiguration_metadata_resource_version | Gauge | `validatingwebhookconfiguration`=&lt;validatingwebhookconfiguration-name&gt; <br> `namespace`=&lt;validatingwebhookconfiguration-namespace&gt; | EXPERIMENTAL |

View File

@ -1,108 +0,0 @@
# Vertical Pod Autoscaler Metrics
| Metric name | Metric type | Labels/tags | Status |
| -------------------------------- | ----------- | ------------------------------------------------------------- | ------ |
| kube_verticalpodautoscaler_annotations | Gauge | `annotation_app`=&lt;foo&gt; <br> `namespace`=&lt;namespace&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed | Gauge | `container`=&lt;container name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;cpu memory&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `unit`=&lt;core byte&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed | Gauge | `container`=&lt;container name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;cpu memory&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `unit`=&lt;core byte&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound | Gauge | `container`=&lt;container name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;cpu memory&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `unit`=&lt;core byte&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target | Gauge | `container`=&lt;container name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;cpu memory&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `unit`=&lt;core byte&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget | Gauge | `container`=&lt;container name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;cpu memory&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `unit`=&lt;core byte&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound | Gauge | `container`=&lt;container name&gt; <br> `namespace`=&lt;namespace&gt; <br> `resource`=&lt;cpu memory&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `unit`=&lt;core byte&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_labels | Gauge | `label_app`=&lt;foo&gt; <br> `namespace`=&lt;namespace&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
| kube_verticalpodautoscaler_spec_updatepolicy_updatemode | Gauge | `namespace`=&lt;namespace&gt; <br> `target_api_version`=&lt;api version&gt; <br> `target_kind`=&lt;target kind&gt; <br> `target_name`=&lt;target name&gt; <br> `update_mode`=&lt;foo&gt; <br> `verticalpodautoscaler`=&lt;vertical pod autoscaler name&gt; | EXPERIMENTAL |
## Configuration
Vertical Pod Autoscalers(VPAs) are managed as custom resources.
To enable the Vertical Pod Autoscaler collector, please:
1. Ensure that the Vertical Pod Autoscaler CRDs are installed in the cluster. The CRDs are [here](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/deploy/vpa-beta2-crd.yaml).
2. Ensure that `verticalpodautoscalers` is included in list of `Resources` enabled using the flag `--resources` when `kube-state-metrics` is run (see below).
One of the [command line arguments](./docs/cli-arguments.md) for `kube-state-metrics` is `--resources`. If this flag is omitted, a default set of Resources is enabled. This default list does **not** include Vertical Pod Autoscalers.
To enable Vertical Pod Autoscalers, the `kube-state-metrics` flag `--resource` must be included when the binary is run and the list of resources must include `verticalpodautoscalers`.
### Examples
The following configures `kube-state-metrics` on the command line and in the `args` section of a Kubernetes manifest. Because neither command includes the `--resource` flag, the default set of resources will be include **but** metrics for Vertical Pod Autoscalers will **not** be included:
Shell:
```bash
kube-state-metrics \
--telemetry-port=8081 \
--kubeconfig=... \
--apiserver=...
```
Kubernetes:
```YAML
spec:
template:
spec:
containers:
- args:
- --telemetry-port=8081
- --kubeconfig=...
- --apiserver=...
```
To include Vertical Pod Autoscaler metrics, you must include the `--resources` flag and to include the default resources, you must include the list of default resources **and** `verticalpodautoscalers`, i.e.:
Shell:
```bash
kube-state-metrics \
--telemetry-port=8081 \
--kubeconfig=... \
--apiserver=... \
--resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers, ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,verticalpodautoscalers,volumeattachments
```
Kubernetes:
```YAML
spec:
template:
spec:
containers:
- args:
- --telemetry-port=8081
- --kubeconfig=...
- --apiserver=...
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers, ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,verticalpodautoscalers,volumeattachments
```
### Confirmation
To confirm that a `kube-state-metrics` process includes `verticalpodautoscalers`, you can:
Shell:
```bash
ps aux \
| grep kube-state-metrics \
| grep verticalpodautoscalers
```
Kubernetes: assuming your deployment is called `kube-state-metrics`:
```bash
DEPLOYMENT="kube-state-metrics"
NAMESPACE="default"
kubectl get deployment/${DEPLOYMENT} \
--namespace=${NAMESPACE} \
--output=jsonpath="{range .spec.template.spec.containers[?(@.name=='kube-state-metrics')].args[*]}{@}{'\n'}{end}"
```
Should include (among other `--flags`):
```console
--resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,verticalpodautoscalers,volumeattachments
```

View File

@ -1,10 +0,0 @@
# VolumeAttachment Metrics
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_volumeattachment_info | Gauge | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `attacher`=&lt;attacher-name&gt; <br> `node`=&lt;node-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_created | Gauge | `volumeattachment`=&lt;volumeattachment-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_labels | Gauge | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `label_VOLUMEATTACHMENT_LABEL`=&lt;VOLUMEATTACHMENT_LABEL&gt; | EXPERIMENTAL |
| kube_volumeattachment_spec_source_persistentvolume | Gauge | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `volumename`=&lt;persistentvolume-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_status_attached | Gauge | `volumeattachment`=&lt;volumeattachment-name&gt; | EXPERIMENTAL |
| kube_volumeattachment_status_attachment_metadata | Gauge | `volumeattachment`=&lt;volumeattachment-name&gt; <br> `metadata_METADATA_KEY`=&lt;METADATA_VALUE&gt; | EXPERIMENTAL |

View File

@ -2,8 +2,9 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.2.0
app.kubernetes.io/version: 2.16.0
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io

Some files were not shown because too many files have changed in this diff Show More