Skip to content

Commit 2ab51c9

Browse files
Merge pull request #5 from brancz/new-openshift-master
Update fork to v1.5.0
2 parents 33f3388 + cb56b8f commit 2ab51c9

File tree

1,962 files changed

+189773
-98378
lines changed

Some content is hidden

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

1,962 files changed

+189773
-98378
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- This form is for bug reports and feature requests ONLY!
2+
3+
If you're looking for help check [KUBE-STATE-METRICS](https://github.com/kubernetes/kube-state-metrics) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).
4+
-->
5+
6+
**Is this a BUG REPORT or FEATURE REQUEST?**:
7+
8+
> Uncomment only one, leave it on its own line:
9+
>
10+
> /kind bug
11+
> /kind feature
12+
13+
14+
**What happened**:
15+
16+
**What you expected to happen**:
17+
18+
**How to reproduce it (as minimally and precisely as possible)**:
19+
20+
21+
**Anything else we need to know?**:
22+
23+
**Environment**:
24+
- Kubernetes version (use `kubectl version`):
25+
- Kube-state-metrics image version

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Thanks for sending a pull request! Here are some tips for you:
2+
1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide/pull-requests.md#the-pull-request-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
3+
2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
4+
3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/pull-requests.md#write-release-notes-if-needed
5+
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
6+
-->
7+
8+
**What this PR does / why we need it**:
9+
10+
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
11+
Fixes #
12+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
kube-state-metrics
2+
documented_metrics
3+
tested_metrics
24

35
# Created by https://www.gitignore.io/api/go
46

.travis.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@ sudo: required
22

33
language: go
44

5+
go:
6+
- "1.11.4"
7+
58
install:
69
- mkdir -p $HOME/gopath/src/k8s.io
710
- mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics
811

