Skip to content

Commit 63a0298

Browse files
committed
fixed md024, md036, md040, md041, md033 rules
1 parent 61be81f commit 63a0298

File tree

13 files changed

+49
-42
lines changed

13 files changed

+49
-42
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ assignees: ''
1313

1414
**Why is this needed**:
1515

16-
**Describe the solution you'd like**
16+
**Describe the solution you'd like**:
1717

18-
**Additional context**
18+
**Additional context**:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
66
-->
77

8+
<!-- markdownlint-disable-file -->
89
**What this PR does / why we need it**:
910

1011
**How does this change affect the cardinality of KSM**: *(increases, decreases or does not change cardinality)*

.markdownlint-cli2.jsonc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
"style": "asterisk"
99
},
1010
"MD013": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md013---line-length
11-
"MD024": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md024---multiple-headers-with-the-same-content
12-
"MD033": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md033---inline-html
13-
"MD036": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md036---emphasis-used-instead-of-a-header
14-
"MD040": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md040---fenced-code-blocks-should-have-a-language-specified
15-
"MD041": false // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md041---first-line-in-file-should-be-a-top-level-header
11+
"MD033": {
12+
"allowed_elements": [
13+
"details",
14+
"summary",
15+
"br"
16+
]
17+
}
1618
}
1719
}

