Commit graph

60 commits

Author SHA1 Message Date
huxiaoliang
045baab990 Fix license issue
fix issue #54
2018-03-15 17:31:27 +08:00
Solly Ross
df48f2aa63 Merge pull request #50 from DirectXMan12/infra/deploy-from-travis
[infra] automatically publish new images
2018-02-28 14:22:10 -05:00
Solly Ross
d192346039 [infra] automatically publish new images
This tags new images every commit (via Travis) as latest, and every
tag gets pushed as a separate tag as well.
2018-02-28 14:22:09 -05:00
Solly Ross
42e839ece7
Merge pull request #47 from aschepis/patch-1
[docs] Fix serving cert path config in deployment spec
2018-02-22 14:28:33 -05:00
Solly Ross
cfe8f36c37
Merge pull request #49 from aschepis/patch-2
[docs] Add missing `create` on api registration
2018-02-22 14:26:30 -05:00
Adam Schepis
66527c6c6b
Add missing create on api registration
when creating the custom APIService the example was missing the `create` portion of the `kubectl` command.
2018-02-22 09:23:32 -05:00
Adam Schepis
6e4d4a4a93
Fix serving cert path config in deployment spec
The volume was mounted at `/var/run/serving/certs` but the container was sending an arg to look at `/var/run/serving-cert` (missing the trailing `s`)
2018-02-21 18:19:24 -05:00
Solly Ross
b9e8dd74bf
Merge pull request #44 from DirectXMan12/docs/update-walkthrough-1.10
[docs] update to v1.9 API versions
2018-02-13 13:25:46 -05:00
Solly Ross
f05ee274c8 [deploy] update types to Kube 1.9 versions
This commit updates the deploy YAML files to the Kubernetes 1.9 API
versions.
2018-02-13 13:25:13 -05:00
Solly Ross
79f9248ded [docs] update to v1.9 API versions
This updates the README and walkthrough to use v1.9 API versions,
and to use Prometheus v2.
2018-02-13 13:16:14 -05:00
Solly Ross
61b071c186
Merge pull request #41 from DirectXMan12/feature/label-prefixes
Allow setting a resource label prefix
2018-02-06 14:36:00 -05:00
Solly Ross
0fa0d36e17 Allow setting a resource label prefix
This allows setting a prefix on the labels used to determine which
resources a series belongs to.  The prefix may be set using the
`--label-prefix` flag.
2018-02-06 14:35:40 -05:00
Solly Ross
842b850fcd
Merge pull request #35 from parsifal-47/master
Add travis badge
2018-01-29 11:30:09 -05:00
Renat Idrisov
7c2a30f343 Add travis badge 2018-01-27 10:28:17 +01:00
Solly Ross
bb62d50490
Merge pull request #33 from vainu-arto/no_need_for_sudo
Use rm -rf instead of sudo when removing the temp dir
2018-01-24 10:46:31 -05:00
Arto Jantunen
0eddfe5e6d Use rm -rf instead of sudo when removing the temp dir 2018-01-23 13:35:02 +02:00
Solly Ross
c3ad5ef0ea
Merge pull request #25 from brancz/update-manifests
deploy: Update custom metrics API name and separate into files
2017-11-28 10:16:44 -08:00
Frederic Branczyk
80598a8bd3
deploy: Update custom metrics API name and separate into files 2017-11-13 09:54:35 +01:00
Solly Ross
8dd527d821 Merge pull request #23 from DirectXMan12/deps/kube-1.8
Update deps for Kubernetes 1.8
2017-10-11 15:48:13 -04:00
Solly Ross
43bd4798b5 Update deps for Kubernetes 1.8
This updates the dependencies to be compatible with Kubernetes 1.8,
including the new custom.metrics.k8s.io/v1beta1 API group and the
corresponding custom-metrics-apiserver changes.
2017-09-28 17:10:11 -04:00
Solly Ross
cc94ef4068 Merge pull request #22 from DirectXMan12/docs/fix-details-typo
[docs] Minor walkthough fixes
2017-09-25 13:29:38 -04:00
Solly Ross
109ad80627 [docs] Minor walkthough fixes
This fixes a typo in the walkthrough with a missing `</details>` closing
tag, and clarifies that you'll need RBAC set up for delegation.
2017-09-25 13:26:27 -04:00
Solly Ross
f9a9893093 Merge pull request #20 from DirectXMan12/docs/walkthrough
[docs] Add walkthrough
2017-09-07 14:54:32 -04:00
Solly Ross
4e99936e4f [docs] Add walkthrough
This adds a walkthrough to the docs covering setting up Prometheus and
the adapter, as well as autoscaling a sample application on custom
metrics.
2017-09-07 14:53:37 -04:00
Solly Ross
b6602e1724 Merge pull request #15 from DirectXMan12/refactor/update-todos
Cleanups from initial development
2017-08-04 15:14:59 -04:00
Solly Ross
58a9769eaa Refactor to remove duplicate code from boilerplate
This commit switches to using the boilerplate versions of
a couple different utilities, including the metric info normalization
and the common error types.
2017-08-02 15:48:12 -04:00
Solly Ross
8e5cb77e7f Use periodically updating RESTMapper
Currently, we fetch the discovery information once at the start of
of the adapter, and then never update it.  This could prove problematic,
since other API servers might come only after the adapter is started up.

