Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cut v2.0.0.-alpha #1224

Merged
merged 8 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
## v2.0.0.-alpha / 2020-05-24

NOTE: This is a major new alpha 2.0 release with breaking changes and removed metrics. See details below!

* [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
* [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] 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] v2: Remove deprecated metrics #1004
`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
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
* [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
All metrics with prefix of kube_hpa_ were renamed to kube_horizontalpodautoscaler_
* [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] Apply boundaries to metrics and allow via flag (--labels-allow-list) what labels to include #1125
* [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 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
* [ENHANCEMENT] Add DeprecatedVersion to struct FamilyGenerator and func NewFamilyGenerator #1160
* [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


## v1.9.7 / 2020-05-24

* [BUGFIX] internal/store/mutatingwebhookconfiguration.go: Switch to v1 #1144
Expand Down
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ are deleted they are no longer visible on the `/metrics` endpoint.
- [Development](#development)
- [Developer Contributions](#developer-contributions)

### Versioning

> **WARNING**: Please be aware that `master` branch is targeting an upcoming version v2
> of kube-state-metrics, which includes breaking changes. Documentation for the latest
> released version (`1.9.5`) is available in the [release-1.9](https://github.com/kubernetes/kube-state-metrics/tree/release-1.9/docs) branch.

#### Kubernetes Version

kube-state-metrics uses [`client-go`](https://github.com/kubernetes/client-go) to talk with
Expand All @@ -69,13 +63,12 @@ All additional compatibility is only best effort, or happens to still/already be
#### Compatibility matrix
At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kubernetes/kubernetes/releases) will be recorded below.

| kube-state-metrics | **Kubernetes 1.13** | **Kubernetes 1.14** | **Kubernetes 1.15** | **Kubernetes 1.16** | **Kubernetes 1.17** |
| kube-state-metrics | **Kubernetes 1.15** | **Kubernetes 1.16** | **Kubernetes 1.17** | **Kubernetes 1.18** | **Kubernetes 1.19** |
|--------------------|---------------------|---------------------|----------------------|----------------------|----------------------|
| **v1.6.0** | ✓ | - | - | - | - |
| **v1.7.2** | ✓ | ✓ | - | - | - |
| **v1.8.0** | ✓ | ✓ | ✓ | - | - |
| **v1.9.7** | - | - | - | ✓ | - |
| **master** | - | - | - | ✓ | ✓ |
| **v1.8.0** | ✓ | - | - | - | - |
| **v1.9.7** | - | ✓ | - | - | - |
| **v2.0.0-alpha** | - | ✓ | ✓ | ✓ | ✓ |
| **master** | - | ✓ | ✓ | ✓ | ✓ |
- `✓` Fully supported version range.
- `-` The Kubernetes cluster has features the client-go library can't use (additional API objects, deprecated APIs, etc).

Expand All @@ -87,28 +80,13 @@ release.
#### Container Image

The latest container image can be found at:
* `quay.io/coreos/kube-state-metrics:v1.9.7`
* `k8s.gcr.io/kube-state-metrics:v1.9.7`
* `quay.io/coreos/kube-state-metrics:v2.0.0-alpha`
* `k8s.gcr.io/kube-state-metrics:v2.0.0-alpha`

### Metrics Documentation

There are many more metrics we could report, but this first pass is focused on
those that could be used for actionable alerts. Please contribute PR's for
additional metrics!

> WARNING: THESE METRIC/TAG NAMES ARE UNSTABLE AND MAY CHANGE IN A FUTURE RELEASE.
> For now, the following metrics and resources
>
> **metrics**
> * `kube_pod_container_resource_requests_nvidia_gpu_devices`
> * `kube_pod_container_resource_limits_nvidia_gpu_devices`
> * `kube_node_status_capacity_nvidia_gpu_cards`
> * `kube_node_status_allocatable_nvidia_gpu_cards`
>
> are removed in kube-state-metrics v1.4.0.
>
> Any resources and metrics based on alpha Kubernetes APIs are excluded from any stability guarantee,
> which may be changed at any given release.
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.

Expand Down Expand Up @@ -156,6 +134,16 @@ 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:
```
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
```

### Scaling kube-state-metrics

#### Resource recommendation
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.7
2.0.0-alpha
2 changes: 1 addition & 1 deletion examples/autosharding/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
rules:
- apiGroups:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Role
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
rules:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
2 changes: 1 addition & 1 deletion examples/autosharding/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
spec:
Expand Down
6 changes: 3 additions & 3 deletions examples/autosharding/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -16,7 +16,7 @@ spec:
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
spec:
containers:
- args:
Expand All @@ -33,7 +33,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: quay.io/coreos/kube-state-metrics:v1.9.7
image: quay.io/coreos/kube-state-metrics:v2.0.0-alpha
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
rules:
- apiGroups:
Expand Down
6 changes: 3 additions & 3 deletions examples/standard/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -15,10 +15,10 @@ spec:
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
spec:
containers:
- image: quay.io/coreos/kube-state-metrics:v1.9.7
- image: quay.io/coreos/kube-state-metrics:v2.0.0-alpha
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/standard/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
2 changes: 1 addition & 1 deletion examples/standard/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 1.9.7
app.kubernetes.io/version: 2.0.0-alpha
name: kube-state-metrics
namespace: kube-system
spec:
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ require (
github.com/campoy/embedmd v1.0.0
github.com/dgryski/go-jump v0.0.0-20170409065014-e1f439676b57
github.com/google/go-jsonnet v0.14.0
github.com/jsonnet-bundler/jsonnet-bundler v0.1.1-0.20190930114713-10e24cb86976
github.com/jsonnet-bundler/jsonnet-bundler v0.4.1-0.20200708074244-ada055a225fa
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/oklog/run v1.1.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1
Expand All @@ -14,6 +15,7 @@ require (
github.com/prometheus/prometheus v1.8.2-0.20200326161412-ae041f97cfc6
github.com/robfig/cron/v3 v3.0.0
github.com/spf13/pflag v1.0.5
golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 // indirect
golang.org/x/tools v0.0.0-20200305205014-bc073721adb6
k8s.io/api v0.18.6
k8s.io/apimachinery v0.18.6
Expand Down
9 changes: 7 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jsonnet-bundler/jsonnet-bundler v0.1.1-0.20190930114713-10e24cb86976 h1:Yolu/ufxugb61pYkJUCTDNwvOYlMVRl/NBcxh3Nulw0=
github.com/jsonnet-bundler/jsonnet-bundler v0.1.1-0.20190930114713-10e24cb86976/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU=
github.com/jsonnet-bundler/jsonnet-bundler v0.4.1-0.20200708074244-ada055a225fa h1:QFLRnKsv79DTZWbqJRjvMMtP0I6wrtNeMZekqRIRFLE=
github.com/jsonnet-bundler/jsonnet-bundler v0.4.1-0.20200708074244-ada055a225fa/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
Expand Down Expand Up @@ -320,6 +320,8 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
Expand Down Expand Up @@ -598,9 +600,12 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200915084602-288bc346aa39 h1:356XA7ITklAU2//sYkjFeco+dH1bCRD8XCJ9FIEsvo4=
golang.org/x/sys v0.0.0-20200915084602-288bc346aa39/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
38 changes: 19 additions & 19 deletions scripts/jsonnetfile.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"dependencies": [
{
"name": "kube-state-metrics",
"source": {
"local": {
"directory": "../jsonnet/kube-state-metrics"
}
},
"version": ""
},
{
"name": "kube-state-metrics-mixin",
"source": {
"local": {
"directory": "../jsonnet/kube-state-metrics-mixin"
}
},
"version": ""
"version": 1,
"dependencies": [
{
"source": {
"local": {
"directory": "../jsonnet/kube-state-metrics"
}
]
},
"version": ""
},
{
"source": {
"local": {
"directory": "../jsonnet/kube-state-metrics-mixin"
}
},
"version": ""
}
],
"legacyImports": true
}
Loading