.openvex/templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To add new statements to publish data about a vulnerability,
99
download [vexctl](https://github.com/openvex/vexctl)
1010
and append new statements using `vexctl add`. For example:
1111

12-
```
12+
```bash
1313
vexctl add --in-place main.openvex.json pkg:oci/test CVE-2014-1234567 fixed
1414
```
1515

CHANGELOG.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Changelog
2+
13
## v2.16.0 / 2025-06-23
24

3-
## Note
5+
**Note:**
46

57
* This release builds with Golang `v1.24.4`
68
* This release builds with `k8s.io/client-go`: `v0.32.6`
@@ -15,7 +17,7 @@
1517

1618
## v2.15.0 / 2025-02-03
1719

18-
## Note
20+
**Note:**
1921

2022
* This release builds with Golang `v1.23.5`
2123
* This release builds with `k8s.io/client-go`: `v0.32.1`
@@ -31,7 +33,7 @@
3133

3234
## v2.14.0 / 2024-11-08
3335

34-
### Note
36+
**Note:**
3537

3638
* This release builds with Golang `v1.23.3`
3739
* This release builds with `k8s.io/client-go`: `v0.31.2`
@@ -54,7 +56,7 @@
5456

5557
## v2.13.0 / 2024-07-18
5658

57-
### Note
59+
**Note:**
5860

5961
* This release builds with Golang `v1.22.5`.
6062
* This release builds with `k8s.io/client-go`: `v0.30.3`.
@@ -69,7 +71,7 @@
6971

7072
## v2.12.0 / 2024-04-02
7173

72-
### Note
74+
**Note:**
7375

7476
* This release addresses a critical issue where scraping the exposition data for certain types caused metrics-backends to crash: <https://github.com/kubernetes/kube-state-metrics/issues/2248>.
7577
* This release builds with `k8s.io/client-go`: `v0.29.3`.
@@ -80,7 +82,7 @@
8082

8183
## v2.11.0 / 2024-03-04
8284

83-
### Note
85+
**Note:**
8486

8587
This release builds with Golang `v1.21.8`.
8688

@@ -97,7 +99,7 @@ This release builds with Golang `v1.21.8`.
9799

98100
## v2.10.1 / 2023-10-09
99101

100-
### Note
102+
**Note:**
101103

102104
* This release addresses a regression introduced in [#2105](https://github.com/kubernetes/kube-state-metrics/pull/2105).
103105

@@ -106,7 +108,7 @@ This release builds with Golang `v1.21.8`.
106108

107109
## v2.10.0 / 2023-08-31
108110

109-
### Note
111+
**Note:**
110112

111113
* 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.
112114

@@ -139,7 +141,7 @@ This release does not incorporate any user-facing changes. Re-running release pr
139141

140142
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.
141143

142-
### Note
144+
**Note:**
143145

144146
* 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.
145147
* #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.

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ at the logs of kube-state-metrics.
143143

144144
Example of the above mentioned metrics:
145145

146-
```
146+
```prometheus
147147
kube_state_metrics_list_total{resource="*v1.Node",result="success"} 1
148148
kube_state_metrics_list_total{resource="*v1.Node",result="error"} 52
149149
kube_state_metrics_watch_total{resource="*v1beta1.Ingress",result="success"} 1
150150
```
151151

152152
kube-state-metrics also exposes some http request metrics, examples of those are:
153153

154-
```
154+
```prometheus
155155
http_request_duration_seconds_bucket{handler="metrics",method="get",le="2.5"} 30
156156
http_request_duration_seconds_bucket{handler="metrics",method="get",le="5"} 30
157157
http_request_duration_seconds_bucket{handler="metrics",method="get",le="10"} 30
@@ -162,7 +162,7 @@ http_request_duration_seconds_count{handler="metrics",method="get"} 30
162162

163163
kube-state-metrics also exposes build and configuration metrics:
164164

165-
```
165+
```prometheus
166166
kube_state_metrics_build_info{branch="main",goversion="go1.15.3",revision="6c9d775d",version="v2.0.0-beta"} 1
167167
kube_state_metrics_shard_ordinal{shard_ordinal="0"} 0
168168
kube_state_metrics_total_shards 1
@@ -175,7 +175,7 @@ run-time configuration, see [`/examples/prometheus-alerting-rules`](./examples/p
175175

176176
kube-state-metrics also exposes metrics about it config file and the Custom Resource State config file:
177177

178-
```
178+
```prometheus
179179
kube_state_metrics_config_hash{filename="crs.yml",type="customresourceconfig"} 2.38272279311849e+14
180180
kube_state_metrics_config_hash{filename="config.yml",type="config"} 2.65285922340846e+14
181181
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="crs.yml",type="customresourceconfig"} 1.6704882592037103e+09
@@ -202,7 +202,7 @@ Note that if CPU limits are set too low, kube-state-metrics' internal queues wil
202202

203203
In a 100 node cluster scaling test the latency numbers were as follows:
204204

205-
```
205+
```text
206206
"Perc50": 259615384 ns,
207207
"Perc90": 475000000 ns,
208208
"Perc99": 906666666 ns.
@@ -266,7 +266,7 @@ Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod
266266

267267
A daemonset kube-state-metrics example:
268268

269-
```
269+
```yaml
270270
apiVersion: apps/v1
271271
kind: DaemonSet
272272
spec:
@@ -288,7 +288,7 @@ spec:
288288
289289
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
290290

291-
```
291+
```yaml
292292
apiVersion: apps/v1
293293
kind: Deployment
294294
spec:
@@ -308,7 +308,7 @@ Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
308308

309309
Install this project to your `$GOPATH` using `go get`:
310310

311-
```
311+
```bash
312312
go get k8s.io/kube-state-metrics
313313
```
314314

@@ -317,7 +317,7 @@ go get k8s.io/kube-state-metrics
317317
Simply run the following command in this root folder, which will create a
318318
self-contained, statically-linked binary and build a Docker image:
319319

320-
```
320+
```bash
321321
make container
322322
```
323323

@@ -340,7 +340,7 @@ To have Prometheus discover kube-state-metrics instances it is advised to create
340340

341341
**Note:** Google Kubernetes Engine (GKE) Users - GKE has strict role permissions that will prevent the kube-state-metrics roles and role bindings from being created. To work around this, you can give your GCP identity the cluster-admin role by running the following one-liner:
342342

343-
```
343+
```bash
344344
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')
345345
```
346346

@@ -415,14 +415,14 @@ When developing, test a metric dump against your local Kubernetes cluster by run
415415

416416
> Users can override the apiserver address in KUBE-CONFIG file with `--apiserver` command line.
417417

418-
```
418+
```bash
419419
go install
420420
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
421421
```
422422

423423
Then curl the metrics endpoint
424424

425-
```
425+
```bash
426426
curl localhost:8080/metrics
427427
```
428428

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Maintaining the release branches for older minor releases happens on a best effo
2424
* Only include user relevant changes
2525
* Entries in the [`CHANGELOG.md`](CHANGELOG.md) are meant to be in this order:
2626

27-
```
27+
```text
2828
[CHANGE]
2929
[FEATURE]
3030
[ENHANCEMENT]

docs/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ can be used to extend single metrics output.
7979
This example adds `label_release` to the set of default labels of the `kube_pod_status_ready` metric
8080
and allows you select or group the metrics by Helm release label:
8181

82-
```
82+
```promql
8383
kube_pod_status_ready * on (namespace, pod) group_left(label_release) kube_pod_labels
8484
```
8585

8686
Another useful example would be to query the memory usage of pods by its `phase`, such as `Running`:
8787

88-
```
88+
```promql
8989
sum(kube_pod_container_resource_requests{resource="memory"}) by (namespace, pod, node)
9090
* on (namespace, pod) group_left() (sum(kube_pod_status_phase{phase="Running"}) by (pod, namespace) == 1)
9191
```
@@ -108,7 +108,7 @@ The clients scraping the endpoint, need to use a token which can be provided by
108108

109109
A ClusterRole providing access like this:
110110

111-
```
111+
```yaml
112112
apiVersion: rbac.authorization.k8s.io/v1
113113
kind: ClusterRole
114114
metadata:
@@ -122,7 +122,7 @@ rules:
122122
123123
and a matching ClusterRoleBinding
124124
125-
```
125+
```yaml
126126
apiVersion: rbac.authorization.k8s.io/v1
127127
kind: ClusterRoleBinding
128128
metadata:
@@ -139,7 +139,7 @@ subjects:
139139
140140
Your client can then use either this ServiceAccount to gather metrics or you can create a token, that can be used to fetch data like this:
141141
142-
```
142+
```bash
143143
TOKEN=$(kubectl create token YOUR_SERVICE_ACCOUNT -n NAMESPACE_OF_THE_SERVICE_ACCOUNT)
144144
curl -H "Authorization: Bearer $TOKEN" KUBE_STATE_METRICS_URL:8080/metrics
145145
```

docs/design/metrics-store-performance-optimization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ properties in memory via the Kubernetes client-go cache, use a map, addressable
5858
by the Kubernetes object uuid, containing all time series of that object as a
5959
single multi-line string.
6060

61-
```
61+
```go
6262
var cache = map[uuid][]byte{}
6363
```
6464

@@ -76,7 +76,7 @@ On a scrape request on the /metrics endpoint, kube-state-metrics iterates over
7676
the cache map and concatenates all time series string blobs into a single
7777
string, which is finally passed on as a response.
7878

79-
```
79+
```text
8080
+---------------+ +-----------+ +---------------+ +-------------------+
8181
| pod_reflector | | pod_store | | pod_collector | | metrics_endpoint |
8282
+---------------+ +-----------+ +---------------+ +-------------------+
@@ -116,7 +116,7 @@ string, which is finally passed on as a response.
116116

117117
Build via [text-diagram](http://weidagang.github.io/text-diagram/)
118118

119-
```
119+
```text
120120
object pod_reflector pod_store pod_collector metrics_endpoint
121121
122122
note left of pod_reflector: new pod p1

docs/metrics/extend/customresourcestate-metrics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ kube_customresource_ref_info{customresource_group="myteam.io", customresource_ki
269269

270270
For example in VPA we have above attributes and we want to have a same metrics for both CPU and Memory, you can use below config:
271271

272-
```
272+
```yaml
273273
kind: CustomResourceStateMetrics
274274
spec:
275275
resources:

0 commit comments

Comments
 (0)