The boilerplate contains a periodically updating RESTMapper that solves
this issue by refreshing the discovery information at an interval (as
specified by a flag), so that we have a chance to fetch new resources.
2017-08-02 15:25:48 -04:00
Solly Ross
703e9ecf09 Use new kubenetes-incubator version of boilerplate
The boilerplate moved to
github.com/kuberntes-incubator/custom-metrics-apiserver, so we should
use that now.
2017-08-02 15:23:03 -04:00
Solly Ross
766cd07c3a Link to luxas's demo
luxas has an excellent demo up, tying everything together.  This adds a
link (with a brief description) to that demo repo.
2017-08-02 15:22:42 -04:00
Solly Ross
5f963b6a02 Merge pull request #17 from luxas/add_dockerized_vendor
add option to fetch vendor dockerized
2017-07-06 14:19:24 -04:00
Lucas Käldström
bc8fd52523
add option to fetch vendor dockerized 2017-07-06 14:31:32 +03:00
Solly Ross
c912e1e3be Return proper errors from provider
All errors returned by the provider should be proper Kube API status
errors.  This commit cleans up a couple spots that either returned an
invalid error, or were missing an error (such as the case in when no
results matched the requested object).
2017-06-27 20:18:37 -04:00
Solly Ross
696fe9015a Clean up minor TODOs
This commit cleans up some TODOs where were done or no longer
applicable, and fixes a couple other minor TODOs, such as returning
proper errors.
2017-06-27 20:13:17 -04:00
Solly Ross
823b8051c9 Continue on error when processing series
Previously, if we encountered an error while trying to update our series
list, we'd return an error, aborting the processing of the entire batch.
This could lead to the list of available metrics being severely out of
date.  Instead, we simply log an error when we fail to process a metric
name, and skip it.
2017-06-27 20:13:17 -04:00
Solly Ross
01755d5acb Extract timeout from context in Prom client
For vector and range queries, the Prometheus HTTP API takes a timeout
parameter.  Previously, we ignored this parameter.  Now, we check to see
if the context passed to the query contains a deadline, and if so,
compare that to the current time to calculate an appropriate timeout for
query evaulation.
2017-06-27 20:13:16 -04:00
Solly Ross
d1d60f7f5e Have provider constructor take a stop channel
This causes the Prometheus provider to take a stop channel as an
argument, which allows us to stop the lister (which keeps the series list
up to date) in the unit tests.
2017-06-27 20:11:02 -04:00
Solly Ross
895183e503 Merge pull request #14 from DirectXMan12/build/initial-travis-setup
[build] set up Travis CI to run the unit tests
2017-06-27 19:07:18 -04:00
Solly Ross
756ff0941e gofmt all files
Some of the files were not appropriately formatted.  Now that we run
`verify` in Travis, these'll need to be.
2017-06-27 19:01:39 -04:00
Solly Ross
417f5a9f99 [build] Add gofmt-related Makefile targets
This adds `verify-gofmt` and `gofmt` make targets for quick go-fmting.
It also adds a `verify` target which verifies `gofmt` and the runs the
unit tests.

Travis now runs `make verify` instead of just `make test` as the tests.
2017-06-27 19:01:39 -04:00
Solly Ross
bbf23f18d0 Fix out-of-date unit tests
Several of the unit tests were out of date with the interface or type
definitions.  Now that we're running CI, they need to be up to date
(they should have been anyway, but that's a different story).
2017-06-27 19:01:39 -04:00
Solly Ross
c1b9a7faab Use special client-go for fake dynamic client
Until kubernetes/kubernetes#45431 merges, we have to use a special
version of client go (at
https://github.com/DirectXMan12/client-go/tree/feature/fake-dynamic-client)
in order to actually run our tests.  When the above PR merges, we should
revert these changes.
2017-06-27 19:01:38 -04:00
Solly Ross
349128f5a5 [build] set up Travis CI to run the unit tests
This commit sets up Travis CI to run the unit tests.
It installs glide, initializes the vendor directory,
and then runs `make test`.
2017-06-27 16:49:19 -04:00
Solly Ross
2ef3de3434 Merge pull request #9 from luxas/new_demo
Add RBAC and API Aggregation rules to example manifest
2017-06-27 15:47:44 -04:00
Solly Ross
78d9749971 Merge pull request #10 from DirectXMan12/refactor/glide-makefile-tweaks
Makefile Tweaks
2017-06-27 11:08:33 -04:00
Solly Ross
d46c73ae6f [build] mark phony targets as such
This commit marks the phony targets in the Makefile as phony, following
good Makefile practices (for example, so we don't have have issues with
someone creating a file with a matching name in the future, etc).
2017-06-27 11:07:35 -04:00
Solly Ross
88b3531ef5 [build] add a test target
This commit adds a target for running `go test`.
2017-06-27 11:07:34 -04:00
Solly Ross
91bc1dcd71 [build] cause all to trigger build
This commit causes the `all` Makefile rule to trigger `build` instead
of `docker-build`.  This allows people with convoluted setups that
involve `go build`-ing and `docker build`-ing on different machines (like
@directxman12) to not complain as much.
2017-06-26 16:27:53 -04:00
Solly Ross
a723582f58 [build] add make rule for vendor
This commit adds a Makefile rule for installing the vendor directory.
Both the `build` and `docker-build` phony rules depend on the `vendor`
rule, which in turn depends on the `glide.lock` rule.  This means that
any time the `glide.lock` file is updated, the vendor directory will be
re-installed.
2017-06-26 16:27:53 -04:00
Solly Ross
3618aafca4 [build] fix build makefile target path
The `build` Makefile target attempted to place the generated artifact in
`/build`, where it should have used a local directory instead.  This
commit makes the directory configurable using the `OUT_DIR` argument,
and defaults it to ./_output
2017-06-26 16:27:26 -04:00
Solly Ross
6f4f0ea2f9 Merge pull request #8 from luxas/move_cmd
Move the adapter binary to a separate subdir
2017-06-26 16:25:37 -04:00