Skip to content

Commit 6f5dd85

Browse files
Merge branch 'kubernetes:main' into add-deployment-pod-affinity-metrics
2 parents 9680c76 + 941c683 commit 6f5dd85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+280
-147
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
E2E_SETUP_KUBECTL: yes
2222
SUDO: sudo
2323
GO_VERSION: "^1.24"
24-
GOLANGCI_LINT_VERSION: "v2.0.2"
24+
GOLANGCI_LINT_VERSION: "v2.4.0"
2525

2626
jobs:
2727
ci-go-lint:
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3333

3434
- name: Set up Go 1.x
35-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
35+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
3636
with:
3737
go-version: ${{ env.GO_VERSION }}
3838
id: go
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5151

5252
- name: Set up Go 1.x
53-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
53+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
5454
with:
5555
go-version: ${{ env.GO_VERSION }}
5656
id: go
@@ -67,7 +67,7 @@ jobs:
6767
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6868

6969
- name: Set up Go 1.x
70-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
70+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
7171
with:
7272
go-version: ${{ env.GO_VERSION }}
7373
id: go
@@ -84,7 +84,7 @@ jobs:
8484
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8585

8686
- name: Set up Go 1.x
87-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
87+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
8888
with:
8989
go-version: ${{ env.GO_VERSION }}
9090
id: go
@@ -101,7 +101,7 @@ jobs:
101101
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
102102

103103
- name: Set up Go 1.x
104-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
104+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
105105
with:
106106
go-version: ${{ env.GO_VERSION }}
107107
id: go
@@ -133,15 +133,44 @@ jobs:
133133
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
134134

135135
- name: Set up Go 1.x
136-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
136+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
137137
with:
138138
go-version: ${{ env.GO_VERSION }}
139139
id: go
140140

141141
- name: Benchmark tests
142142
run: |
143-
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare
143+
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare-main
144144
- run: |
145+
echo "Comparison against main branch" >> "$GITHUB_STEP_SUMMARY"
146+
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
147+
cat result.txt >> "$GITHUB_STEP_SUMMARY"
148+
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
149+
cat <<EOL >> "$GITHUB_STEP_SUMMARY"
150+
<hr />
151+
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).
152+
The last row has the Geometric Mean (geomean) for the given rows in the table.
153+
Refer to <a href="https://pkg.go.dev/golang.org/x/perf/cmd/benchstat">benchstat's documentation</a> for more help.
154+
EOL
155+
156+
ci-benchmark-tests-release:
157+
name: ci-benchmark-tests-releasebranch
158+
runs-on: ubuntu-latest
159+
steps:
160+
- name: Check out code into the Go module directory
161+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
162+
163+
- name: Set up Go 1.x
164+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
165+
with:
166+
go-version: ${{ env.GO_VERSION }}
167+
id: go
168+
169+
- name: Benchmark tests
170+
run: |
171+
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare-release
172+
- run: |
173+
echo "Comparison against release branch" >> "$GITHUB_STEP_SUMMARY"
145174
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
146175
cat result.txt >> "$GITHUB_STEP_SUMMARY"
147176
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
@@ -160,7 +189,7 @@ jobs:
160189
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
161190

162191
- name: Set up Go 1.x
163-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
192+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
164193
with:
165194
go-version: ${{ env.GO_VERSION }}
166195
id: go
@@ -177,7 +206,7 @@ jobs:
177206
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
178207

179208
- name: Set up Go 1.x
180-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
209+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
181210
with:
182211
go-version: ${{ env.GO_VERSION }}
183212
id: go

.github/workflows/govulncheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1919
name: Checkout code
2020
- name: Set up Go 1.x
21-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
21+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2222
with:
2323
go-version: ${{ env.GO_VERSION }}
2424
- name: Install govulncheck binary

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## v2.17.0 / 2025-09-01
4+
5+
* This release builds with Go `v1.24.6`
6+
* This release builds with `k8s.io/client-go`: `v0.33.4`
7+
* This release is the last release that has endpoint metrics enabled by default. In the next release we will enable endpointslices metrics and disable endpoint metrics by default, since the endpoint resources are deprecated. You can still alter this behaviour in kube-state-metrics' config.
8+
9+
* [FEATURE] Add new metric for pod unscheduled time tracking by @yshngg in <https://github.com/kubernetes/kube-state-metrics/pull/2699>
10+
* [BUGFIX] Fix index out of range by @taraspos in <https://github.com/kubernetes/kube-state-metrics/pull/2716>
11+
* [BUGFIX] Config file overrides apply to some fields but not other by @rashmichandrashekar in <https://github.com/kubernetes/kube-state-metrics/pull/2705>
12+
* [BUGFIX] Fix logic for plain text fallback format by @timonegk in <https://github.com/kubernetes/kube-state-metrics/pull/2730>
13+
* [FEATURE] Include reason label to `kube_deployment_status_condition` by @Rishab87 in <https://github.com/kubernetes/kube-state-metrics/pull/2719>
14+
* [FEATURE] Continue running kube-state-metrics when config file doesnt exist at startup by @rashmichandrashekar in <https://github.com/kubernetes/kube-state-metrics/pull/2703>
15+
* [FEATURE] Introduce deletion timestamp metric for daemonset, statefulset, deployment, service and pdb by @IgorIgnatevBolt in <https://github.com/kubernetes/kube-state-metrics/pull/2678>
16+
* [FEATURE] Add HorizontalPodAutoscaler created and deletionTimestamp info into metrics by @IgorIgnatevBolt in <https://github.com/kubernetes/kube-state-metrics/pull/2675>
17+
318
## v2.16.0 / 2025-06-23
419

