Skip to content

Commit 9862ba2

Browse files
authored
Merge pull request #1285 from lilic/merge-master-2.0
Merge master into release-2.0 branch
2 parents b6a83ca + a4867d8 commit 9862ba2

45 files changed

Lines changed: 894 additions & 925 deletions

Some content is hidden

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

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Report a bug encountered while running kube-state-metrics
4+
title: ''
5+
labels: kind/bug
6+
assignees: ''
7+
8+
---
9+
10+
<!-- 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!
11+
12+
If the matter is security related, please disclose it privately see https://github.com/kubernetes/kube-state-metrics/blob/master/SECURITY.md
13+
-->
14+
15+
**What happened**:
16+
17+
**What you expected to happen**:
18+
19+
**How to reproduce it (as minimally and precisely as possible)**:
20+
21+
**Anything else we need to know?**:
22+
23+
**Environment**:
24+
- kube-state-metrics version:
25+
- Kubernetes version (use `kubectl version`):
26+
- Cloud provider or hardware configuration:
27+
- Other info:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature
4+
title: ''
5+
labels: kind/feature
6+
assignees: ''
7+
8+
---
9+
10+
<!-- Please only use this template for submitting feature requests -->
11+
12+
**What would you like to be added**:
13+
14+
**Why is this needed**:
15+
16+
**Describe the solution you'd like**
17+
18+
**Additional context**

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up Go 1.x
2727
uses: actions/setup-go@v2
2828
with:
29-
go-version: ^1.14
29+
go-version: ^1.15
3030
id: go
3131

3232
- name: Check out code into the Go module directory
@@ -49,7 +49,7 @@ jobs:
4949
- name: Set up Go 1.x
5050
uses: actions/setup-go@v2
5151
with:
52-
go-version: ^1.14
52+
go-version: ^1.15
5353
id: go
5454

5555
- name: Check out code into the Go module directory
@@ -71,7 +71,7 @@ jobs:
7171
- name: Set up Go 1.x
7272
uses: actions/setup-go@v2
7373
with:
74-
go-version: ^1.14
74+
go-version: ^1.15
7575
id: go
7676

7777
- name: Check out code into the Go module directory
@@ -93,7 +93,7 @@ jobs:
9393
- name: Set up Go 1.x
9494
uses: actions/setup-go@v2
9595
with:
96-
go-version: ^1.14
96+
go-version: ^1.15
9797
id: go
9898

9999
- name: Check out code into the Go module directory
@@ -115,7 +115,7 @@ jobs:
115115
- name: Set up Go 1.x
116116
uses: actions/setup-go@v2
117117
with:
118-
go-version: ^1.14
118+
go-version: ^1.15
119119
id: go
120120

121121
- name: Check out code into the Go module directory
@@ -137,7 +137,7 @@ jobs:
137137
- name: Set up Go 1.x
138138
uses: actions/setup-go@v2
139139
with:
140-
go-version: ^1.14
140+
go-version: ^1.15
141141
id: go
142142

143143
- name: Check out code into the Go module directory
@@ -159,7 +159,7 @@ jobs:
159159
- name: Set up Go 1.x
160160
uses: actions/setup-go@v2
161161
with:
162-
go-version: ^1.14
162+
go-version: ^1.15
163163
id: go
164164

165165
- name: Check out code into the Go module directory
@@ -181,7 +181,7 @@ jobs:
181181
- name: Set up Go 1.x
182182
uses: actions/setup-go@v2
183183
with:
184-
go-version: ^1.14
184+
go-version: ^1.15
185185
id: go
186186

