-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metricbeat]kube-state-metrics: add storage class support (#16145)
* add ksm storage class support
- Loading branch information
Pablo Mercado
authored
Feb 10, 2020
1 parent
327b14d
commit 86434d6
Showing
21 changed files
with
402 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
metricbeat/docs/modules/kubernetes/state_storageclass.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// | ||
This file is generated! See scripts/mage/docs_collector.go | ||
//// | ||
|
||
[[metricbeat-metricset-kubernetes-state_storageclass]] | ||
=== Kubernetes state_storageclass metricset | ||
|
||
experimental[] | ||
|
||
include::../../../module/kubernetes/state_storageclass/_meta/docs.asciidoc[] | ||
|
||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-kubernetes,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../module/kubernetes/state_storageclass/_meta/data.json[] | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Kube-state-metrics/StorageClass | ||
|
||
This metricset connects to kube-state-metrics endpoint to retrieve and report Storage Class metrics. | ||
|
||
Interestingly enough kube-state-metrics does not repport annotations, we are unable to inform which storage class is default. We can consider enriching adding that info, or contributing back to kube-state-metrics to add annotations. | ||
|
||
## Version history | ||
|
||
- February 2020, first release using kube-state-metrics `v1.8.0`. | ||
|
||
## Configuration | ||
|
||
See the metricset documentation for the configuration reference. | ||
|
||
## Manual testing | ||
|
||
Probably your kubernetes cluster already has a storage class. You can add extra SCs: | ||
|
||
Example: | ||
|
||
```bash | ||
kubectl apply -f - << EOF | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: beats-test-sc1 | ||
labels: | ||
testl1: value1 | ||
testl2: value2 | ||
provisioner: kubernetes.io/non-existing1 | ||
reclaimPolicy: Retain | ||
volumeBindingMode: WaitForFirstConsumer | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: beats-test-sc2 | ||
labels: | ||
testl3: value3 | ||
testl4: value4 | ||
provisioner: kubernetes.io/non-existing2 | ||
reclaimPolicy: Delete | ||
volumeBindingMode: Immediate | ||
EOF | ||
``` | ||
|
||
Then run metricbeat pointing to the kube-state-metrics endpoint. |
Oops, something went wrong.