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

chore: Cut v2.10.0 #2176

Merged
merged 2 commits into from
Aug 31, 2023
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 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.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ Generally, it is recommended to use the latest release of kube-state-metrics. If

| kube-state-metrics | Kubernetes client-go Version |
|--------------------|:----------------------------:|
| **v2.5.0** | v1.24 |
| **v2.6.0** | v1.24 |
| **v2.7.0** | v1.25 |
| **v2.8.2** | v1.26 |
| **v2.9.2** | v1.26 |
| **v2.10.0** | v1.27 |
| **main** | v1.27 |


Expand All @@ -90,8 +90,8 @@ release.
#### Container Image

The latest container image can be found at:
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
* View all multi-architecture images at [here](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.9.2)
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
* View all multi-architecture images at [here](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.10.0)

### Metrics Documentation

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.2
2.10.0
1 change: 1 addition & 0 deletions docs/endpointslice-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
| 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](./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 |
2 changes: 1 addition & 1 deletion examples/autosharding/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion examples/autosharding/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -5,6 +5,6 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -18,7 +18,7 @@ spec:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
spec:
automountServiceAccountToken: true
containers:
Expand All @@ -34,7 +34,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
rules:
- apiGroups:
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/daemonset-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics-shard
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics-shard
namespace: kube-system
spec:
Expand Down
6 changes: 3 additions & 3 deletions examples/daemonsetsharding/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics-shard
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics-shard
namespace: kube-system
spec:
Expand All @@ -16,7 +16,7 @@ spec:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics-shard
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
spec:
automountServiceAccountToken: true
containers:
Expand All @@ -29,7 +29,7 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/deployment-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
spec:
Expand Down
6 changes: 3 additions & 3 deletions examples/daemonsetsharding/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -17,13 +17,13 @@ spec:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
spec:
automountServiceAccountToken: true
containers:
- args:
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
2 changes: 1 addition & 1 deletion examples/standard/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
spec:
Expand All @@ -17,11 +17,11 @@ spec:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
spec:
automountServiceAccountToken: true
containers:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.9.2
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0
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 @@ -5,6 +5,6 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
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 @@ -4,7 +4,7 @@ metadata:
labels:
app.kubernetes.io/component: exporter
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.9.2
app.kubernetes.io/version: 2.10.0
name: kube-state-metrics
namespace: kube-system
spec:
Expand Down
42 changes: 41 additions & 1 deletion internal/store/endpointslice.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,44 @@ func endpointSliceMetricFamilies(allowAnnotationsList, allowLabelsList []string)
}
}),
),
*generator.NewFamilyGeneratorWithStability(
"kube_endpointslice_endpoints_hints",
"Topology routing hints attached to endpoints",
metric.Gauge,
basemetrics.ALPHA,
"",
wrapEndpointSliceFunc(func(e *discoveryv1.EndpointSlice) *metric.Family {
m := []*metric.Metric{}
for _, ep := range e.Endpoints {
// Hint is populated when the endpoint is configured to be zone aware and preferentially route requests to its local zone.
// If there is no hint, skip this metric
if ep.Hints != nil && len(ep.Hints.ForZones) > 0 {
var (
labelKeys,
labelValues []string
)

// Per Docs.
// This must contain at least one address but no more than
// 100. These are all assumed to be fungible and clients may choose to only
// use the first element. Refer to: https://issue.k8s.io/106267
labelKeys = append(labelKeys, "address")
labelValues = append(labelValues, ep.Addresses[0])

for _, zone := range ep.Hints.ForZones {
m = append(m, &metric.Metric{
LabelKeys: append(labelKeys, "for_zone"),
LabelValues: append(labelValues, zone.Name),
Value: 1,
})
}
}
}
return &metric.Family{
Metrics: m,
}
}),
),
*generator.NewFamilyGeneratorWithStability(
"kube_endpointslice_endpoints",
"Endpoints attached to the endpointslice.",
Expand Down Expand Up @@ -134,9 +172,11 @@ func endpointSliceMetricFamilies(allowAnnotationsList, allowLabelsList []string)
for _, address := range ep.Addresses {
newlabelValues := make([]string, len(labelValues))
copy(newlabelValues, labelValues)
newlabelValues = append(newlabelValues, address)

m = append(m, &metric.Metric{
LabelKeys: labelKeys,
LabelValues: append(newlabelValues, address),
LabelValues: newlabelValues,
Value: 1,
})
}
Expand Down
Loading