Skip to content

Commit b1991d6

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 417e9c9 + 60d4c4e commit b1991d6

File tree

103 files changed

+3274
-1512
lines changed

Some content is hidden

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

103 files changed

+3274
-1512
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ env:
2020
E2E_SETUP_KIND: yes
2121
E2E_SETUP_KUBECTL: yes
2222
SUDO: sudo
23-
GO_VERSION: "^1.19"
24-
GOLANGCI_LINT_VERSION: "v1.50.1"
23+
GO_VERSION: "^1.20"
24+
GOLANGCI_LINT_VERSION: "v1.53.3"
2525

2626
jobs:
2727
ci-go-lint:
2828
name: ci-go-lint
2929
runs-on: ubuntu-latest
3030
steps:
31+
- name: Check out code into the Go module directory
32+
uses: actions/checkout@v3
33+
3134
- name: Set up Go 1.x
32-
uses: actions/setup-go@v3
35+
uses: actions/setup-go@v4
3336
with:
3437
go-version: ${{ env.GO_VERSION }}
3538
id: go
3639

37-
- name: Check out code into the Go module directory
38-
uses: actions/checkout@v3
39-
4040
- name: Setup environment
4141
run: |
4242
make install-tools
@@ -50,15 +50,15 @@ jobs:
5050
name: ci-validate-manifests
5151
runs-on: ubuntu-latest
5252
steps:
53+
- name: Check out code into the Go module directory
54+
uses: actions/checkout@v3
55+
5356
- name: Set up Go 1.x
54-
uses: actions/setup-go@v3
57+
uses: actions/setup-go@v4
5558
with:
5659
go-version: ${{ env.GO_VERSION }}
5760
id: go
5861

59-
- name: Check out code into the Go module directory
60-
uses: actions/checkout@v3
61-
6262
- name: Setup environment
6363
run: |
6464
make install-tools
@@ -71,15 +71,15 @@ jobs:
7171
name: ci-validate-go-modules
7272
runs-on: ubuntu-latest
7373
steps:
74+
- name: Check out code into the Go module directory
75+
uses: actions/checkout@v3
76+
7477
- name: Set up Go 1.x
75-
uses: actions/setup-go@v3
78+
uses: actions/setup-go@v4
7679
with:
7780
go-version: ${{ env.GO_VERSION }}
7881
id: go
7982

80-
- name: Check out code into the Go module directory
81-
uses: actions/checkout@v3
82-
8383
- name: Setup environment
8484
run: |
8585
make install-tools
@@ -92,15 +92,15 @@ jobs:
9292
name: ci-validate-docs
9393
runs-on: ubuntu-latest
9494
steps:
95+
- name: Check out code into the Go module directory
96+
uses: actions/checkout@v3
97+
9598
- name: Set up Go 1.x
96-
uses: actions/setup-go@v3
99+
uses: actions/setup-go@v4
97100
with:
98101
go-version: ${{ env.GO_VERSION }}
99102
id: go
100103

101-
- name: Check out code into the Go module directory
102-
uses: actions/checkout@v3
103-
104104
- name: Setup environment
105105
run: |
106106
make install-tools
@@ -113,15 +113,15 @@ jobs:
113113
name: ci-unit-tests
114114
runs-on: ubuntu-latest
115115
steps:
116+
- name: Check out code into the Go module directory
117+
uses: actions/checkout@v3
118+
116119
- name: Set up Go 1.x
117-
uses: actions/setup-go@v3
120+
uses: actions/setup-go@v4
118121
with:
119122
go-version: ${{ env.GO_VERSION }}
120123
id: go
121124

122-
- name: Check out code into the Go module directory
123-
uses: actions/checkout@v3
124-
125125
- name: Setup environment
126126
run: |
127127
make install-tools
@@ -149,15 +149,15 @@ jobs:
149149
name: ci-benchmark-tests
150150
runs-on: ubuntu-latest
151151
steps:
152+
- name: Check out code into the Go module directory
153+
uses: actions/checkout@v3
154+
152155
- name: Set up Go 1.x
153-
uses: actions/setup-go@v3
156+
uses: actions/setup-go@v4
154157
with:
155158
go-version: ${{ env.GO_VERSION }}
156159
id: go
157160