187187
- name: Check out code into the Go module directory

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## v2.0.0-alpha.2 / 2020-10-27
2+
3+
* [CHANGE] Migrate ingress and certificates to new stable APIs #1260
4+
* [CHANGE] Revert "Rework resource metrics" #1278
5+
To better align with future Kubernetes resource metrics, the changes to resource metrics were reverted, new metrics are:
6+
kube_pod_container_resource_requests and kube_pod_container_resource_limits
7+
* [FEATURE] Added the job failure reason in kube_job_status_failed metric #1214
8+
* [FEATURE] feat(persistentvolume): claimRef info to labels (kube_persistentvolume_claim_ref) #1244
9+
* [FEATURE] pod: add gauge for runtimeclass handler (kube_pod_runtimeclass_name_info) #1276
10+
111
## v2.0.0-alpha.1 / 2020-10-06
212

313
* [CHANGE] Update go module path to k8s.io/kube-state-metrics/v2 #1238

Dockerfile

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

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ TESTENVVAR =
33
REGISTRY ?= gcr.io/k8s-staging-kube-state-metrics
44
TAG_PREFIX = v
55
VERSION = $(shell cat VERSION)
6-
TAG = $(TAG_PREFIX)$(VERSION)
6+
TAG ?= $(TAG_PREFIX)$(VERSION)
77
LATEST_RELEASE_BRANCH := release-$(shell grep -ohE "[0-9]+.[0-9]+" VERSION)
88
DOCKER_CLI ?= docker
99
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /tests/e2e)
1010
ARCH ?= $(shell go env GOARCH)
11-
BuildDate = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
12-
Commit = $(shell git rev-parse --short HEAD)
11+
BUILD_DATE = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
12+
GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
1313
ALL_ARCH = amd64 arm arm64 ppc64le s390x
1414
PKG = k8s.io/kube-state-metrics/v2/pkg
15-
GO_VERSION = 1.14.7
15+
GO_VERSION = 1.15.3
1616
IMAGE = $(REGISTRY)/kube-state-metrics
1717
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
1818

@@ -54,7 +54,7 @@ doccheck: generate
5454
@echo OK
5555

5656
build-local:
57-
GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "-s -w -X ${PKG}/version.Release=${TAG} -X ${PKG}/version.Commit=${Commit} -X ${PKG}/version.BuildDate=${BuildDate}" -o kube-state-metrics
57+
GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "-s -w -X ${PKG}/version.Release=${TAG} -X ${PKG}/version.Commit=${GIT_COMMIT} -X ${PKG}/version.BuildDate=${BUILD_DATE}" -o kube-state-metrics
5858

5959
build: kube-state-metrics
6060

@@ -99,7 +99,7 @@ do-push-%:
9999

100100
push-multi-arch:
101101
${DOCKER_CLI} manifest create --amend $(IMAGE):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(IMAGE)\-&:$(TAG)~g")
102-
@for arch in $(ALL_ARCH); do ${DOCKER_CLI} manifest annotate --arch $${arch} $(IMAGE):$(TAG) $(IMAGE)-$${arch}:${TAG}; done
102+
@for arch in $(ALL_ARCH); do ${DOCKER_CLI} manifest annotate --arch $${arch} $(IMAGE):$(TAG) $(IMAGE)-$${arch}:$(TAG); done
103103
${DOCKER_CLI} manifest push --purge $(IMAGE):$(TAG)
104104

105105
quay-push: .quay-push-$(ARCH)

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ the raw metrics. Note that the metrics exposed on the `/metrics` endpoint
2626
reflect the current state of the Kubernetes cluster. When Kubernetes objects
2727
are deleted they are no longer visible on the `/metrics` endpoint.
2828

29+
Note that any new features will be merged into master but released with v2.1.0 release, as currently v2.0.0 is in post feature freeze and only accepting bug fixes.
30+
2931
## Table of Contents
3032

3133
- [Versioning](#versioning)
@@ -61,29 +63,33 @@ The compatibility matrix for client-go and Kubernetes cluster can be found
6163
All additional compatibility is only best effort, or happens to still/already be supported.
6264

6365
#### Compatibility matrix
66+
6467
At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kubernetes/kubernetes/releases) will be recorded below.
6568

