Commit Graph

155 Commits

Author SHA1 Message Date
Frederic Branczyk 994772a2e4
*: Generate all manifests
Sharding and autosharding introduced a number of manifests that are
very similar, but not identical to the standard manifests. This
introduces generating all manifests using jsonnet and moves them to
the explicit `/examples` directory.
2019-10-02 10:35:06 +02:00
YaoZengzeng d283147719 [e2e] lint the metrics of ksm
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
2019-09-30 17:17:28 +08:00
YaoZengzeng 126b63377b framework for e2e test implemented in golang
Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
2019-09-25 09:12:31 +08:00
Philip Gough bdbff48012
Add support for Darwin OS in e2e test 2019-09-10 13:53:05 +01:00
Frederic Branczyk f3d41de450
Add auto detecting of sharding
main_test.go: Add model based test for sharding

In order to ensure a sharded system behaves equal to an unsharded
system, a model based test has been introduced. It scrapes an unsharded
setup and compares its output with the union of a sharded setup
therefore ensuring semantic equality.
2019-08-30 22:45:35 +02:00
Frederic Branczyk 84d61f9a93
Introduce sharding 2019-08-30 13:51:30 +02:00
Manuel Rüger 8a96896eaf tests/e2e.sh: Bump Prometheus to 1.12.0, Kubernetes to 1.15.3
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2019-08-26 19:17:39 +02:00
Tariq Ibrahim 1b42e7c450
lint: enforce goimports local prefixes 2019-08-20 10:33:05 -07:00
Tariq Ibrahim 96eefd08f6
chore: update dependencies and tool versions 2019-08-16 20:27:21 -07:00
Frederic Branczyk 4be05a0e62
tests/e2e.sh: Bump minikube, Kubernetes, Prometheus versions 2019-07-22 20:03:30 -07:00
tariqibrahim 44319dbb0d vendor: remove unnecessary dependencies from the project. 2019-07-21 14:59:22 -07:00
Lili Cosic de1996280f Address PR comments 2019-07-12 13:47:00 +02:00
Lili Cosic a6491a7737 tests/e2e.sh: Check for errors in the logs
kube-state-metrics does not terminate the pod on errors, so to actually
detect the errors in CI, we are adding this check by grepping for errors
in the kube-state-metrics logs.

This makes the assumption that any errors that are present in logs start
wtih the string 'E<MONTHDAY>' (e.g.: 'E0711') as this is how klog starts
all error log lines.
2019-07-12 13:27:01 +02:00
Lili Cosic ec29426150 *: Remove reference to removed APIs 2019-06-26 19:17:51 +02:00
Miles Bryant 67ef5ecc9c
store: add verticalpodautoscaler metrics 2019-06-20 12:24:37 +01:00
Reeta Singh ae6a7a36b4 updating version for CI tools 2019-06-17 23:27:24 -07:00
Lili Cosic 68aea02d26 Makefile,internal/collector: Rename collector -> store
Since the removal of collector, this introduces both the concept of the
store and the resources instead of collectors that the user passes in.

The user facing logs and flags were not changed as that would be a
regression.
2019-06-11 16:18:53 +02:00
Lili Cosic cbb7762dc5 *: Remove collector package
collector package was an unnecessary wrapper. This replaces the
.Collect with a call to Store.WriteAll every time a collect is needed.
2019-06-11 16:18:52 +02:00
xieyanker c18dfa26cf Add Metrics About StorageClass 2019-06-05 11:32:54 +08:00
Tariq Ibrahim 9bcb1959a5
return standardized test for health endpoint 2019-05-24 09:51:04 -07:00
Patrick Decat cf626e5486 kube-state-metrics-resizer role is no longer needed as addon-resizer was removed in https://github.com/kubernetes/kube-state-metrics/pull/750 2019-05-15 10:07:34 +02:00
Tariq Ibrahim 018d3c831f
chore: bump versions of prometheus, golangci, and minikube 2019-05-09 22:21:43 -07:00
Tariq Ibrahim e084d5a2da bump versions of prometheus,kubernetes, and addon-resizer 2019-04-18 09:47:22 -07:00
Kubernetes Prow Robot 5bcff06a35
Merge pull request #723 from kubernetes/release-1.6
PR #720 into master
2019-04-18 08:56:09 -07:00
Tariq Ibrahim 6131a2834a use appsv1 apigroup for StatefulSets and DaemonSets 2019-04-18 01:50:51 -07:00
Andy Xie 5c4b6f4a28 use xenial dist in travis ci 2019-04-16 17:32:34 +08:00
Max Leonard Inden bbb1dca85d
pkg/metrics_store: Cache byte slices instead of strings
When converting a string to a byte slice, in Golang would do a full copy
which introduces memory allocations. On an HTTP scrape request WriteAll
in the metrics store component is called, which writes all cached
metrics into the given io.Writer. io.Writer takes a byte slice, whereas
metrics are cached as strings. The connect the two, the metrics store
component converts the metric strings to byte slices. This results in
`runtime.stringtoslicebyte` [1] being a prominent CPU user.

Instead of caching metrics as strings, cache them as byte slices,
removing the additional translation from the hot-path.