158-
- name: Check out code into the Go module directory
159-
uses: actions/checkout@v3
160-
161161
- name: Setup environment
162162
run: |
163163
make install-tools
@@ -170,15 +170,15 @@ jobs:
170170
name: ci-build-kube-state-metrics
171171
runs-on: ubuntu-latest
172172
steps:
173+
- name: Check out code into the Go module directory
174+
uses: actions/checkout@v3
175+
173176
- name: Set up Go 1.x
174-
uses: actions/setup-go@v3
177+
uses: actions/setup-go@v4
175178
with:
176179
go-version: ${{ env.GO_VERSION }}
177180
id: go
178181

179-
- name: Check out code into the Go module directory
180-
uses: actions/checkout@v3
181-
182182
- name: Setup environment
183183
run: |
184184
make install-tools
@@ -191,15 +191,15 @@ jobs:
191191
name: ci-e2e-tests
192192
runs-on: ubuntu-latest
193193
steps:
194+
- name: Check out code into the Go module directory
195+
uses: actions/checkout@v3
196+
194197
- name: Set up Go 1.x
195-
uses: actions/setup-go@v3
198+
uses: actions/setup-go@v4
196199
with:
197200
go-version: ${{ env.GO_VERSION }}
198201
id: go
199202

200-
- name: Check out code into the Go module directory
201-
uses: actions/checkout@v3
202-
203203
- name: Setup environment
204204
run: |
205205
make install-tools

.github/workflows/govulncheck.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: '0 0 * * 1'
77

88
env:
9-
GO_VERSION: "^1.19"
9+
GO_VERSION: "^1.20"
1010

1111
jobs:
1212
ci-security-checks:
@@ -15,12 +15,12 @@ jobs:
1515
- uses: actions/checkout@v3
1616
name: Checkout code
1717
- name: Set up Go 1.x
18-
uses: actions/setup-go@v3
18+
uses: actions/setup-go@v4
1919
with:
2020
go-version: ${{ env.GO_VERSION }}
2121
- name: Install govulncheck binary
2222
run: |
2323
go install golang.org/x/vuln/cmd/govulncheck@latest
2424
- name: Run security checks
2525
run: |
26-
govulncheck -v ./...
26+
govulncheck ./...

.github/workflows/semantic.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Lint pull request title"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title for semantic commit message
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
## v2.9.2 / 2023-05-30
2+
3+
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.
4+
5+
## v2.9.1 / 2023-05-29
6+
7+
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.
8+
9+
## v2.9.0 / 2023-05-23
10+
11+
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.
12+
13+
### Note
14+
15+
- 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.
16+
- #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.
17+
18+
* [BUGFIX] Adhere to OTel-Prometheus standard for labels #2004 @rexagod
19+
* [BUGFIX] Respect relative paths for label resolutions #2007 @rexagod
20+
* [BUGFIX] Support LabelsFromPath functionality for Info-typed metrics #2048 @murphd40
21+
* [CHANGE] Remove VerticalPodAutoscaler #2017 @mrueg
22+
* [ENHANCEMENT] Add StatefulSet Start Ordinal metrics for KEP-3335 #1959 @pwschuurman
23+
* [ENHANCEMENT] Add namespace label to `kube_lease_renew_time` #2073 @A-Hilaly
24+
* [ENHANCEMENT] Add parameters for PodSecurity #2042 @jcpunk
25+
* [ENHANCEMENT] Add support for multi cluster prometheus alerts #2058 @jkroepke
26+
* [ENHANCEMENT] Don't crash on non-existent path values #1998 @rexagod
27+
* [ENHANCEMENT] Only use OpenMetrics and Text in contentType #2024 @CatherineF-dev
28+
* [ENHANCEMENT] Update go version to 1.20.4 #2056 @RamakrishnanArun
29+
* [FEATURE] Add support for variable VKs in CRS config #1851 @rexagod
30+
* [FEATURE] Support quantities and percentages #1989 @mrueg
31+
* [FEATURE] Use prometheus/exporter-toolkit landing page #2034 @mrueg
32+
33+
## v2.8.2 / 2023-03-17
34+
35+
* [BUGFIX] Only use OpenMetrics and Text in contentType #2024 @CatherineF-dev
36+
37+
## v2.8.1 / 2023-02-22
38+
39+
* [BUGFIX] Don't crash on non-existent paths @rexagod #1998
40+
* [BUGFIX] Fix public Builder compatibility with BuilderInterface @clamoriniere #1994
41+
42+
## v2.8.0 / 2023-02-10
43+
44+
Note: The `--version` flag was removed as `kube-state-metrics version` also provides the same information. See #1956
45+
46+
Note: Experimental CustomResourceState changed their labels for better usability. See #1942
47+
kube_crd_uptime{group="myteam.io", kind="Foo", version="v1"} -> kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"}
48+
49+
* [CHANGE] Prefix Group, Version and Kind labels for CustomResourceState Metrics #1942 @bavarianbidi
50+
* [CHANGE] Fix empty string for "owner_\*" dimensions #1923 @pawcykca
51+
* [CHANGE] Remove broken --version flag, replace by version command #1956 @bjorand
52+
* [FEATURE] Add metrics for EndpointSlices #1910 @mrueg
53+
* [FEATURE] Add metrics for config file changes #1916 @mrueg
54+
* [FEATURE] Add metrics for CustomResource State config file change #1928 @mrueg
55+
* [FEATURE] Reload Kube-State-Metrics on CustomResourceState config file change #1930 @mrueg
56+
* [FEATURE] Make CustomResourceState metrics type dynamic #1930 @rexagod
57+
* [FEATURE] Add kube_pod_status_qos_class to pod metrics #1932 @frezes
58+
* [FEATURE] Add kube_pod_status_ready_time and kube_pod_status_containers_ready_time metrics #1938 @ryanrolds
59+
* [FEATURE] Enrich UserAgent with more information about kube-state-metrics #1960 @mrueg
60+
* [FEATURE] Convert True/False to 1.0/0.0 values in CustomResourceState metrics #1963 @jabdoa2
61+
* [FEATURE] Expose metrics in OpenMetrics format #1974 @mrueg
62+
* [BUGFIX] Handle unit length `valueFrom` values #1958 @rexagod
63+
* [ENHANCEMENT] Build with kubernetes 1.26 #1933 @mrueg
64+
165
## v2.7.0 / 2022-11-25
266