6669
| kube-state-metrics | **Kubernetes 1.15** | **Kubernetes 1.16** | **Kubernetes 1.17** | **Kubernetes 1.18** | **Kubernetes 1.19** |
6770
|--------------------|---------------------|---------------------|----------------------|----------------------|----------------------|
6871
| **v1.8.0** || - | - | - | - |
6972
| **v1.9.7** | - || - | - | - |
70-
| **v2.0.0-alpha.1** | - | - | | ||
71-
| **master** | - | - | | ||
73+
| **v2.0.0-alpha.2** | - | - | -/| -/✓ ||
74+
| **master** | - | - | -/| -/✓ ||
7275
- `` Fully supported version range.
7376
- `-` The Kubernetes cluster has features the client-go library can't use (additional API objects, deprecated APIs, etc).
7477

78+
**Note:** The `v2.0.0-alpha.2+` and `master` releases of kube-state-metrics work on Kubernetes v1.17 and v1.18 excluding Ingress or CertificateSigningRequest resource metrics. If you require those metrics and are on an older Kubernetes version, use v2.0.0-alpha.1 or v1.9.7 kube-state-metrics release.
79+
7580
#### Resource group version compatibility
81+
7682
Resources in Kubernetes can evolve, i.e., the group version for a resource may change from alpha to beta and finally GA
7783
in different Kubernetes versions. For now, kube-state-metrics will only use the oldest API available in the latest
7884
release.
7985

8086
#### Container Image
8187

8288
The latest container image can be found at:
83-
* `quay.io/coreos/kube-state-metrics:v2.0.0-alpha.1`
84-
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics:2.0.0-alpha.1`
85-
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics-arm:2.0.0-alpha.1`
86-
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics-arm64:2.0.0-alpha.1`
89+
* `quay.io/coreos/kube-state-metrics:v2.0.0-alpha.2`
90+
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics:2.0.0-alpha.2`
91+
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics-arm:2.0.0-alpha.2`
92+
* `k8s.gcr.io/kube-state-metrics/kube-state-metrics-arm64:2.0.0-alpha.2`
8793

8894
### Metrics Documentation
8995

@@ -184,14 +190,14 @@ It is a cluster level component which periodically scrapes metrics from all
184190
Kubernetes nodes served by Kubelet through Summary API. The metrics are
185191
aggregated, stored in memory and served in [Metrics API
186192
format](https://git.k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go). The
187-
metric-server stores the latest values only and is not responsible for
193+
metrics-server stores the latest values only and is not responsible for
188194
forwarding metrics to third-party destinations.
189195

190196
kube-state-metrics is focused on generating completely new metrics from
191197
Kubernetes' object state (e.g. metrics based on deployments, replica sets,
192198
etc.). It holds an entire snapshot of Kubernetes state in memory and
193199
continuously generates new metrics based off of it. And just like the
194-
metric-server it too is not responsibile for exporting its metrics anywhere.
200+
metrics-server it too is not responsibile for exporting its metrics anywhere.
195201

196202
Having kube-state-metrics as a separate project also enables access to these
197203
metrics from monitoring systems such as Prometheus.
@@ -283,7 +289,7 @@ subjects:
283289
namespace: your-namespace-where-kube-state-metrics-will-deployed
284290
```
285291

286-
- then specify a set of namespaces (using the `--namespace` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
292+
- 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
287293

288294
```yaml
289295
spec:
@@ -293,7 +299,7 @@ spec:
293299
- name: kube-state-metrics
294300
args:
295301
- '--resources=pods'
296-
- '--namespace=project1'
302+
- '--namespaces=project1'
297303
```
298304

299305
For the full list of arguments available, see the documentation in [docs/cli-arguments.md](./docs/cli-arguments.md)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0-alpha.1
1+
2.0.0-alpha.2

cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ steps:
66
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4'
77
entrypoint: make
88
env:
9-
- GIT_TAG=$_PULL_BASE_REF
9+
- TAG=$_PULL_BASE_REF
1010
- GIT_COMMIT=$_PULL_BASE_SHA
1111
args:
1212
- push

0 commit comments

Comments
 (0)