912
jobs:
1013
include:
11-
- stage: Go fmt
12-
script: make gofmtcheck
13-
- stage: Unit Test
14-
script: make test-unit
15-
- stage: Build
16-
script: make build
17-
- stage: Check that all metrics are documented
18-
script: make doccheck
19-
- stage: E2e
20-
script: make e2e
14+
# Go fmt
15+
- script: make gofmtcheck
16+
# Check that all metrics are documented
17+
- script: make doccheck
18+
# Unit Test
19+
- script: make test-unit
20+
# Build
21+
- script: make build
22+
# E2e
23+
- script: make e2e

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
## v1.5.0 / 2019-01-10
2+
3+
After a testing period of 30 days, there were no additional bugs found or features introduced. Due to no bugs being reported over an in total 41 days period, we feel no more pre-releases are necessary for a stable release.
4+
5+
This release's focus was a large architectural change in order to improve performance and resource usage of kube-state-metrics drastically. Special thanks to @mxinden for his hard work on this! See the changelog of the pre-releases for more detailed information and related pull requests.
6+
7+
An additional change has been requested to be listed in the release notes:
8+
9+
* [CHANGE] Due to removal of the surrounding mechanism the `ksm_resources_per_scrape` and `ksm_scrape_error_total` metrics no longer exists.
10+
11+
## v1.5.0-beta.0 / 2018-12-11
12+
13+
After a testing period of 11 days, there were no additional bugs found or features introduced.
14+
15+
## v1.5.0-alpha.0 / 2018-11-30
16+
17+
* [CHANGE] Disable gzip compression of kube-state-metrics responses by default. Can be re-enabled via `--enable-gzip-encoding`. See #563 for more details.
18+
* [FEATURE] Add `kube_replicaset_owner` metric (#520).
19+
* [FEATURE] Add `kube_pod_container_status_last_terminated_reason` metric (#535).
20+
* [FEATURE] Add `stateful_set_status.{current,update}_revision` metric (#545).
21+
* [FEATURE] Add pod disruption budget collector (#551).
22+
* [FEATURE] Make kube-state-metrics usable as a library (#575).
23+
* [FEATURE] Add `kube_service_spec_external_ip` metric and add `external_name` and `load_balancer_ip` label to `kube_service_info` metric (#571).
24+
* [ENHANCEMENT] Add uid info in `kube_pod_info` metric (#508).
25+
* [ENHANCEMENT] Update addon-resizer to 1.8.3 and increase resource limits (#552).
26+
* [ENHANCEMENT] Improve metric caching and rendering performance (#498).
27+
* [ENHANCEMENT] Adding CreateContainerConfigError as possible reason for container not starting (#578).
28+
29+
## v1.4.0 / 2018-08-22
30+
31+
After a testing period of 16 days, there were no additional bugs found or features introduced.
32+
33+
## v1.4.0-rc.0 / 2018-08-06
34+
35+
* [CHANGE] `kube_job_status_start_time` and `kube_job_status_completion_time` metric types changed from counter to gauge.
36+
* [CHANGE] `job` label to `job_name` as this collides with the Prometheus `job` label.
37+
* [FEATURE] Allow white- and black-listing metrics to be exposed.
38+
* [FEATURE] Add `kube_node_status_capacity` and `kube_node_status_allocatable` metrics.
39+
* [FEATURE] Add `kube_pod_status_scheduled_time` metric.
40+
* [FEATURE] Add `kube_pod_container_status_waiting_reason` and `kube_pod_container_status_terminated_reason` metrics.
41+
* [ENHANCEMENT] Add generic resource metrics for Pods, `kube_pod_container_resource_requests` and `kube_pod_container_resource_limits`. This deprecates the old resource metrics for Pods.
42+
* [ENHANCEMENT] Prefer protobuf over json when communicating with the Kubernetes API.
43+
* [ENHANCEMENT] Add dynamic volume support.
44+
* [ENHANCEMENT] Properly set kube-state-metrics user agent when performing requests against the Kubernetes API.
45+
* [BUGFIX] Fix incrorrect HPA metric labels.
46+
147
## v1.3.1 / 2018-04-12
248

349
* [BUGFIX] Use Go 1.10.1 fixing TLS and memory issues.
@@ -9,6 +55,10 @@ After a testing period of 12 days, there were no additional bugs found or featur
955

1056
## v1.3.0-rc.0 / 2018-03-23
1157

58+
* [CHANGE] Removed `--in-cluster` flag in [#371](https://github.com/kubernetes/kube-state-metrics/pull/371).
59+
Users can no longer specify `--apiserver` with `--in-cluster=true`. To
60+
emulate this behaviour in future releases, set the `KUBERNETES_SERVICE_HOST`
61+
environment variable to the value of the `--apiserver` argument.
1262
* [FEATURE] Allow to specify multiple namespace.
1363
* [FEATURE] Add `kube_pod_completion_time`, `kube_pod_spec_volumes_persistentvolumeclaims_info`, and `kube_pod_spec_volumes_persistentvolumeclaims_readonly` metrics to the Pod collector.
1464
* [FEATURE] Add `kube_node_spec_taint` metric.

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing Guidelines
2+
3+
Welcome to Kubernetes. We are excited about the prospect of you joining our [community](https://github.com/kubernetes/community)! The Kubernetes community abides by the CNCF [code of conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). Here is an excerpt:
4+
5+
_As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities._
6+
7+
## Getting Started
8+
9+
We have full documentation on how to get started contributing here:
10+
11+
<!---
12+
If your repo has certain guidelines for contribution, put them here ahead of the general k8s resources
13+
-->
14+
15+
- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
16+
- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
17+
- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet.md) - Common resources for existing developers
18+
19+
## Mentorship
20+
21+
- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
22+
23+
<!---
24+
Custom Information - if you're copying this template for the first time you can add custom content here, for example:
25+
26+
## Contact Information
27+
28+
- [Slack channel](https://kubernetes.slack.com/messages/kubernetes-users) - Replace `kubernetes-users` with your slack channel string, this will send users directly to your channel.
29+
- [Mailing list](URL)
30+
31+
-->

Documentation/README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@ This documentation is intended to be a complete reflection of the current state
44

55
Any contribution to improving this documentation or adding sample usages will be appreciated.
66

7+
## Table of Contents
8+
9+
- [Metrics Stages](#metrics-stages)
10+
- [Metrics Deprecation](#metrics-deprecation)
11+
- [Exposed Metrics](#exposed-metrics)
12+
- [Join Metrics](#join-metrics)
13+
14+
## Metrics Stages
15+
Stages about metrics are grouped into three categories:
16+
17+
| Stage | Description |
18+
| ----------- | ----------- |
19+
| EXPERIMENTAL | Metrics which are normally corresponds to Kubernetes API object alpha status or spec fields and can be changed at any time. |
20+
| STABLE | Metrics which should be very few backwards-incompatible changes outside of major version updates. |
21+
| DEPRECATED | Metrics which will be removed once the deprecation timeline is met. |
22+
23+
## Metrics Deprecation
24+
* **The following non-generic resource metrics for pods are marked deprecated. They will be removed in kube-state-metrics v2.0.0.**
25+
`kube_pod_container_resource_requests` and `kube_pod_container_resource_limits` are the replacements with `resource` labels
26+
representing the resource name and `unit` labels representing the resource unit.
27+
* kube_pod_container_resource_requests_cpu_cores
28+
* kube_pod_container_resource_limits_cpu_cores
29+
* kube_pod_container_resource_requests_memory_bytes
30+
* kube_pod_container_resource_limits_memory_bytes
31+
* **The following non-generic resource metrics for nodes are marked deprecated. They will be removed in kube-state-metrics v2.0.0.**
32+
`kube_node_status_capacity` and `kube_node_status_allocatable` are the replacements with `resource` labels
33+
representing the resource name and `unit` labels representing the resource unit.
34+
* kube_node_status_capacity_pods
35+
* kube_node_status_capacity_cpu_cores
36+
* kube_node_status_capacity_memory_bytes
37+
* kube_node_status_allocatable_pods
38+
* kube_node_status_allocatable_cpu_cores
39+
* kube_node_status_allocatable_memory_bytes
40+
41+
## Exposed Metrics
742
Per group of metrics there is one file for each metrics. See each file for specific documentation about the exposed metrics:
843

944
* [CronJob Metrics](cronjob-metrics.md)
@@ -15,6 +50,7 @@ Per group of metrics there is one file for each metrics. See each file for speci
1550
* [PersistentVolume Metrics](persistentvolume-metrics.md)
1651
* [PersistentVolumeClaim Metrics](persistentvolumeclaim-metrics.md)
1752
* [Pod Metrics](pod-metrics.md)
53+
* [Pod Disruption Budget Metrics](poddisruptionbudget-metrics.md)
1854
* [ReplicaSet Metrics](replicaset-metrics.md)
1955
* [ReplicationController Metrics](replicationcontroller-metrics.md)
2056
* [ResourceQuota Metrics](resourcequota-metrics.md)
@@ -24,4 +60,17 @@ Per group of metrics there is one file for each metrics. See each file for speci
2460
* [Horizontal Pod Autoscaler Metrics](horizontalpodautoscaler-metrics.md)
2561
* [Endpoint Metrics](endpoint-metrics.md)
2662
* [Secret Metrics](secret-metrics.md)
27-
* [ConfigMap Metrics](configmap-metrics.md)
63+
* [ConfigMap Metrics](configmap-metrics.md)
64+
65+
66+
## Join Metrics
67+
When an additional, not provided by default label is needed, a [Prometheus matching operator](https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching)
68+
can be used to extend single metrics output.
69+
70+
This example adds `label_release` to the set of default labels of the `kube_pod_status_ready` metric
71+
and allows you select or group the metrics by helm release label:
72+
73+
```
74+
kube_pod_status_ready * on (namespace, pod) group_left(label_release) kube_pod_labels
75+
```
76+

Documentation/configmap-metrics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ConfigMap Metrics
22

3-
| Metric name| Metric type | Labels/tags |
4-
| ---------- | ----------- | ----------- |
5-
| kube_configmap_info | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; |
6-
| kube_configmap_created | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; |
7-
| kube_configmap_metadata_resource_version | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; <br> `resource_version`=&lt;secret-resource-version&gt; |
3+
| Metric name| Metric type | Labels/tags | Status |
4+
| ---------- | ----------- | ----------- | ----------- |
5+
| kube_configmap_info | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | STABLE |
6+
| kube_configmap_created | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; | STABLE |
7+
| kube_configmap_metadata_resource_version | Gauge | `configmap`=&lt;configmap-name&gt; <br> `namespace`=&lt;configmap-namespace&gt; <br> `resource_version`=&lt;secret-resource-version&gt; | STABLE |

Documentation/cronjob-metrics.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# CronJob Metrics
22

3-
| Metric name| Metric type | Labels/tags |
4-
| ---------- | ----------- | ----------- |
5-
| kube_cronjob_info | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `schedule`=&lt;schedule&gt; <br> `concurrency_policy`=&lt;concurrency-policy&gt; |
6-
| kube_cronjob_labels | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `label_CRONJOB_LABEL`=&lt;CRONJOB_LABEL&gt; |
7-
| kube_cronjob_created | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; |
8-
| kube_cronjob_next_schedule_time | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; |
9-
| kube_cronjob_status_active | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; |
10-
| kube_cronjob_status_last_schedule_time | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; |
11-
| kube_cronjob_spec_suspend | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; |
12-
| kube_cronjob_spec_starting_deadline_seconds | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; |
3+
| Metric name| Metric type | Labels/tags | Status |
4+
| ---------- | ----------- | ----------- | ----------- |
5+
| kube_cronjob_info | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `schedule`=&lt;schedule&gt; <br> `concurrency_policy`=&lt;concurrency-policy&gt; | STABLE
6+
| kube_cronjob_labels | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; <br> `label_CRONJOB_LABEL`=&lt;CRONJOB_LABEL&gt; | STABLE
7+
| kube_cronjob_created | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
8+
| kube_cronjob_next_schedule_time | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
9+
| kube_cronjob_status_active | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
10+
| kube_cronjob_status_last_schedule_time | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
11+
| kube_cronjob_spec_suspend | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE
12+
| kube_cronjob_spec_starting_deadline_seconds | Gauge | `cronjob`=&lt;cronjob-name&gt; <br> `namespace`=&lt;cronjob-namespace&gt; | STABLE

Documentation/daemonset-metrics.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# DaemonSet Metrics
22

3-
| Metric name| Metric type | Labels/tags |
4-
| ---------- | ----------- | ----------- |
5-
| kube_daemonset_created | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
6-
| kube_daemonset_status_current_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
7-
| kube_daemonset_status_desired_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
8-
| kube_daemonset_status_number_available | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
9-
| kube_daemonset_status_number_misscheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
10-
| kube_daemonset_status_number_ready | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
11-
| kube_daemonset_status_number_unavailable | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
12-
| kube_daemonset_updated_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
13-
| kube_daemonset_metadata_generation | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; |
14-
| kube_daemonset_labels | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; <br> `label_DAEMONSET_LABEL`=&lt;DAEMONSET_LABEL&gt; |
3+
| Metric name| Metric type | Labels/tags | Status |
4+
| ---------- | ----------- | ----------- | ----------- |
5+
| kube_daemonset_created | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
6+
| kube_daemonset_status_current_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
7+
| kube_daemonset_status_desired_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
8+
| kube_daemonset_status_number_available | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
9+
| kube_daemonset_status_number_misscheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
10+
| kube_daemonset_status_number_ready | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
11+
| kube_daemonset_status_number_unavailable | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
12+
| kube_daemonset_updated_number_scheduled | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
13+
| kube_daemonset_metadata_generation | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; | STABLE |
14+
| kube_daemonset_labels | Gauge | `daemonset`=&lt;daemonset-name&gt; <br> `namespace`=&lt;daemonset-namespace&gt; <br> `label_DAEMONSET_LABEL`=&lt;DAEMONSET_LABEL&gt; | STABLE |

0 commit comments

Comments
 (0)