520
**Note:**

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,34 @@ Here's a list of types that we use:
3838
| chore | Other changes that don't modify src or test files |
3939
| revert | Reverts a previous commit |
4040

41+
### Local Testing
42+
43+
We recommend you to do local testing on your changes before pushing.
44+
45+
You need to first validate your modules:
46+
47+
```shell
48+
make validate-modules
49+
```
50+
51+
Then, lint check:
52+
53+
```shell
54+
make lint
55+
```
56+
57+
For unit tests:
58+
59+
```shell
60+
make test-unit
61+
```
62+
63+
And for end-to-end integration tests:
64+
65+
```shell
66+
make e2e
67+
```
68+
4169
### Further Information
4270

4371
* [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

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
1313
OS ?= $(shell uname -s | tr A-Z a-z)
1414
ALL_ARCH = amd64 arm arm64 ppc64le s390x
1515
PKG = github.com/prometheus/common
16-
PROMETHEUS_VERSION = 3.4.1
17-
GO_VERSION = 1.24.4
16+
PROMETHEUS_VERSION = 3.5.0
17+
GO_VERSION = 1.24.6
1818
IMAGE = $(REGISTRY)/kube-state-metrics
1919
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
2020
USER ?= $(shell id -u -n)
@@ -101,9 +101,15 @@ validate-template: generate-template
101101
# Runs benchmark tests on the current git ref and the last release and compares
102102
# the two.
103103
test-benchmark-compare:
104-
@git fetch
105-
./tests/compare_benchmarks.sh main 2
106-
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH} 2
104+
$(MAKE) test-benchmark-compare-main test-benchmark-compare-release
105+
106+
test-benchmark-compare-main:
107+
@git fetch origin main
108+
./tests/compare_benchmarks.sh main 6
109+
110+
test-benchmark-compare-release:
111+
@git fetch origin ${LATEST_RELEASE_BRANCH}
112+
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH} 6
107113

108114
all: all-container
109115

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ Generally, it is recommended to use the latest release of kube-state-metrics. If
7979

8080
| kube-state-metrics | Kubernetes client-go Version |
8181
|--------------------|:----------------------------:|
82-
| **v2.12.0** | v1.29 |
8382
| **v2.13.0** | v1.30 |
8483
| **v2.14.0** | v1.31 |
8584
| **v2.15.0** | v1.32 |
8685
| **v2.16.0** | v1.32 |
86+
| **v2.17.0** | v1.33 |
8787
| **main** | v1.33 |
8888

8989
#### Resource group version compatibility
@@ -96,8 +96,8 @@ release.
9696

9797
The latest container image can be found at:
9898

99-
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.16.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
100-
* [Multi-architecture images](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.16.0)
99+
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.17.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
100+
* [Multi-architecture images](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.17.0)
101101

102102
### Metrics Documentation
103103

data.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# The purpose of this config is to keep all versions in a single file and make them machine accessible
22

33
# Marks the latest release
4-
version: "2.16.0"
4+
version: "2.17.0"
55

66
# List at max 5 releases here + the main branch
77
compat:
8-
- version: "v2.12.0"
9-
kubernetes: "1.29"
108
- version: "v2.13.0"
119
kubernetes: "1.30"
1210
- version: "v2.14.0"
@@ -15,5 +13,7 @@ compat:
1513
kubernetes: "1.32"
1614
- version: "v2.16.0"
1715
kubernetes: "1.32"
16+
- version: "v2.17.0"
17+
kubernetes: "1.33"
1818
- version: "main"
1919
kubernetes: "1.33"

docs/metrics/workload/cronjob-metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| kube_cronjob_next_schedule_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
1010
| kube_cronjob_status_active | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
1111
| kube_cronjob_status_last_schedule_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
12-
| kube_cronjob_status_last_successful_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | EXPERIMENTAL |
12+
| kube_cronjob_status_last_successful_time | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | BETA |
1313
| kube_cronjob_spec_suspend | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
1414
| kube_cronjob_spec_starting_deadline_seconds | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |
1515
| kube_cronjob_metadata_resource_version | Gauge | | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE |

docs/metrics/workload/horizontalpodautoscaler-metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| kube_horizontalpodautoscaler_spec_max_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
1010
| kube_horizontalpodautoscaler_spec_min_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
1111
| 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 |
12-
| 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 |
12+
| 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; | BETA |
1313
| 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 |
1414
| kube_horizontalpodautoscaler_status_current_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |
1515
| kube_horizontalpodautoscaler_status_desired_replicas | Gauge | | `horizontalpodautoscaler`=&lt;hpa-name&gt; <br> `namespace`=&lt;hpa-namespace&gt; | STABLE |

docs/metrics/workload/job-metrics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
| kube_job_failed | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; <br> `condition`=&lt;true\|false\|unknown&gt; | STABLE |
1919
| kube_job_created | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | STABLE |
2020
| kube_job_status_suspended | Gauge | | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | EXPERIMENTAL |
21+
| kube_job_status_ready | Gauge | The number of ready pods that belong to this Job. | `job_name`=&lt;job-name&gt; <br> `namespace`=&lt;job-namespace&gt; | EXPERIMENTAL |

0 commit comments

Comments
 (0)