Skip to content

Commit ea8a7f8

Browse files
authored
Merge pull request #2358 from ovidiutirla/reorg-docs
docs: reorganize documentation directory structure
2 parents 2089503 + 071c523 commit ea8a7f8

Some content is hidden

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

43 files changed

+128
-128
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ doccheck: generate validate-template
5454
@echo "- Checking if the generated documentation is up to date..."
5555
@git diff --exit-code
5656
@echo "- Checking if the documentation is in sync with the code..."
57-
@grep -hoE -d skip '\| kube_[^ |]+' docs/* --exclude=README.md | sed -E 's/\| //g' | sort -u > documented_metrics
57+
@grep -rhoE '\| kube_[^ |]+' docs/metrics/* --exclude=README.md | sed -E 's/\| //g' | sort -u > documented_metrics
5858
@find internal/store -type f -not -name '*_test.go' -exec sed -nE 's/.*"(kube_[^"]+)".*/\1/p' {} \; | sort -u > code_metrics
5959
@diff -u0 code_metrics documented_metrics || (echo "ERROR: Metrics with - are present in code but missing in documentation, metrics with + are documented but not found in code."; exit 1)
6060
@echo OK
6161
@rm -f code_metrics documented_metrics
6262
@echo "- Checking for orphan documentation files"
63-
@cd docs; for doc in *.md; do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
63+
@cd docs; for doc in $$(find metrics/* -name '*.md' | sed 's/.*\///'); do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
6464
@echo OK
6565

6666
build-local:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ In a 100 node cluster scaling test the latency numbers were as follows:
204204

205205
### A note on costing
206206

207-
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
207+
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/developer/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
208208

209209
### kube-state-metrics vs. metrics-server
210210

@@ -387,7 +387,7 @@ spec:
387387
- '--namespaces=project1'
388388
```
389389

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

392392
#### Helm Chart
393393

README.md.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ In a 100 node cluster scaling test the latency numbers were as follows:
205205

206206
### A note on costing
207207

208-
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
208+
By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to [configure what metrics you'd like to expose](docs/developer/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
209209

210210
### kube-state-metrics vs. metrics-server
211211

@@ -388,7 +388,7 @@ spec:
388388
- '--namespaces=project1'
389389
```
390390

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

393393
#### Helm Chart
394394

docs/README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,44 +32,44 @@ See each file for specific documentation about the exposed metrics:
3232

3333
### Default Resources
3434

35-
* [CertificateSigningRequest Metrics](certificatesigningrequest-metrics.md)
36-
* [ConfigMap Metrics](configmap-metrics.md)
37-
* [CronJob Metrics](cronjob-metrics.md)
38-
* [DaemonSet Metrics](daemonset-metrics.md)
39-
* [Deployment Metrics](deployment-metrics.md)
40-
* [Endpoint Metrics](endpoint-metrics.md)
41-
* [Horizontal Pod Autoscaler Metrics](horizontalpodautoscaler-metrics.md)
42-
* [Ingress Metrics](ingress-metrics.md)
43-
* [Job Metrics](job-metrics.md)
44-
* [Lease Metrics](lease-metrics.md)
45-
* [LimitRange Metrics](limitrange-metrics.md)
46-
* [MutatingWebhookConfiguration Metrics](mutatingwebhookconfiguration-metrics.md)
47-
* [Namespace Metrics](namespace-metrics.md)
48-
* [NetworkPolicy Metrics](networkpolicy-metrics.md)
49-
* [Node Metrics](node-metrics.md)
50-
* [PersistentVolume Metrics](persistentvolume-metrics.md)
51-
* [PersistentVolumeClaim Metrics](persistentvolumeclaim-metrics.md)
52-
* [Pod Disruption Budget Metrics](poddisruptionbudget-metrics.md)
53-
* [Pod Metrics](pod-metrics.md)
54-
* [ReplicaSet Metrics](replicaset-metrics.md)
55-
* [ReplicationController Metrics](replicationcontroller-metrics.md)
56-
* [ResourceQuota Metrics](resourcequota-metrics.md)
57-
* [Secret Metrics](secret-metrics.md)
58-
* [Service Metrics](service-metrics.md)
59-
* [StatefulSet Metrics](statefulset-metrics.md)
60-
* [StorageClass Metrics](storageclass-metrics.md)
61-
* [ValidatingWebhookConfiguration Metrics](validatingwebhookconfiguration-metrics.md)
62-
* [VolumeAttachment Metrics](volumeattachment-metrics.md)
35+
* [CertificateSigningRequest Metrics](metrics/auth/certificatesigningrequest-metrics.md)
36+
* [ConfigMap Metrics](metrics/storage/configmap-metrics.md)
37+
* [CronJob Metrics](metrics/workload/cronjob-metrics.md)
38+
* [DaemonSet Metrics](metrics/workload/daemonset-metrics.md)
39+
* [Deployment Metrics](metrics/workload/deployment-metrics.md)
40+
* [Endpoint Metrics](metrics/service/endpoint-metrics.md)
41+
* [Horizontal Pod Autoscaler Metrics](metrics/workload/horizontalpodautoscaler-metrics.md)
42+
* [Ingress Metrics](metrics/service/ingress-metrics.md)
43+
* [Job Metrics](metrics/workload/job-metrics.md)
44+
* [Lease Metrics](metrics/cluster/lease-metrics.md)
45+
* [LimitRange Metrics](metrics/policy/limitrange-metrics.md)
46+
* [MutatingWebhookConfiguration Metrics](metrics/extend/mutatingwebhookconfiguration-metrics.md)
47+
* [Namespace Metrics](metrics/cluster/namespace-metrics.md)
48+
* [NetworkPolicy Metrics](metrics/policy/networkpolicy-metrics.md)
49+
* [Node Metrics](metrics/cluster/node-metrics.md)
50+
* [PersistentVolume Metrics](metrics/storage/persistentvolume-metrics.md)
51+
* [PersistentVolumeClaim Metrics](metrics/storage/persistentvolumeclaim-metrics.md)
52+
* [Pod Disruption Budget Metrics](metrics/policy/poddisruptionbudget-metrics.md)
53+
* [Pod Metrics](metrics/workload/pod-metrics.md)
54+
* [ReplicaSet Metrics](metrics/workload/replicaset-metrics.md)
55+
* [ReplicationController Metrics](metrics/workload/replicationcontroller-metrics.md)
56+
* [ResourceQuota Metrics](metrics/policy/resourcequota-metrics.md)
57+
* [Secret Metrics](metrics/storage/secret-metrics.md)
58+
* [Service Metrics](metrics/service/service-metrics.md)
59+
* [StatefulSet Metrics](metrics/workload/statefulset-metrics.md)
60+
* [StorageClass Metrics](metrics/storage/storageclass-metrics.md)
61+
* [ValidatingWebhookConfiguration Metrics](metrics/extend/validatingwebhookconfiguration-metrics.md)
62+
* [VolumeAttachment Metrics](metrics/storage/volumeattachment-metrics.md)
6363

6464
### Optional Resources
6565

66-
* [ClusterRole Metrics](clusterrole-metrics.md)
67-
* [ClusterRoleBinding Metrics](clusterrolebinding-metrics.md)
68-
* [EndpointSlice Metrics](endpointslice-metrics.md)
69-
* [IngressClass Metrics](ingressclass-metrics.md)
70-
* [Role Metrics](role-metrics.md)
71-
* [RoleBinding Metrics](rolebinding-metrics.md)
72-
* [ServiceAccount Metrics](serviceaccount-metrics.md)
66+
* [ClusterRole Metrics](metrics/cluster/clusterrole-metrics.md)
67+
* [ClusterRoleBinding Metrics](metrics/cluster/clusterrolebinding-metrics.md)
68+
* [EndpointSlice Metrics](metrics/service/endpointslice-metrics.md)
69+
* [IngressClass Metrics](metrics/service/ingressclass-metrics.md)
70+
* [Role Metrics](metrics/auth/role-metrics.md)
71+
* [RoleBinding Metrics](metrics/auth/rolebinding-metrics.md)
72+
* [ServiceAccount Metrics](metrics/auth/serviceaccount-metrics.md)
7373

7474
## Join Metrics
7575

@@ -92,8 +92,8 @@ sum(kube_pod_container_resource_requests{resource="memory"}) by (namespace, pod,
9292

9393
## Metrics from Custom Resources
9494

95-
See [Custom Resource State Metrics](customresourcestate-metrics.md) for experimental support for custom resources.
95+
See [Custom Resource State Metrics](metrics/extend/customresourcestate-metrics.md) for experimental support for custom resources.
9696

9797
## CLI Arguments
9898

99-
Additionally, options for `kube-state-metrics` can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: [CLI Arguments](cli-arguments.md)
99+
Additionally, options for `kube-state-metrics` can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: [CLI Arguments](developer/cli-arguments.md)

docs/cli-arguments.md renamed to docs/developer/cli-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
2424
<!-- markdownlint-disable blanks-around-fences -->
2525
<!-- markdownlint-disable link-image-reference-definitions -->
26-
[embedmd]:# (../help.txt)
26+
[embedmd]:# (../../help.txt)
2727
```txt
2828
$ kube-state-metrics -h
2929
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.

docs/developer/guide.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Any contribution to improving this documentation will be appreciated.
1212

1313
The following steps are needed to introduce a new resource and its respective resource metrics.
1414

15-
* Reference your new resource(s) to the [docs/README.md](https://github.com/kubernetes/kube-state-metrics/blob/main/docs/README.md#exposed-metrics).
16-
* Reference your new resource(s) in the [docs/cli-arguments.md](https://github.com/kubernetes/kube-state-metrics/blob/main/docs/cli-arguments.md#available-options) as part of the `--resources` flag.
17-
* Create a new `<name-of-resource>.md` in the [docs](https://github.com/kubernetes/kube-state-metrics/tree/main/docs) directory to provide documentation on the resource(s) and metrics you implemented. Follow the formatting of all other resources.
18-
* Add the resource(s) you are representing to the [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](https://github.com/kubernetes/kube-state-metrics/blob/main/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet) under the appropriate `apiGroup` using the `verbs`: `list` and `watch`.
19-
* Run `make examples/standard`, this should re-generate [examples/standard/cluster-role.yaml](https://github.com/kubernetes/kube-state-metrics/blob/main/examples/standard/cluster-role.yaml) with the resource(s) added to [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](https://github.com/kubernetes/kube-state-metrics/blob/main/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet).
20-
* Reference and add build functions for the new resource(s) in [internal/store/builder.go](https://github.com/kubernetes/kube-state-metrics/blob/main/internal/store/builder.go).
21-
* Reference the new resource in [pkg/options/resource.go](https://github.com/kubernetes/kube-state-metrics/blob/main/pkg/options/resource.go).
22-
* Add a sample Kubernetes manifest to be used by tests in the [tests/manifests/](https://github.com/kubernetes/kube-state-metrics/tree/main/tests/manifests) directory.
23-
* Lastly, and most importantly, actually implement your new resource(s) and its test binary in [internal/store](https://github.com/kubernetes/kube-state-metrics/tree/main/internal/store). Follow the formatting and structure of other resources.
15+
* Reference your new resource(s) to the [docs/README.md](./../README.md#exposed-metrics).
16+
* Reference your new resource(s) in the [docs/developer/cli-arguments.md](./cli-arguments.md#available-options) as part of the `--resources` flag.
17+
* Create a new `<name-of-resource>.md` in the [docs](./../docs) directory to provide documentation on the resource(s) and metrics you implemented. Follow the formatting of all other resources.
18+
* Add the resource(s) you are representing to the [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](./../../jsonnet/kube-state-metrics/kube-state-metrics.libsonnet) under the appropriate `apiGroup` using the `verbs`: `list` and `watch`.
19+
* Run `make examples/standard`, this should re-generate [examples/standard/cluster-role.yaml](./../../examples/standard/cluster-role.yaml) with the resource(s) added to [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](./../../jsonnet/kube-state-metrics/kube-state-metrics.libsonnet).
20+
* Reference and add build functions for the new resource(s) in [internal/store/builder.go](./../../internal/store/builder.go).
21+
* Reference the new resource in [pkg/options/resource.go](./../../pkg/options/resource.go).
22+
* Add a sample Kubernetes manifest to be used by tests in the [tests/manifests/](./../../tests/manifests) directory.
23+
* Lastly, and most importantly, actually implement your new resource(s) and its test binary in [internal/store](./../../internal/store). Follow the formatting and structure of other resources.
2424

2525
### Add New Metrics
2626

docs/certificatesigningrequest-metrics.md renamed to docs/metrics/auth/certificatesigningrequest-metrics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
| Metric name | Metric type | Description | Labels/tags | Status |
44
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
5-
| kube_certificatesigningrequest_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](./cli-arguments.md) | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | EXPERIMENTAL |
5+
| kube_certificatesigningrequest_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | EXPERIMENTAL |
66
| kube_certificatesigningrequest_created | Gauge | | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |
77
| kube_certificatesigningrequest_condition | Gauge | | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; <br> `condition`=&lt;approved\|denied&gt; | STABLE |
8-
| kube_certificatesigningrequest_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](./cli-arguments.md) | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |
8+
| kube_certificatesigningrequest_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |
99
| kube_certificatesigningrequest_cert_length | Gauge | | `certificatesigningrequest`=&lt;certificatesigningrequest-name&gt; <br> `signer_name`=&lt;certificatesigningrequest-signer-name&gt; | STABLE |

docs/role-metrics.md renamed to docs/metrics/auth/role-metrics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
| Metric name | Metric type | Description | Labels/tags | Status |
44
| ----------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------------ |
5-
| kube_role_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](./cli-arguments.md) | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
6-
| kube_role_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](./cli-arguments.md) | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
5+
| kube_role_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
6+
| kube_role_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
77
| kube_role_info | Gauge | | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
88
| kube_role_created | Gauge | | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |
99
| kube_role_metadata_resource_version | Gauge | | `role`=&lt;role-name&gt; <br> `namespace`=&lt;role-namespace&gt; | EXPERIMENTAL |

0 commit comments

Comments
 (0)