367
Note: Experimental VerticalPodAutoscaler metrics are considered deprecated in this release and will be removed in v2.9.0.

CONTRIBUTING.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,40 @@ _As contributors and maintainers of this project, and in the interest of fosteri
66

77
## Getting Started
88

9-
We have full documentation on how to get started contributing here:
9+
We have full documentation on how to get started contributing here:
1010

11-
<!---
12-
If your repo has certain guidelines for contribution, put them here ahead of the general k8s resources
13-
-->
11+
### Semantic Commit Messages
12+
13+
We use [semantic commit messages](https://www.conventionalcommits.org/en/v1.0.0/) in this repository.
14+
15+
They follow this format: `<type>[optional scope]: <description>`
16+
17+
Examples for commit messages following this are:
18+
19+
`feat: allow provided config object to extend other configs`
20+
21+
You can also include a scope within parenthesis:
22+
23+
`fix(scope): Prevent wrong calculation of storage`
24+
25+
Here's a list of types that we use:
26+
27+
| Type | Explanation |
28+
|---|---|
29+
| feat | A new feature |
30+
| fix | A bug fix |
31+
| docs | Documentation only changes |
32+
| style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
33+
| refactor | A code change that neither fixes a bug nor adds a feature |
34+
| perf | A code change that improves performance |
35+
| test | Adding missing tests or correcting existing tests |
36+
| build |Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
37+
| ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
38+
| chore | Other changes that don't modify src or test files |
39+
| revert | Reverts a previous commit |
40+
41+
42+
### Further Information
1443

1544
- [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
1645
- [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)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GOVERSION=1.19
1+
ARG GOVERSION=1.20
22
ARG GOARCH
33
FROM golang:${GOVERSION} as builder
44
ARG GOARCH

MAINTAINER.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Maintaining kube-state-metrics
2+
3+
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.
4+
5+
As part of the Kubernetes project, we use the community membership process as described [here](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.
6+
7+
## Adding a new reviewer
8+
* Ensure the new reviewer is a member of the [kubernetes organization](https://github.com/kubernetes/org/blob/main/config/kubernetes/org.yaml).
9+
* Add the new reviewer to the [OWNERS](OWNERS) file to be able to review pull requests.
10+
* 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).
11+
12+
13+
## Adding a new approver
14+
* Ensure the new approver is already a reviewer in the [OWNERS](OWNERS) file.
15+
* Add the new approver to the [OWNERS](OWNERS) file to be able to approve pull requests.
16+
* Add the new approver to the [SECURITY_CONTACTS](SECURITY_CONTACTS) file to be able to get notified on security related incidents.
17+
* 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.
18+
* 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.

0 commit comments

Comments
 (0)