[1] https://golang.org/src/runtime/string.go?s=4063:4115#L145
2019-04-05 12:34:22 +02:00
Haoran Wang 6793b6881d Add collector for csr 2019-03-21 09:03:42 +08:00
tariqibrahim d34c6dc785 lint: add golangci-lint to the CI pipeline of kube-state-metrics 2019-03-04 10:13:18 -08:00
tariqibrahim caa156f194 improve the variable name of the kube state metrics image tag in e2e shell script 2019-02-28 07:40:31 -08:00
tariqibrahim 1d4c741f84 use klog instead of glog 2019-02-19 20:03:04 -08:00
tariqibrahim f86fab2e17 add shellcheck to the ci and perform minor cleanup of bash scripts in kube_state_metrics 2019-02-11 11:29:32 -08:00
Raphael Deem 4313eedf6c add an ingress test file 2019-02-05 15:08:17 -08:00
Max Leonard Inden 98502e8a7a
tests: Add benchmark compare script and include in CI
Add a script that runs all benchmark tests on the current git ref and
the last release and add it to the Makefile and .travis.yml file.
2019-01-28 18:28:15 +01:00
Max Leonard Inden 6b1ed0bec9
Deduplicate metric name
Instead of defining the metric name both in the metric family generator
as well as the metric itself, with this patch the metric name is
injected into the metric family by the metric family generator.
2019-01-25 17:11:47 +01:00
Kubernetes Prow Robot 1148e8b360
Merge pull request #639 from LiliC/lili/travis-local
*: Set e2e test env variables in .travis.yaml
2019-01-24 07:30:25 -08:00
Lili Cosic b141f4b92c *: Set e2e test env variables in .travis.yaml
If you run the make target for e2e tests locally this will by default
presume you are running in CI and reinstall minikube, etc.
2019-01-24 16:12:10 +01:00
Lili Cosic 3498aa7e9e *: Move collectors pkg to internal directory
This makes the rest of the packages useful to be used in a standalone
library without importing the kube-state-metrics specific collectors.

* Rename collectors -> collector package

* Rename metrics -> metric package

* Add metricFamily mocking in tests to prevent cyclic dependency.
2019-01-23 10:51:30 +01:00
Max Leonard Inden 0afbae121d
tests: Add check-license script 2019-01-22 11:41:17 +01:00
Max Leonard Inden 86ebc5618c
tests: Add stability notice to lib pkg 2018-11-30 17:09:06 +01:00
Max Leonard Inden 50c443fd70
*: Reintroduce TYPE text 2018-11-29 15:43:58 +01:00
Max Leonard Inden 665e922477
*: Adjust tests
- Split main benchmark test

- Add main smoke test
2018-11-29 15:43:41 +01:00
Max Leonard Inden 0386929903
pkg/collectors: Encapsulate repeated logic per collector 2018-11-29 15:43:41 +01:00
Max Leonard Inden d1444f8061
pkg/metrics_store: Accept Writer instead of returning metrics on scrape 2018-11-29 15:43:40 +01:00
Max Leonard Inden 581c49d593
pkg/collectors: Reintroduce help text 2018-11-29 15:43:39 +01:00
mooncake a2a69ede37 Fix typos: cleaup -> cleanup
Signed-off-by: mooncake <xcoder@tenxcloud.com>
2018-11-11 00:03:36 +08:00
Lili Cosic 5a8b86b1c7 tests: Add test to test k-s-m as a standalone library
With the different pieces being exposed, this test ensures that k-s-m
can be used as a standalone library.

Co-authored-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-02 14:08:39 +01:00
Lili Cosic e05e244e4f test/e2e.sh: Exclude utils.go from metrics check 2018-11-02 10:08:37 +01:00
Greg Lyons 40f293dbde Add PodDisruptionBudget metrics 2018-10-17 15:23:32 -07:00
Max Leonard Inden 234d788a0d
*: Optimize performance & resource utilization via custom metrics store
This patch introduces a custom client go store, MetricsStore. It is
updated by a corresponding reflector. Instead of generating the
Prometheus custom metrics on demand, metrics are generated on new
Kubernetes object arrival.

In addition this patch replaces most of the logic of the Prometheus
client_golang package by its optimized custom logic to render metrics in
text format.

Next to these main changes this patch also includes:

- Documentation/design: Add performance optimization proposal
- tests/e2e.sh: Ignore "no help text" warnings by promtool
- .travis.yml: Run tests in parallel
  As non of the Travis tests depend on each other, there is no reason to
  run them in sequence. Instead this patch makes them run in parallel.
2018-10-16 15:49:16 +02:00
Andy Xie bcb230560f bump kubernetes to 1.11 2018-07-03 01:10:57 +08:00
Andy Xie fef896fa62 refactor to toward kubernetes way 2018-04-27 22:23:12 +08:00
Andy Xie 809120ecaf add support for quay latest image tag 2018-04-27 17:46:05 +08:00
Yecheng Fu 6ce5aed600 Descend at most 1 level. 2018-04-18 15:58:49 +08:00
Tomas Dohnalek ae6e25d728
Extended e2e tests.
* Refactored kube_job_status_start_time & kube_job_status_completion_time to Gauge.
 * e2e script moved to tests directory.
 * Added options for e2e testsuite.
 * Cleanun function in e2e.
2018-04-12 18:10:18 +02:00