Compare commits

...

216 Commits

Author SHA1 Message Date
Jonathan Juares Beber
d1969a3020 Merge pull request #348 from zalando-incubator/pitr-zmon
fixes for ZMON client
2021-07-26 15:57:11 +02:00
Jonathan Juares Beber
582c94255f Add test for ZMON Key
This commit add tests to the ZMON package when handling the key used on
the metrics query.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-07-26 15:41:15 +02:00
☃ pitr
c626f414db remove deprecated zmon aggregators in README
Signed-off-by: ☃ pitr <peter.vernigorov@zalando.de>
2021-07-26 11:14:27 +02:00
☃ pitr
1d4beab7a4 fixes for ZMON client
Changes:
- only add group_by "key" if key is provided
- remove deprecated aggregators "dev" and "first"
- add X-Attribution header for query attribution

Signed-off-by: ☃ pitr <peter.vernigorov@zalando.de>
2021-07-24 21:45:02 +02:00
Jonathan Juares Beber
eefd5ef512 Merge pull request #346 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.39.2
Bump github.com/aws/aws-sdk-go from 1.38.70 to 1.39.2
2021-07-08 16:20:03 +02:00
dependabot[bot]
599b3bf805 Bump github.com/aws/aws-sdk-go from 1.38.70 to 1.39.2
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.70 to 1.39.2.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.70...v1.39.2)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-08 13:00:42 +00:00
Mikkel Oscar Lyderik Larsen
ecf21df9c0 Merge pull request #338 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.38.70
Bump github.com/aws/aws-sdk-go from 1.38.47 to 1.38.70
2021-07-08 14:52:50 +02:00
dependabot[bot]
ecd296e644 Bump github.com/aws/aws-sdk-go from 1.38.47 to 1.38.70
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.47 to 1.38.70.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.47...v1.38.70)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 07:19:53 +00:00
Jonathan Juares Beber
446b7f01ea Merge pull request #334 from zalando-incubator/nil-fields
Switch Schedule optional fields to pointers
2021-06-30 17:17:15 +02:00
Jonathan Juares Beber
0ad7296d56 Switch Schedule optional fields to pointers
The `Date` and `Period` fields inside the `Schedule` type of the
`[Cluster]ScalingSchedule` CRDs are optional, but in its current
configuration the generated clients can't update or create these
resources since the empty fields do not pass the validation.

This commit updates the `[Cluster]ScalingSchedule.Schedule[*]` `Date`
and `Period` field to pointers, this way a null value is not validated
and the clients are able to update and create resources. It also updates
the collector code and tests to reflect the change.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-06-30 17:09:48 +02:00
Jonathan Juares Beber
9da155554b Merge pull request #332 from zalando-incubator/drop-identifier
Remove HTTP collector check on identifier label
2021-06-01 13:53:21 +02:00
Jonathan Juares Beber
d7f9664d52 Remove HTTP collector check on identifier label
This commit removes the logic that checks for an identifier label in the
http collector config. It also removes the documentation on the README
that mentions that the metric has to be in an old format, removed in
the #219.

Fixes #331

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-06-01 12:33:32 +02:00
Jonathan Juares Beber
85f6dda229 Merge pull request #328 from zalando-incubator/fix/typo
fix typo Saturday
2021-05-26 17:02:01 +02:00
Sandor Szücs
64a6b85c73 fix typo Saturday
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2021-05-26 12:03:07 +02:00
Jonathan Juares Beber
f41af0d82b Merge pull request #329 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.38.47
Bump github.com/aws/aws-sdk-go from 1.38.46 to 1.38.47
2021-05-26 11:52:08 +02:00
dependabot[bot]
194bede7a3 Bump github.com/aws/aws-sdk-go from 1.38.46 to 1.38.47
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.46 to 1.38.47.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.46...v1.38.47)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 08:51:08 +00:00
dependabot[bot]
c4f5efb6a7 Bump github.com/prometheus/common from 0.23.0 to 0.25.0 (#323)
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.23.0 to 0.25.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.23.0...v0.25.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 10:44:06 +02:00
dependabot[bot]
51e9378ee6 Bump github.com/aws/aws-sdk-go from 1.38.44 to 1.38.46 (#327)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.44 to 1.38.46.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.44...v1.38.46)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 10:43:43 +02:00
Jonathan Juares Beber
ce27ef1798 Merge pull request #324 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.38.44
Bump github.com/aws/aws-sdk-go from 1.38.30 to 1.38.44
2021-05-25 19:18:14 +02:00
Jonathan Juares Beber
a73ef467cd Merge pull request #325 from zalando-incubator/crd-scope-fix
Remove ClusterScalingSchedule clients namespace
2021-05-25 17:30:57 +02:00
Jonathan Juares Beber
e6a04531fb Merge pull request #326 from zalando-incubator/ignore-container-resource-metrics
Ignore ContainerResource metrics
2021-05-25 17:03:27 +02:00
Mikkel Oscar Lyderik Larsen
7289e6f8e2 Ignore ContainerResource metrics
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-05-25 16:45:35 +02:00
Jonathan Juares Beber
60b1dc097a Remove ClusterScalingSchedule clients namespace
During #284 we set the ClusterScalingSchedule scope as `Cluster` but
just for kubebuilder. This flag has no effect in the generated clients.
It means the generated clients expect a namespace argument when handling
ClusterScalingSchedule resources. It works fine to list all of the
resources but makes it impossible to request a specific resource
defining its name.

This commit sets the `+genclient:nonNamespaced` flag for the CRD and
adds the regenerated clients. It does not affect any of the usage of the
clients in this codebase so far.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-05-21 17:16:57 +02:00
dependabot[bot]
6b46cc2599 Bump github.com/aws/aws-sdk-go from 1.38.30 to 1.38.44
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.30 to 1.38.44.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.30...v1.38.44)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-21 14:55:46 +00:00
Jonathan Juares Beber
6f9aba8db8 Merge pull request #315 from zalando-incubator/time-based-scaling
Create ScalingSchedule collector
2021-05-21 16:46:10 +02:00
Jonathan Juares Beber
a382dbfe7b Create ScalingSchedule collector
This commit adds two new collectors to the adapter:
- ClusterScalingScheduleCollector; and
- ScalingScheduleCollector

Also, it introduces the required collectors plugins, initialization
logic in the server startup, documentation and deployment example
(including the helm chart). A new config flag is created,
`-scaling-schedule`, and allows to enable and to disable the collection
of such metrics. It's disabled by default.

This collectors are the required logic to utilise the CRDs introduced in
the #284 pull request. It makes use of the kubernetes go-client
implementations of a [Store][0] and [Reflector][1].

[0]: https://pkg.go.dev/k8s.io/client-go/tools/cache#Store
[1]: https://pkg.go.dev/k8s.io/client-go/tools/cache#Reflector

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-05-21 14:29:11 +02:00
Jonathan Juares Beber
7a68304389 Merge pull request #311 from Miniland1333/patch-2
Bump to v0.1.10 for helm
2021-05-12 18:36:34 +02:00
Jonathan Juares Beber
7044e79b08 Merge pull request #312 from adutchak-x/feature/stop-processing-non-runing-pods
Feature/stop processing non runing pods
2021-05-06 10:35:17 +02:00
Anatolii Dutchak
e16bacb24e Changed message text and level
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-05-05 11:22:51 +03:00
Jonathan Juares Beber
726c1e691d Merge pull request #313 from zalando-incubator/dependabot/go_modules/github.com/prometheus/common-0.23.0
Bump github.com/prometheus/common from 0.20.0 to 0.23.0
2021-05-03 11:49:11 +02:00
Jonathan Juares Beber
debc90ca72 Merge pull request #314 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.38.30
Bump github.com/aws/aws-sdk-go from 1.38.18 to 1.38.30
2021-05-03 11:48:57 +02:00
dependabot[bot]
6343c8ea15 Bump github.com/aws/aws-sdk-go from 1.38.18 to 1.38.30
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.18 to 1.38.30.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.18...v1.38.30)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 07:05:41 +00:00
dependabot[bot]
eb0575f11e Bump github.com/prometheus/common from 0.20.0 to 0.23.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.20.0 to 0.23.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.20.0...v0.23.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-01 07:05:08 +00:00
Anatolii Dutchak
52bfbbb1b0 Goimported pod_collector_test.go
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-30 18:08:30 +03:00
Anatolii Dutchak
cf5872ef08 Fixed formatting
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-30 18:00:23 +03:00
Anatolii Dutchak
b5432fb1f3 Fixed formatting
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-30 17:58:44 +03:00
Anatolii Dutchak
5466badd90 Added pod.DeletionTimestamp condition check
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-30 16:04:32 +03:00
Jonathan Juares Beber
aef1837e47 Merge pull request #310 from Miniland1333/patch-1
Updated apiservice to v1
2021-04-28 16:16:00 +02:00
Henry Agnew
4e86d6ae34 Reverted changes to metrics API. Retain API registration changes
Testing indicates that metrics API v1beta2 is not a suitable drop-in replacement for v1beta1, and v1 does not exist at this time.
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-27 10:31:48 -07:00
Miniland1333
2874c1a6a7 Update Chart.yaml
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-26 22:19:37 -07:00
Miniland1333
b5006746f0 Bump to v0.1.10
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-26 22:19:37 -07:00
Miniland1333
9496ab7fd3 Update external-metrics-apiservice.yaml
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-26 11:26:34 -07:00
Miniland1333
aa7f86291e Update custom-metrics-apiservice.yaml
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-26 11:26:34 -07:00
Miniland1333
486a6c4262 Update external-metrics-apiservice.yaml
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-26 11:26:34 -07:00
Miniland1333
aaf66f31a0 Update custom-metrics-apiservice.yaml
Signed-off-by: Henry Agnew <henryd.agnew@gmail.com>
2021-04-26 11:26:34 -07:00
Jonathan Juares Beber
e5bee93bf6 Merge pull request #309 from iamgrewal7/master
add commandline flags to set GC interval and metrics TTL
2021-04-26 14:28:02 +02:00
Harman Singh
aae3772472 add commandline flags to set GC interval and metrics TTL
Signed-off-by: Harman Singh <iamgrewal7@gmail.com>
2021-04-26 00:01:04 -07:00
Jonathan Juares Beber
76d3726e5b Merge pull request #308 from adutchak-x/feature/improve-pod-collector
Feature/improve pod collector
2021-04-21 19:39:49 +02:00
Anatolii Dutchak
ea4a651afe Fixed tests
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-21 18:37:16 +03:00
Anatolii Dutchak
721c6553d8 Added conditions[i].Status == corev1.ConditionTrue check
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-21 18:25:49 +03:00
Anatolii Dutchak
5aa2272e37 Removed debug message, changed podReadyAge >= c.minPodReadyAge
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-20 12:33:47 +03:00
Anatolii Dutchak
b9300d1e46 Added namespace to logs, simplified GetPodReadyAge method
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-20 11:21:24 +03:00
Anatolii Dutchak
5747b6c9de Renamed min-pod-age to min-pod-ready-age. Considering LastTransitionTime for pod ready age.
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-19 18:51:39 +03:00
Anatolii Dutchak
6d15a1635a goimported pkg/collector/pod_collector_test.go
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-17 08:17:59 +03:00
Anatolii Dutchak
4090ab8b32 goimported pkg/annotations/parser_test.go
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-17 01:08:42 +03:00
Anatolii Dutchak
1f56abf931 Corrected formatting
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-17 00:52:00 +03:00
Anatolii Dutchak
f216070630 Introduced min-pod-age configuration key. Added Pod condition handling
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-17 00:52:00 +03:00
Jonathan Juares Beber
8725f02db7 Merge pull request #295 from adutchak-x/bugfix/fix-disregard-incompatible-hpas-error-handling
Bugfix/fix disregard incompatible hpas error handling
2021-04-16 12:10:17 +02:00
Anatolii Dutchak
240452ca27 Merge pull request #1 from zalando-incubator/bugfix/fix-disregard-incompatible-hpas-error-handling-check-events
Check for events to ensure invalid HPAs are ignored
2021-04-16 12:35:16 +03:00
Mikkel Oscar Lyderik Larsen
45d7863e73 Check for events to ensure invalid HPAs are ignored
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-04-16 10:05:27 +02:00
Anatolii Dutchak
87f249d36b goimported hpa.go
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
Anatolii Dutchak
9967a55df8 Updated errors handling for updateHPAs method
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
adutchak-x
adf0792079 Update pkg/collector/collector.go
Co-authored-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
Anatolii Dutchak
99fa5c42ed Replaced spaces with tabs
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
Anatolii Dutchak
188cc91574 Reverted error check to errors.Is(), implemented Is() method for PluginNotFoundError
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
Anatolii Dutchak
a8ff0ed6f0 Corrected comment formatting
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
Anatolii Dutchak
cc9279b283 Chnaged error type check from errors.Is() to errors.As() because errors.Is() always returns False
Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
2021-04-14 22:25:23 +03:00
Jonathan Juares Beber
9bb7d976a0 Merge pull request #307 from zalando-incubator/update-deps-2021-04-13-2
Update dependencies
2021-04-13 16:08:57 +02:00
Mikkel Oscar Lyderik Larsen
816661f7fd Don't deepcopy-gen on string types
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-04-13 13:11:40 +02:00
Mikkel Oscar Lyderik Larsen
7ae70d798d Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-04-13 11:52:50 +02:00
Mikkel Oscar Lyderik Larsen
0ef5ad1cfe Merge pull request #298 from zalando-incubator/document-interval-settings
Clearly document interval config
2021-04-13 11:35:57 +02:00
Jonathan Juares Beber
c86235636b Merge pull request #297 from zalando-incubator/update-deps-2021-04-13
Update dependencies
2021-04-13 11:34:16 +02:00
Mikkel Oscar Lyderik Larsen
2d119e68e4 Clearly document interval config
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-04-13 11:28:50 +02:00
Mikkel Oscar Lyderik Larsen
df3efe0e39 Update makefile dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-04-13 11:17:46 +02:00
Mikkel Oscar Lyderik Larsen
a5b5cb91c3 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-04-13 10:48:44 +02:00
Jonathan Juares Beber
ebcf99ad27 Merge pull request #284 from zalando-incubator/time-based-scaling
Create first version of ScalingSchedule CRD
2021-03-23 15:07:09 +01:00
Jonathan Juares Beber
3d450ad2c2 Create first version of ScalingSchedule CRDs
Some cases and users actually know when their applications will have a
high workload and, therefore, autoscaling support for time based scaling
is a desired feature.

This commit creates the first version of two CRDs called
`ScalingSchedule` and `ClusterScalingSchedule`.
The CRDs describe one or multiples schedules inside them. The schedules
contains the information of when the time based scaling starts, if it
happens once or multiple times, its duration and, a configurable value
that later can be used by HPAs to scale applications.

The only difference between the two CRDs is their scope.
`ClusterScalingSchedule` aims to attend cluster wide schedules, to
multiple applications, while `ScalingSchedule` has to be deployed with
each application into the same namespace.

This commit does not creates any metric, it's a noop change that creates
just the CRD and import tools required to generate the CRD and others
required code, as `deepCopy` functions and clients.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-03-23 11:07:56 +01:00
Mikkel Oscar Lyderik Larsen
78a9b5c253 Merge pull request #283 from zalando-incubator/update-deps-2021-03-01
Update dependencies
2021-03-01 12:45:36 +01:00
Mikkel Oscar Lyderik Larsen
4e2b9d9788 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-03-01 11:50:33 +01:00
Mikkel Oscar Lyderik Larsen
38aeb4deed Stable comparison in test
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-03-01 11:50:32 +01:00
Mikkel Oscar Lyderik Larsen
b7aa886546 Namespace external metrics (#259)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-02-19 11:11:29 +01:00
Mikkel Oscar Lyderik Larsen
942e753f87 Use Github actions instead of travis (#270)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-02-19 10:31:20 +01:00
Jonathan Juares Beber
86ed6ec102 Merge pull request #269 from zalando-incubator/update-dependencies-2021-02-01
Update dependencies
2021-02-01 18:49:22 +01:00
Mikkel Oscar Lyderik Larsen
b313c963b6 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-02-01 10:26:01 +01:00
Jonathan Juares Beber
ca20ef3a3b Merge pull request #256 from zalando-incubator/label-maintainer
Use non-deprecated Dockerfile syntax
2021-01-15 14:56:27 +01:00
Mikkel Oscar Lyderik Larsen
f2179846c5 Use non-deprecated Dockerfile syntax
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-01-15 14:21:26 +01:00
Jonathan Juares Beber
85089c4773 Merge pull request #253 from tanersener/master
Fix the namespace of horizontal-pod-autoscaler service account used in the helm chart
2021-01-14 19:31:02 +01:00
Taner Sener
2ac9dd29d8 Fix the namespace of horizontal-pod-autoscaler service account in the helm chart
Signed-off-by: Taner Sener <tanersener@gmail.com>
2021-01-13 14:54:43 +00:00
Mikkel Oscar Lyderik Larsen
2bfc85ff3d Merge pull request #251 from zalando-incubator/fix-aws-collector
Don't check for metric name on AWS init
2021-01-05 16:49:31 +01:00
Mikkel Oscar Lyderik Larsen
d55a551bd8 Don't check for metric name on AWS init
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-01-05 11:52:44 +01:00
Jonathan Juares Beber
3174100f5a Merge pull request #250 from zalando-incubator/base-image
Switch to compliant base image
2021-01-05 09:03:47 +01:00
Jonathan Juares Beber
16808f012d Switch to compliant base image
Use compliant base image according to our tech rules of play:
- KDP-1: use an approved Docker base image and version from the list of
    allowed Docker Base Images under the pierone namespace ‘library’.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-01-05 08:57:15 +01:00
Mikkel Oscar Lyderik Larsen
2531ddcbe3 Merge pull request #238 from tanersener/master
Add a kubernetes helm chart
2021-01-04 16:07:52 +01:00
Taner Sener
8ff2e3985b keep non-helm deployment files
Signed-off-by: Taner Sener <tanersener@gmail.com>
2021-01-04 13:11:33 +00:00
Mikkel Oscar Lyderik Larsen
dab5a66556 Update dependencies (#249)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-01-04 09:59:04 +01:00
Taner Sener
995ec54aa5 re-organize helm deployment files as a helm chart
Signed-off-by: Taner Sener <tanersener@gmail.com>
2020-12-19 10:12:33 +00:00
Mikkel Oscar Lyderik Larsen
6f71e9c6b0 Merge pull request #236 from zalando-incubator/update-deps-2020-12-01
Update dependencies
2020-12-01 12:42:34 +01:00
Mikkel Oscar Lyderik Larsen
ed16830a77 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-12-01 11:16:09 +01:00
Ewan Valentine
7f84bc75f4 UPDATED to use NewSessionWithConfig instead of NewSession (#230)
NewSession is being deprecated, NewSessionWithConfig handles things
such as role arns. This fixes permissions issues for users using
role arns for service accounts.

Signed-off-by: Ewan Valentine <ewan.valentine89@gmail.com>
2020-11-21 19:49:49 +01:00
Mikkel Oscar Lyderik Larsen
b5fbb1beae Merge pull request #228 from zalando-incubator/prometheus-fix-query-mapping
Fix mapping of Prometheus query for new metric configuration
2020-11-16 17:52:56 +01:00
Mikkel Oscar Lyderik Larsen
4506701b7c Fix mapping of Prometheus query for new metric configuration
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-11-16 17:44:06 +01:00
Mikkel Oscar Lyderik Larsen
df0ed1fca4 Use labels for mapping metric types to metrics (#219)
* Use labels for mapping metric types to metrics

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Log warning when old format is used

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Test NewCollector logic for external metrics

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-11-04 20:40:53 +01:00
Jannis Rake-Revelant
bb107b678c Merge pull request #224 from zalando-incubator/update-deps-2020-11-02
Update dependencies
2020-11-02 09:56:51 +01:00
Mikkel Oscar Lyderik Larsen
8d7dc13bbd Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-11-02 09:04:08 +01:00
Mikkel Oscar Lyderik Larsen
20f0042017 Merge pull request #217 from zalando-incubator/fix-openapi
Fix openapi serving
2020-10-27 11:27:07 +01:00
Mikkel Oscar Lyderik Larsen
c732851b6b Fix openapi serving
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-10-27 10:43:16 +01:00
Muaaz Saleem
2e09132f95 [prom collector ] Documenting scrape interval (#215)
There is a way to configure scrape interval

Signed-off-by: Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2020-10-26 17:37:24 +01:00
dependabot[bot]
95f22dc398 Bump github.com/aws/aws-sdk-go from 1.35.0 to 1.35.13 (#212)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.35.0 to 1.35.13.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.35.0...v1.35.13)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-26 10:31:24 +01:00
Mikkel Oscar Lyderik Larsen
eed5c78fb3 Use upstream version of custom-metrics-apiserver (#211)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-10-23 10:51:10 +02:00
Mikkel Oscar Lyderik Larsen
e61071a36d Merge pull request #164 from zalando-incubator/openapi-fork
Use OpenAPI spec fork
2020-10-06 22:30:46 +02:00
Mikkel Oscar Lyderik Larsen
c108fab55a Use OpenAPI spec fork
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-10-02 11:06:21 +02:00
Mikkel Oscar Lyderik Larsen
be7567efea Fix handling of invalid/empty json response (#209)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-10-02 10:57:53 +02:00
Mikkel Oscar Lyderik Larsen
b677e814be Update dependencies (#200)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-10-02 10:55:42 +02:00
Mikkel Oscar Lyderik Larsen
deec4727ee Merge pull request #192 from zalando-incubator/extend-jsonpath-support
Support bracket notation in jsonPath
2020-09-30 12:18:39 +02:00
Mikkel Oscar Lyderik Larsen
cf369639d8 Support bracket notation in jsonPath
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-08-13 09:51:05 +02:00
Rodrigo Reis
262a35c2ec Merge pull request #177 from zalando-incubator/update-deps
Update dependencies
2020-07-15 17:45:01 +02:00
Mikkel Oscar Lyderik Larsen
607386834b Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-07-15 17:00:13 +02:00
Mikkel Oscar Lyderik Larsen
4bdce4da4d Merge pull request #176 from zalando-incubator/ingress-weights-float64
Correctly treat ingress weight values as float64
2020-07-15 16:56:33 +02:00
Mikkel Oscar Lyderik Larsen
801e5d7a47 Correctly treat ingress weight values as float64
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-07-15 15:42:59 +02:00
Mikkel Oscar Lyderik Larsen
4df21ae2b4 Merge pull request #174 from zalando-incubator/dependabot/add-v2-config-file
Create Dependabot config file
2020-07-10 13:31:55 +02:00
dependabot-preview[bot]
7f639baeee Create Dependabot config file 2020-07-10 09:49:34 +00:00
Rodrigo Reis
88ddb6f10e Merge pull request #173 from zalando-incubator/arjun-has-left-the-zalando
Update MAINTAINERS
2020-07-01 15:14:25 +02:00
Arjun Naik
d9cf2e0858 Update MAINTAINERS
Signed-off-by: Arjun Naik <arjun@arjunnaik.in>
2020-07-01 15:04:31 +02:00
Mikkel Oscar Lyderik Larsen
c3b18e784b Update client-go (#162)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-06-27 18:39:12 +02:00
Mikkel Oscar Lyderik Larsen
c3a03fd758 Merge pull request #157 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.31.7
Bump github.com/aws/aws-sdk-go from 1.30.24 to 1.31.7
2020-06-02 09:43:49 +02:00
Mikkel Oscar Lyderik Larsen
05704c0a6b Merge pull request #158 from zalando-incubator/dependabot/go_modules/github.com/stretchr/testify-1.6.0
Bump github.com/stretchr/testify from 1.5.1 to 1.6.0
2020-06-02 09:43:27 +02:00
Mikkel Oscar Lyderik Larsen
f3a608fcf7 Merge pull request #159 from zalando-incubator/dependabot/go_modules/github.com/prometheus/common-0.10.0
Bump github.com/prometheus/common from 0.9.1 to 0.10.0
2020-06-02 09:43:03 +02:00
dependabot-preview[bot]
223ec9fd89 Bump github.com/prometheus/common from 0.9.1 to 0.10.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.9.1 to 0.10.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.9.1...v0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 10:47:03 +00:00
dependabot-preview[bot]
81255aa956 Bump github.com/stretchr/testify from 1.5.1 to 1.6.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.5.1...v1.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 10:46:34 +00:00
dependabot-preview[bot]
dac44965e3 Bump github.com/aws/aws-sdk-go from 1.30.24 to 1.31.7
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.24 to 1.31.7.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.24...v1.31.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 10:46:23 +00:00
Mikkel Oscar Lyderik Larsen
dbed1570ba Merge pull request #156 from zalando-incubator/networking.k8s.io
Add support for Ingress of API Group networking.k8s.io
2020-05-26 15:09:18 +02:00
Mikkel Oscar Lyderik Larsen
ef24244074 Add support for networking.k8s.io
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-05-26 14:47:46 +02:00
Arjun
cadf2dff3c Merge pull request #153 from doyshinda/custom_timeouts
Add support for custom timeouts
2020-05-18 10:27:17 +02:00
Arjun
db83268343 Merge pull request #150 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.24
Bump github.com/aws/aws-sdk-go from 1.30.19 to 1.30.24
2020-05-18 10:25:50 +02:00
Mikkel Oscar Lyderik Larsen
78c2ef742b Merge pull request #152 from doyshinda/parallel_get_metrics
Fetch pod metrics in parallel
2020-05-18 09:26:14 +02:00
Abe Friesen
f0b817629c Add support for custom timeouts
Allow configuration per metric for connect and request timeouts
when querying pods for JSON metrics.

Signed-off-by: Abe Friesen <2319792+doyshinda@users.noreply.github.com>
2020-05-16 07:15:58 -06:00
Abe Friesen
3e7b66070c Fetch pod metrics in parallel
Fetching metrics from pods sequentially, with a large number of
pods, can result in poor performance when some of those pods have
been terminated by the HPA in a normal scale down event.

Signed-off-by: Abe Friesen <2319792+doyshinda@users.noreply.github.com>
2020-05-16 06:47:13 -06:00
dependabot-preview[bot]
f3d33b6132 Bump github.com/aws/aws-sdk-go from 1.30.19 to 1.30.24
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.19 to 1.30.24.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.19...v1.30.24)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 10:18:26 +00:00
Arjun
7b7af889fb Merge pull request #148 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.19
Bump github.com/aws/aws-sdk-go from 1.30.14 to 1.30.19
2020-05-06 12:45:54 +02:00
Arjun
2bcaa80ce0 Merge pull request #147 from zalando-incubator/dependabot/go_modules/github.com/prometheus/client_golang-1.6.0
Bump github.com/prometheus/client_golang from 1.5.1 to 1.6.0
2020-05-06 12:45:46 +02:00
Arjun
a2e6980b25 Merge pull request #146 from zalando-incubator/dependabot/go_modules/github.com/sirupsen/logrus-1.6.0
Bump github.com/sirupsen/logrus from 1.5.0 to 1.6.0
2020-05-06 12:45:23 +02:00
dependabot-preview[bot]
f0783dcdd8 Bump github.com/aws/aws-sdk-go from 1.30.14 to 1.30.19
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.14 to 1.30.19.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.14...v1.30.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-04 09:59:27 +00:00
dependabot-preview[bot]
560fb40dae Bump github.com/prometheus/client_golang from 1.5.1 to 1.6.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.5.1...v1.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-04 09:58:05 +00:00
dependabot-preview[bot]
41229e370d Bump github.com/sirupsen/logrus from 1.5.0 to 1.6.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.5.0...v1.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-04 09:57:46 +00:00
Arjun
338393c11e Merge pull request #145 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.14
Bump github.com/aws/aws-sdk-go from 1.30.9 to 1.30.14
2020-05-02 21:28:27 +02:00
dependabot-preview[bot]
8e7d1bc0d6 Bump github.com/aws/aws-sdk-go from 1.30.9 to 1.30.14
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.9 to 1.30.14.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.9...v1.30.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 10:18:59 +00:00
Arjun
dc7fb5875b Merge pull request #143 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.9
Bump github.com/aws/aws-sdk-go from 1.30.7 to 1.30.9
2020-04-21 06:20:06 +02:00
dependabot-preview[bot]
8f70d3493e Bump github.com/aws/aws-sdk-go from 1.30.7 to 1.30.9
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.7 to 1.30.9.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.7...v1.30.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 10:00:12 +00:00
Gábor Lipták
97ec13d010 Update Travis to Go 1.14 (#140)
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2020-04-12 22:54:49 +02:00
Martin Linkhorst
5e20dcd961 Merge pull request #139 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.7
Bump github.com/aws/aws-sdk-go from 1.30.3 to 1.30.7
2020-04-09 15:52:18 +02:00
dependabot-preview[bot]
f27dbc3939 Bump github.com/aws/aws-sdk-go from 1.30.3 to 1.30.7
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.3 to 1.30.7.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.3...v1.30.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-09 08:48:10 +00:00
Mikkel Oscar Lyderik Larsen
6443613930 Merge pull request #135 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.3
Bump github.com/aws/aws-sdk-go from 1.30.2 to 1.30.3
2020-04-03 12:35:00 +02:00
dependabot-preview[bot]
d9c2e50f2c Bump github.com/aws/aws-sdk-go from 1.30.2 to 1.30.3
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.2 to 1.30.3.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.2...v1.30.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-03 08:48:22 +00:00
Arjun
a8cd761f85 Merge pull request #122 from zalando-incubator/http-collector
Add basic HTTP collector
2020-04-02 14:34:47 +02:00
Mikkel Oscar Lyderik Larsen
43fa626ca1 Merge pull request #134 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.2
Bump github.com/aws/aws-sdk-go from 1.30.0 to 1.30.2
2020-04-02 12:01:48 +02:00
Arjun Naik
2d3ddc53ef Add and HTTP metrics collector
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2020-04-02 11:05:37 +02:00
dependabot-preview[bot]
02880fad2d Bump github.com/aws/aws-sdk-go from 1.30.0 to 1.30.2
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.30.0 to 1.30.2.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.30.0...v1.30.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-02 08:34:49 +00:00
Arjun
405e347620 Merge pull request #132 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.30.0
Bump github.com/aws/aws-sdk-go from 1.29.33 to 1.30.0
2020-03-31 19:14:02 +02:00
Arjun
f15aacad5c Merge pull request #123 from zalando-incubator/dependabot/go_modules/github.com/spf13/cobra-0.0.7
Bump github.com/spf13/cobra from 0.0.6 to 0.0.7
2020-03-31 19:13:31 +02:00
Arjun
c0a9f525b8 Merge pull request #131 from vetinari/patch-1
fix error to not contain twice the namespace
2020-03-31 19:13:05 +02:00
Arjun
24207d285c Merge pull request #126 from zalando-incubator/dependabot/go_modules/github.com/prometheus/client_golang-1.5.1
Bump github.com/prometheus/client_golang from 1.0.0 to 1.5.1
2020-03-31 19:12:03 +02:00
Hanno Hecker
860aba807e fix error to not contain twice the namespace
but to contain also the name of the pod

Signed-off-by: Hanno Hecker <hanno@zalando.de>
2020-03-31 10:44:55 +02:00
dependabot-preview[bot]
73659f8ac6 Bump github.com/aws/aws-sdk-go from 1.29.33 to 1.30.0
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.29.33 to 1.30.0.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.29.33...v1.30.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 08:42:58 +00:00
dependabot-preview[bot]
280d358538 Bump github.com/prometheus/client_golang from 1.0.0 to 1.5.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.0.0 to 1.5.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.0.0...v1.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-30 09:50:33 +00:00
dependabot-preview[bot]
735bb164e2 Bump github.com/spf13/cobra from 0.0.6 to 0.0.7
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.6 to 0.0.7.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v0.0.6...0.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-30 09:49:38 +00:00
Arjun
d28712abd1 Merge pull request #110 from zalando-incubator/update-dependencies
Updated dependencies based on version 1.17
2020-03-27 11:05:59 +01:00
Arjun Naik
670692b23c Updated dependencies based on version 1.17
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2020-03-27 10:54:06 +01:00
Mikkel Oscar Lyderik Larsen
33683fe88d Merge pull request #121 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.29.33
Bump github.com/aws/aws-sdk-go from 1.29.31 to 1.29.33
2020-03-27 10:23:34 +01:00
dependabot-preview[bot]
abaef5e491 Bump github.com/aws/aws-sdk-go from 1.29.31 to 1.29.33
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.29.31 to 1.29.33.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.29.31...v1.29.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-27 08:31:09 +00:00
Mikkel Oscar Lyderik Larsen
670f081a5e Merge pull request #115 from zalando-incubator/dependabot/go_modules/github.com/spf13/cobra-0.0.6
Bump github.com/spf13/cobra from 0.0.3 to 0.0.6
2020-03-26 12:10:03 +01:00
Arjun
55a743e5ac Merge pull request #119 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.29.31
Bump github.com/aws/aws-sdk-go from 1.29.30 to 1.29.31
2020-03-25 14:06:01 +01:00
dependabot-preview[bot]
830d385a4a Bump github.com/spf13/cobra from 0.0.3 to 0.0.6
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.3 to 0.0.6.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v0.0.3...v0.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-25 12:27:25 +00:00
dependabot-preview[bot]
f2638c6843 Bump github.com/aws/aws-sdk-go from 1.29.30 to 1.29.31
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.29.30 to 1.29.31.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.29.30...v1.29.31)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-25 08:33:33 +00:00
Arjun
b77fba2e7b Merge pull request #114 from zalando-incubator/dependabot/go_modules/github.com/stretchr/testify-1.5.1
Bump github.com/stretchr/testify from 1.4.0 to 1.5.1
2020-03-24 10:49:11 +01:00
Arjun
e77d51f97a Merge pull request #112 from zalando-incubator/dependabot/go_modules/github.com/influxdata/influxdb-client-go-0.1.5
Bump github.com/influxdata/influxdb-client-go from 0.1.4 to 0.1.5
2020-03-24 10:48:43 +01:00
Arjun
69ac42ed7d Merge pull request #111 from zalando-incubator/dependabot/go_modules/github.com/prometheus/client_golang-0.9.4
Bump github.com/prometheus/client_golang from 0.9.2 to 0.9.4
2020-03-24 10:48:02 +01:00
Arjun
582f05539c Bump github.com/sirupsen/logrus from 1.4.2 to 1.5.0 (#117)
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.4.2 to 1.5.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.4.2...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-24 10:46:59 +01:00
dependabot-preview[bot]
46f2e5c4fd Bump github.com/aws/aws-sdk-go from 1.29.4 to 1.29.30 (#116)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.29.4 to 1.29.30.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.29.4...v1.29.30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-24 10:46:51 +01:00
dependabot-preview[bot]
31bc1771df Bump github.com/sirupsen/logrus from 1.4.2 to 1.5.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.4.2 to 1.5.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.4.2...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-24 08:49:15 +00:00
dependabot-preview[bot]
836c78d08b Bump github.com/stretchr/testify from 1.4.0 to 1.5.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.5.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-22 14:21:19 +00:00
dependabot-preview[bot]
6f5ab042e6 Bump github.com/influxdata/influxdb-client-go from 0.1.4 to 0.1.5
Bumps [github.com/influxdata/influxdb-client-go](https://github.com/influxdata/influxdb-client-go) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/influxdata/influxdb-client-go/releases)
- [Commits](https://github.com/influxdata/influxdb-client-go/compare/v0.1.4...v0.1.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-22 14:20:20 +00:00
dependabot-preview[bot]
5abc7388fb Bump github.com/prometheus/client_golang from 0.9.2 to 0.9.4
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 0.9.2 to 0.9.4.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v0.9.2...v0.9.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-22 14:19:58 +00:00
Abe Friesen
5bf87cb10e Add support for passing URL query params to pod metric endpoints (#109)
Adds a new metric-config option named `rawQuery`. The value of
this option will be appended to the metric `path` as URL query
parameters to be used by the pod's application. E.g.,:
```
metric-config.pods.requests-per-second.json-path/rawQuery: "foo=bar&baz=bop"
```
will apppend `?foo=bar&baz=bop` to the URL.

Signed-off-by: Abe Friesen <2319792+doyshinda@users.noreply.github.com>
2020-03-10 10:45:28 +01:00
Mikkel Oscar Lyderik Larsen
c6610750e4 Merge pull request #107 from affo/fix/influxdb-token-org-swap
fix(influxdb): fix swap of org/token
2020-02-24 09:27:34 +01:00
Lorenzo Affetti
04ae6d955e fix(influxdb): fix swap of org/token parameter passing to
InfluxDBCollector

Convert from `orgID` to `org`.

Signed-off-by: Lorenzo Affetti <lorenzo.affetti@gmail.com>
2020-02-21 19:13:17 +01:00
Mikkel Oscar Lyderik Larsen
2d56c202a7 Update AWS SDK to support AWS IAM solution (#106)
Fix #105

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-02-18 09:59:31 +01:00
Arjun
c9fa15c7d4 Updated the tests (#103)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2020-02-04 09:48:50 +01:00
Arjun
e3330dcf43 Reuse the HTTP client for scraping pods (#102)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2020-01-30 17:49:22 +01:00
Tomás Pinho
8e4662b26c Permit disregarding incompatible HPAs (#95)
* This commit adds a --disregard-incompatible-hpas that makes the HPA
provider stop erroring out when a collector cannot be created for a
metric in a HPA. Useful when kube-metrics-adapter runs alongside another
metrics provider. Fixes issue #94.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Make tests pass

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Wraps the Plugin Not Found error in a new type that can be checked by the caller of a function to determine if its contents should be logged or added as an event to the HPA, when this HPA is incompatible.
The disregardIncompatibleHPAs is now targetting only the log or addition of the same event.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Invert if expression to select when we should log
CreateNewMetricsCollector errors: don't log when both conditions are true - it's not a PluginNotFoundError
and disregardIncompatibleHPAs flag is set to true. This way, if an error
is NOT PluginNotFoundError it will always be logged, and when it IS
PluginNotFoundError it will only be logged when
disregardIncompatibleHPAs is false.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Remove redundant "whether to"

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Add test case for updating HPAs via HPA Provider while disregarding
incompatible HPAs.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>
2020-01-30 11:33:15 +01:00
Mikkel Oscar Lyderik Larsen
9e211b181a Merge pull request #101 from zalando-incubator/update-to-v2beta2
Only support autoscaling/v2beta2
2020-01-29 16:47:15 +01:00
Mikkel Oscar Lyderik Larsen
9d78fff1b5 Only support autoscaling/v2beta2
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2020-01-29 15:59:20 +01:00
Mikkel Oscar Lyderik Larsen
1c6f9e2ea6 Merge pull request #100 from affo/feat/influxdb-collector
feat(collector): add InfluxDB collector
2020-01-24 10:56:52 +01:00
Lorenzo Affetti
c0eda7cd1e adding tests for collector creation
Signed-off-by: Lorenzo Affetti <lorenzo.affetti@gmail.com>
2020-01-24 09:54:35 +01:00
Lorenzo Affetti
75f3e48f70 address szuecs review
Signed-off-by: Lorenzo Affetti <lorenzo.affetti@gmail.com>
2020-01-24 09:07:56 +01:00
Lorenzo Affetti
5b55bea994 feat(collector): add InfluxDB collector
Signed-off-by: Lorenzo Affetti <lorenzo.affetti@gmail.com>
2020-01-22 10:09:29 +01:00
Nick Jüttner
4412e3dca4 Merge pull request #92 from zalando-incubator/njuettner-patch
Updating golangci
2019-11-26 14:49:02 +01:00
Mikkel Oscar Lyderik Larsen
8f9277258c Increase timeout for golangci-lint
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2019-11-25 11:36:18 +01:00
njuettner
8c3fef45fd Updating golangci
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Signed-off-by: Nick Jüttner <nick@zalando.de>
2019-11-25 10:56:22 +01:00
Johann Fuechsl
120950078c Fix #89 by copying the MatchLabels map instead of referencing it. (#90)
Signed-off-by: Johann Fuechsl <johann@fuechsl.co>
2019-11-07 14:38:26 +01:00
Tomás Pinho
0790bc351a This fixes an issue with the type switch that was never able to fall (#88)
into cases of []<number>, being <number> a number type such as int,
float32, float64. This is because Go can't type cast slices of
interface{} out right because it's impossible to know the true types of
the slice members beforehand.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>
2019-11-05 09:43:25 +01:00
Tomás Pinho
f6b2aede5b Support for JSONPath expressions that return arrays of values (#85)
* This is the initial implementation of support for JSONPath expressions
that return arrays of values instead of a single value.

This extends the
collector to define a few handy reducer functions that take in the slice
of float64 and return a single value. It also allows the user to define
which reducer function to use via the
"metric-config.<metricType>.<metricName>.json-path/reducer-func"
annotation, which
can have the values of 'avg', 'min', 'max' and 'sum'.

For instance, the Ruby puma webserver exposes metrics of the form of $.worker_status[*].last_status.pool_capacity that have to be consumed as an array of values to be properly targetted.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Renames "reducerFunc" to "aggregator" for consistency with other
collectors. Renames the annotation from
"metric-config.<metricType>.<metricName>.json-path/reducer-func" to "metric-config.<metricType>.<metricName>.json-path/aggregator".

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Return error instead of defaulting to the avg aggregator, when no valid
aggregator name was specified and the JSONPath value is a slice of
numbers.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Fix index out of range on initialized output slice that was found while
writing tests.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Add tests for all added functions + NewJSONPathMetricsGetter

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Add documentation on the `aggregator` option.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* reducer function -> aggregator function

Signed-off-by: Tomás Pinho <me@tomaspinho.com>

* Fix comment to account for returned error.

Signed-off-by: Tomás Pinho <me@tomaspinho.com>
2019-10-24 18:15:10 +02:00
Mikkel Oscar Lyderik Larsen
7d5e719eb0 Merge pull request #86 from pinkavaj/fix-var-name
Fix variable name typo
2019-10-24 10:16:58 +02:00
Jiri Pinkava
7497a61a2c Fix variable name typo
Signed-off-by: Jiri Pinkava <jiri.pinkava@rossum.ai>
2019-10-24 09:45:22 +02:00
Mikkel Oscar Lyderik Larsen
a72380125f Update SECURITY.md (#84)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2019-10-22 16:11:29 +02:00
aermakov-zalando
70c7fb843d Merge pull request #83 from zalando-incubator/ingress-collector
Skipper: simplify metrics collection
2019-10-22 16:07:49 +02:00
Alexey Ermakov
79533a5a93 Skipper: simplify metrics collection
* Drop MaxWeightedCollector (we don't want max anyway, we want sum)
 * Use Prometheus to add up all matching metrics and scale them; this
   has a nice side effect of ensuring that unused hostnames don't cause
   an error when collecting the metrics
 * Update the tests a bit

Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>
2019-10-21 14:05:30 +02:00
Mikkel Oscar Lyderik Larsen
2765ff9811 Merge pull request #68 from zalando-incubator/skipper-collector-averagevalue
Add support for averageValue for request-per-second Skipper metric
2019-10-10 08:09:30 +02:00
Mikkel Oscar Lyderik Larsen
76d2f74743 Add support for averageValue for request-per-second Skipper metric
This adds support for `averageValue` for the `request-per-second` metric
based on Ingress Objects. This is only supported from Kubernetes
`>=v1.14` (https://github.com/kubernetes/kubernetes/pull/72872).

When defining the HPA with `autoscaling/v2beta1` you still need to
define `targetValue` even though it won't be used when `averageValue` is
set. Once we default to `autoscaling/v2beta2` this akward API will be
gone.

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2019-10-08 17:10:28 +02:00
Mikkel Oscar Lyderik Larsen
0de5042d3d Update dependencies (#80)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2019-10-08 16:20:47 +02:00
aermakov-zalando
07c0e179b3 Fail on dirty and/or non-exact versions on master (#79)
* Fail on dirty and/or non-exact versions on master

Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>

* Prevent go from modifying go.mod

Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>

* Fix go.mod version

Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>

* Allow non-exact tag matches

Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>
2019-10-01 11:54:37 +02:00
aermakov-zalando
29ee953a16 Merge pull request #78 from zalando-incubator/return-err
When traffic switching is used, require a backend for the RPS metric
2019-09-27 17:56:35 +02:00
Alexey Ermakov
f78ef26857 When traffic switching is used, require a backend for the RPS metric
Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>
2019-09-27 15:02:46 +02:00
Mikkel Oscar Lyderik Larsen
a3c14e9dcb Merge pull request #76 from zalando-incubator/refactor-parsing
Prevent panic when parsing HPAs
2019-08-23 09:08:07 +02:00
Mikkel Oscar Lyderik Larsen
b6b13fb31a Prevent panic when parsing HPAs
This is a slight refactoring/unification of how metric
labels/annotations are parsed and handled accross collectors. This is
done to prevent crashes when labels are not defined on external metrics.

Fix #69

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2019-08-22 08:09:28 +02:00
Mikkel Oscar Lyderik Larsen
0a06691d39 Merge pull request #75 from edganiukov/master
collector/prometheus: add Prometheus URL (optional) as an annotation in HPA
2019-08-21 09:55:10 +02:00
Eduard Ganiukov
2d1d51e829 collector/prometheus: add prometheus server (optional) as an annotation in HPA.
Signed-off-by: Eduard Ganiukov <eduard.ganiukov@swisscom.com>
2019-08-14 13:05:50 +02:00
103 changed files with 23862 additions and 1828 deletions

35
.github/CODEOWNERS vendored
View File

@ -1,35 +0,0 @@
# These owners will be the default owners for everything in
# the repo.
* @arjunrn
# Samples for assigning codeowners below:
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
# *.js @js-owner
# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
# *.go docs@example.com
# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
# /build/logs/ @doctocat
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
# docs/* docs@example.com
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
# apps/ @octocat
# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository.
# /docs/ @doctocat

14
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: monthly
time: "07:00"
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/"
schedule:
interval: monthly
time: "07:00"
open-pull-requests-limit: 10

25
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,25 @@
name: ci
on: [push, pull_request]
env:
GO111MODULE: on
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.16'
- run: go version
- run: go get github.com/mattn/goveralls
env:
GO111MODULE: off
- run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_RELEASE}
env:
GOLANGCI_RELEASE: v1.37.0
- run: make build.docker
- run: make test
- run: make check
- run: goveralls -coverprofile=profile.cov -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
build/
apiserver.local.config/
.idea/
profile.cov
vendor/

View File

@ -1,7 +1,4 @@
run:
skip-files:
- "pkg/provider/generated.conversion.go"
- "pkg/provider/conversion.go"
linters-settings:
golint:
min-confidence: 0.9

View File

@ -1,20 +0,0 @@
language: go
dist: xenial
go:
- "1.11.x"
env:
- GO111MODULE=on GOLANGCI_RELEASE="v1.16.0"
before_install:
- go get github.com/mattn/goveralls
- go get github.com/lawrencewoodman/roveralls
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_RELEASE}
script:
- make check
- make test
- make build.docker
- roveralls
- goveralls -v -coverprofile=roveralls.coverprofile -service=travis-ci

View File

@ -1,5 +1,7 @@
FROM registry.opensource.zalan.do/stups/alpine:latest
MAINTAINER Team Teapot @ Zalando SE <team-teapot@zalando.de>
FROM registry.opensource.zalan.do/library/alpine-3.12:latest
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
RUN apk add --no-cache tzdata
# add binary
ADD build/linux/kube-metrics-adapter /

View File

@ -1,3 +1,2 @@
Mikkel Larsen <mikkel.larsen@zalando.de>
Arjun Naik <arjun.naik@zalando.de>
Team Teapot <team-teapot@zalando.de>

View File

@ -8,30 +8,57 @@ SOURCES = $(shell find . -name '*.go')
DOCKERFILE ?= Dockerfile
GOPKGS = $(shell go list ./...)
BUILD_FLAGS ?= -v
OPENAPI ?= pkg/api/generated/openapi/zz_generated.openapi.go
LDFLAGS ?= -X main.version=$(VERSION) -w -s
CRD_SOURCES = $(shell find pkg/apis/zalando.org -name '*.go')
CRD_TYPE_SOURCE = pkg/apis/zalando.org/v1/types.go
GENERATED_CRDS = docs/scaling_schedules_crd.yaml
GENERATED = pkg/apis/zalando.org/v1/zz_generated.deepcopy.go
default: build.local
clean:
rm -rf build
rm -rf $(OPENAPI)
test:
go test -v $(GOPKGS)
test: $(GENERATED)
go test -v -coverprofile=profile.cov $(GOPKGS)
check:
golangci-lint run ./...
check: $(GENERATED)
go mod download
golangci-lint run --timeout=2m ./...
build.local: build/$(BINARY)
$(GENERATED): go.mod $(CRD_TYPE_SOURCE) $(OPENAPI)
./hack/update-codegen.sh
$(GENERATED_CRDS): $(GENERATED) $(CRD_SOURCES)
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1 paths=./pkg/apis/... output:crd:dir=docs || /bin/true || true
mv docs/zalando.org_clusterscalingschedules.yaml docs/cluster_scaling_schedules_crd.yaml
mv docs/zalando.org_scalingschedules.yaml docs/scaling_schedules_crd.yaml
$(OPENAPI): go.mod
go run k8s.io/kube-openapi/cmd/openapi-gen \
--go-header-file hack/boilerplate.go.txt \
--logtostderr \
-i k8s.io/metrics/pkg/apis/custom_metrics,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,k8s.io/metrics/pkg/apis/custom_metrics/v1beta2,k8s.io/metrics/pkg/apis/external_metrics,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,k8s.io/metrics/pkg/apis/metrics,k8s.io/metrics/pkg/apis/metrics/v1beta1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version,k8s.io/api/core/v1 \
-p pkg/api/generated/openapi \
-o . \
-O zz_generated.openapi \
-r /dev/null
build.local: build/$(BINARY) $(GENERATED_CRDS)
build.linux: build/linux/$(BINARY)
build.osx: build/osx/$(BINARY)
build/$(BINARY): go.mod $(SOURCES)
build/$(BINARY): go.mod $(SOURCES) $(GENERATED)
CGO_ENABLED=0 go build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" .
build/linux/$(BINARY): go.mod $(SOURCES)
build/linux/$(BINARY): go.mod $(SOURCES) $(GENERATED)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" .
build/osx/$(BINARY): go.mod $(SOURCES)
build/osx/$(BINARY): go.mod $(SOURCES) $(GENERATED)
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
build.docker: build.linux

482
README.md

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,8 @@
We acknowledge that every line of code that we write may potentially contain security issues.
We are trying to deal with it responsibly and provide patches as quickly as possible.
We are trying to deal with it responsibly and provide patches as quickly as possible. If you have anything to report to us please use the following channels:
We host our bug bounty program on HackerOne, it is currently private, therefore if you would like to report a vulnerability and get rewarded for it, please ask to join our program by filling this form:
Email: Tech-Security@zalando.de
OR
Submit your vulnerability report through our bug bounty program at: https://hackerone.com/zalando
https://corporate.zalando.com/en/services-and-contact#security-form
You can also send you report via this form if you do not want to join our bug bounty program and just want to report a vulnerability or security issue.

View File

@ -7,6 +7,8 @@ pipeline:
- /go/pkg/mod # pkg cache for Go modules
- ~/.cache/go-build # Go build cache
type: script
env:
GOFLAGS: "-mod=readonly"
commands:
- desc: test
cmd: |
@ -18,9 +20,11 @@ pipeline:
cmd: |
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter
VERSION=$(git describe --tags --always --dirty)
VERSION=$(git describe --tags --always)
else
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter-test
VERSION=$CDP_BUILD_VERSION
fi
IMAGE=$IMAGE VERSION=$VERSION make build.docker
git diff --stat --exit-code
IMAGE=$IMAGE VERSION=$VERSION make build.push

View File

@ -0,0 +1,119 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: clusterscalingschedules.zalando.org
spec:
group: zalando.org
names:
kind: ClusterScalingSchedule
listKind: ClusterScalingScheduleList
plural: clusterscalingschedules
singular: clusterscalingschedule
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: ClusterScalingSchedule describes a cluster scoped time based
metric to be used in autoscaling operations.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
properties:
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
resource. All the schedules defined here will result on the value
to the same metric. New metrics require a new ScalingSchedule resource.
items:
description: Schedule is the schedule details to be used inside
a ScalingSchedule.
properties:
date:
description: Defines the starting date of a OneTime schedule.
It has to be a RFC3339 formated date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
type: integer
period:
description: Defines the details of a Repeating schedule.
properties:
days:
description: The days that this schedule will be active.
items:
description: ScheduleDay represents the valid inputs for
days in a SchedulePeriod.
enum:
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
type: string
type: array
startTime:
description: The startTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
timezone:
description: The location name corresponding to a file in
the IANA Time Zone database, like Europe/Berlin.
type: string
required:
- days
- startTime
- timezone
type: object
type:
description: Defines if the schedule is a OneTime schedule or
Repeating one. If OneTime, date has to be defined. If Repeating,
Period has to be defined.
enum:
- OneTime
- Repeating
type: string
value:
description: The metric value that will be returned for the
defined schedule.
type: integer
required:
- durationMinutes
- type
- value
type: object
type: array
required:
- schedules
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,4 +1,4 @@
apiVersion: apiregistration.k8s.io/v1beta1
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.custom.metrics.k8s.io

View File

@ -28,6 +28,7 @@ spec:
- --prometheus-server=http://prometheus.kube-system.svc.cluster.local
- --skipper-ingress-metrics
- --aws-external-metrics
- --scaling-schedule
env:
- name: AWS_REGION
value: eu-central-1

View File

@ -1,4 +1,4 @@
apiVersion: apiregistration.k8s.io/v1beta1
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.external.metrics.k8s.io

9
docs/helm/Chart.yaml Normal file
View File

@ -0,0 +1,9 @@
apiVersion: v2
name: kube-metrics-adapter
version: 0.1.11
description: kube-metrics-adapter helm chart
home: https://github.com/zalando-incubator/kube-metrics-adapter
maintainers:
- name: The Zalando Incubator
email: opensource@zalando.de
url: https://github.com/zalando-incubator

View File

@ -0,0 +1,119 @@
{{- if .Values.scalingSchedule.enabled }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: clusterscalingschedules.zalando.org
spec:
group: zalando.org
names:
kind: ClusterScalingSchedule
listKind: ClusterScalingScheduleList
plural: clusterscalingschedules
singular: clusterscalingschedule
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: ClusterScalingSchedule describes a cluster scoped time based
metric to be used in autoscaling operations.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
properties:
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
resource. All the schedules defined here will result on the value
to the same metric. New metrics require a new ScalingSchedule resource.
items:
description: Schedule is the schedule details to be used inside
a ScalingSchedule.
properties:
date:
description: Defines the starting date of a OneTime schedule.
It has to be a RFC3339 formated date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
type: integer
period:
description: Defines the details of a Repeating schedule.
properties:
days:
description: The days that this schedule will be active.
items:
description: ScheduleDay represents the valid inputs for
days in a SchedulePeriod.
enum:
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
type: string
type: array
startTime:
description: The startTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
timezone:
description: The location name corresponding to a file in
the IANA Time Zone database, like Europe/Berlin.
type: string
required:
- days
- startTime
- timezone
type: object
type:
description: Defines if the schedule is a OneTime schedule or
Repeating one. If OneTime, date has to be defined. If Repeating,
Period has to be defined.
enum:
- OneTime
- Repeating
type: string
value:
description: The metric value that will be returned for the
defined schedule.
type: integer
required:
- durationMinutes
- type
- value
type: object
type: array
required:
- schedules
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end}}

View File

@ -0,0 +1,15 @@
{{- if .Values.enableCustomMetricsApi }}
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.custom.metrics.k8s.io
spec:
service:
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
group: custom.metrics.k8s.io
version: v1beta1
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
groupPriorityMinimum: 100
versionPriority: 100
{{- end}}

View File

@ -0,0 +1,194 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
labels:
application: kube-metrics-adapter
version: {{ .Values.registry.imageTag }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
application: kube-metrics-adapter
template:
metadata:
labels:
application: kube-metrics-adapter
version: {{ .Values.registry.imageTag }}
spec:
serviceAccountName: kube-metrics-adapter
containers:
- name: kube-metrics-adapter
image: {{ .Values.registry.image}}:{{ .Values.registry.imageTag }}
args:
{{- if .Values.addDirectoryHeader }}
- --add_dir_header={{ .Values.addDirectoryHeader }}
{{- end}}
{{- if .Values.log.alsoToStderr }}
- --alsologtostderr={{ .Values.log.alsoToStderr }}
{{- end}}
{{- if .Values.authentication.kubeConfig }}
- --authentication-kubeconfig={{ .Values.authentication.kubeConfig }}
{{- end}}
{{- if .Values.authentication.skipLookup }}
- --authentication-skip-lookup={{ .Values.authentication.skipLookup }}
{{- end}}
{{- if .Values.authentication.tokenWebhookCacheTtl }}
- --authentication-token-webhook-cache-ttl={{ .Values.authentication.tokenWebhookCacheTtl }}
{{- end}}
{{- if .Values.authentication.tolerateLookupFailure }}
- --authentication-tolerate-lookup-failure={{ .Values.authentication.tolerateLookupFailure }}
{{- end}}
{{- if .Values.authorization.alwaysAllowPaths }}
- --authorization-always-allow-paths={{ .Values.authorization.alwaysAllowPaths }}
{{- end}}
{{- if .Values.authorization.kubeConfig }}
- --authorization-kubeconfig={{ .Values.authorization.kubeConfig }}
{{- end}}
{{- if .Values.authorization.webhookCache.authorizedTtl }}
- --authorization-webhook-cache-authorized-ttl={{ .Values.authorization.webhookCache.authorizedTtl }}
{{- end}}
{{- if .Values.authorization.webhookCache.unauthorizedTtl }}
- --authorization-webhook-cache-unauthorized-ttl={{ .Values.authorization.webhookCache.unauthorizedTtl }}
{{- end}}
{{- if .Values.aws.externalMetrics }}
- --aws-external-metrics={{ .Values.aws.externalMetrics }}
{{- end}}
{{- if .Values.aws.region }}
- --aws-region={{ .Values.aws.region }}
{{- end}}
{{- if .Values.tls.certificateDirectory }}
- --cert-dir={{ .Values.tls.certificateDirectory }}
{{- end}}
{{- if .Values.tls.clientCaFile }}
- --client-ca-file={{ .Values.tls.clientCaFile }}
{{- end}}
{{- if .Values.contentionProfiling }}
- --contention-profiling={{ .Values.contentionProfiling }}
{{- end}}
{{- if .Values.credentialsDirectory }}
- --credentials-dir={{ .Values.credentialsDirectory }}
{{- end}}
{{- if .Values.disregardIncompatibleHPAs }}
- --disregard-incompatible-hpas={{ .Values.disregardIncompatibleHPAs }}
{{- end}}
{{- if .Values.enableCustomMetricsApi }}
- --enable-custom-metrics-api={{ .Values.enableCustomMetricsApi }}
{{- end}}
{{- if .Values.enableExternalMetricsApi }}
- --enable-external-metrics-api={{ .Values.enableExternalMetricsApi }}
{{- end}}
{{- if .Values.http2MaxStreamsPerConnection }}
- --http2-max-streams-per-connection={{ .Values.http2MaxStreamsPerConnection }}
{{- end}}
{{- if .Values.influxDB.address }}
- --influxdb-address={{ .Values.influxDB.address }}
{{- end}}
{{- if .Values.influxDB.organization }}
- --influxdb-org={{ .Values.influxDB.organization }}
{{- end}}
{{- if .Values.influxDB.token }}
- --influxdb-token={{ .Values.influxDB.token }}
{{- end}}
{{- if .Values.listerKubeConfig }}
- --lister-kubeconfig={{ .Values.listerKubeConfig }}
{{- end}}
{{- if .Values.log.flushFrequency }}
- --log-flush-frequency={{ .Values.log.flushFrequency }}
{{- end}}
{{- if .Values.log.backtraceAtTraceLocation }}
- --log_backtrace_at={{ .Values.log.backtraceAtTraceLocation }}
{{- end}}
{{- if .Values.log.directory }}
- --log_dir={{ .Values.log.directory }}
{{- end}}
{{- if .Values.log.file }}
- --log_file={{ .Values.log.file }}
{{- end}}
{{- if .Values.log.fileMaxSize }}
- --log_file_max_size={{ .Values.log.fileMaxSize }}
{{- end}}
{{- if .Values.log.toStderr }}
- --logtostderr={{ .Values.log.toStderr }}
{{- end}}
{{- if .Values.prometheus.metricsAddress }}
- --metrics-address={{ .Values.prometheus.metricsAddress }}
{{- end}}
{{- if .Values.profiling }}
- --profiling={{ .Values.profiling }}
{{- end}}
{{- if .Values.prometheus.server }}
- --prometheus-server={{ .Values.prometheus.server }}
{{- end}}
{{- if .Values.requestHeader.allowedNames }}
- --requestheader-allowed-names={{ .Values.requestHeader.allowedNames }}
{{- end}}
{{- if .Values.requestHeader.clientCaFile }}
- --requestheader-client-ca-file={{ .Values.requestHeader.clientCaFile }}
{{- end}}
{{- if .Values.requestHeader.extraHeadersPrefix }}
- --requestheader-extra-headers-prefix={{ .Values.requestHeader.extraHeadersPrefix }}
{{- end}}
{{- if .Values.requestHeader.groupHeaders }}
- --requestheader-group-headers={{ .Values.requestHeader.groupHeaders }}
{{- end}}
{{- if .Values.requestHeader.usernameHeaders }}
- --requestheader-username-headers={{ .Values.requestHeader.usernameHeaders }}
{{- end}}
- --secure-port={{ .Values.service.internalPort }}
{{- if .Values.log.skipHeaders }}
- --skip_headers={{ .Values.log.skipHeaders }}
{{- end}}
{{- if .Values.log.skipLogHeaders }}
- --skip_log_headers={{ .Values.log.skipLogHeaders }}
{{- end}}
{{- if .Values.skipperBackendsAnnotation }}
- --skipper-backends-annotation={{ .Values.skipperBackendsAnnotation }}
{{- end}}
{{- if .Values.skipperIngressMetrics }}
- --skipper-ingress-metrics={{ .Values.skipperIngressMetrics }}
{{- end}}
{{- if .Values.log.stderrThreshold }}
- --stderrthreshold={{ .Values.log.stderrThreshold }}
{{- end}}
{{- if .Values.tls.certFile }}
- --tls-cert-file={{ .Values.tls.certFile }}
{{- end}}
{{- if .Values.tls.cipherSuites }}
- --tls-cipher-suites={{ .Values.tls.cipherSuites }}
{{- end}}
{{- if .Values.tls.minVersion }}
- --tls-min-version={{ .Values.tls.minVersion }}
{{- end}}
{{- if .Values.tls.privateKeyFile }}
- --tls-private-key-file={{ .Values.tls.privateKeyFile }}
{{- end}}
{{- if .Values.tls.sniCertKey }}
- --tls-sni-cert-key={{ .Values.tls.sniCertKey }}
{{- end}}
{{- if .Values.token }}
- --token={{ .Values.token }}
{{- end}}
{{- if .Values.log.level }}
- --v={{ .Values.log.level }}
{{- end}}
{{- if .Values.vmodule }}
- --vmodule={{ .Values.vmodule }}
{{- end}}
{{- if .Values.zmon.kariosdbEndpoint }}
- --zmon-kariosdb-endpoint={{ .Values.zmon.kariosdbEndpoint }}
{{- end}}
{{- if .Values.zmon.tokenName }}
- --zmon-token-name={{ .Values.zmon.tokenName }}
{{- end}}
{{- if .Values.scalingSchedule.enabled }}
- --scaling-schedule
{{- end}}
resources:
limits:
cpu: {{ .Values.resources.limits.cpu }}
memory: {{ .Values.resources.limits.memory }}
requests:
cpu: {{ .Values.resources.requests.cpu }}
memory: {{ .Values.resources.requests.memory }}

View File

@ -0,0 +1,15 @@
{{- if .Values.enableExternalMetricsApi }}
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1beta1.external.metrics.k8s.io
spec:
service:
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
group: external.metrics.k8s.io
version: v1beta1
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
groupPriorityMinimum: 100
versionPriority: 100
{{- end}}

View File

@ -0,0 +1,165 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-metrics-adapter-server-resources
rules:
- apiGroups:
- custom.metrics.k8s.io
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-metrics-server-resources
rules:
- apiGroups:
- external.metrics.k8s.io
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-metrics-adapter-resource-reader
rules:
- apiGroups:
- ""
resources:
- namespaces
- pods
- services
- configmaps
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-metrics-adapter-resource-collector
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- apiGroups:
- apps
resources:
- deployments
- statefulsets
verbs:
- get
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- get
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
{{- if .Values.scalingSchedule.enabled }}
- apiGroups:
- zalando.org
resources:
- clusterscalingschedules
- scalingschedules
verbs:
- get
- list
- watch
{{- end}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hpa-controller-custom-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-metrics-adapter-server-resources
subjects:
- kind: ServiceAccount
name: horizontal-pod-autoscaler
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hpa-controller-external-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-metrics-server-resources
subjects:
- kind: ServiceAccount
name: horizontal-pod-autoscaler
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kube-metrics-adapter-auth-reader
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: custom-metrics:system:auth-delegator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kube-metrics-adapter-resource-collector
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-metrics-adapter-resource-collector
subjects:
- kind: ServiceAccount
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kube-metrics-adapter-resource-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-metrics-adapter-resource-reader
subjects:
- kind: ServiceAccount
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}

View File

@ -0,0 +1,119 @@
{{- if .Values.scalingSchedule.enabled }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: scalingschedules.zalando.org
spec:
group: zalando.org
names:
kind: ScalingSchedule
listKind: ScalingScheduleList
plural: scalingschedules
singular: scalingschedule
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: ScalingSchedule describes a namespaced time based metric to be
used in autoscaling operations.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
properties:
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
resource. All the schedules defined here will result on the value
to the same metric. New metrics require a new ScalingSchedule resource.
items:
description: Schedule is the schedule details to be used inside
a ScalingSchedule.
properties:
date:
description: Defines the starting date of a OneTime schedule.
It has to be a RFC3339 formated date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
type: integer
period:
description: Defines the details of a Repeating schedule.
properties:
days:
description: The days that this schedule will be active.
items:
description: ScheduleDay represents the valid inputs for
days in a SchedulePeriod.
enum:
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
type: string
type: array
startTime:
description: The startTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
timezone:
description: The location name corresponding to a file in
the IANA Time Zone database, like Europe/Berlin.
type: string
required:
- days
- startTime
- timezone
type: object
type:
description: Defines if the schedule is a OneTime schedule or
Repeating one. If OneTime, date has to be defined. If Repeating,
Period has to be defined.
enum:
- OneTime
- Repeating
type: string
value:
description: The metric value that will be returned for the
defined schedule.
type: integer
required:
- durationMinutes
- type
- value
type: object
type: array
required:
- schedules
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
{{- end}}

View File

@ -0,0 +1,5 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: kube-metrics-adapter
namespace: {{ .Values.namespace }}
spec:
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.internalPort }}
selector:
application: kube-metrics-adapter

97
docs/helm/values.yaml Normal file
View File

@ -0,0 +1,97 @@
namespace: kube-system
replicas: 1
registry:
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
imageTag: v0.1.10
imagePullPolicy: IfNotPresent
service:
port: 443
internalPort: 443
addDirectoryHeader:
contentionProfiling:
profiling:
enableCustomMetricsApi:
enableExternalMetricsApi:
credentialsDirectory:
disregardIncompatibleHPAs:
http2MaxStreamsPerConnection:
listerKubeConfig:
skipperBackendsAnnotation:
skipperIngressMetrics:
token:
vmodule:
authentication:
kubeConfig:
skipLookup:
tokenWebhookCacheTtl:
tolerateLookupFailure:
authorization:
kubeConfig:
alwaysAllowPaths:
webhookCache:
authorizedTtl:
unauthorizedTtl:
aws:
externalMetrics:
region:
influxDB:
address:
organization:
token:
log:
alsoToStderr:
toStderr:
flushFrequency:
backtraceAtTraceLocation:
directory:
file:
fileMaxSize:
level:
stderrThreshold:
skipHeaders:
skipLogHeaders:
prometheus:
server: http://prometheus.kube-system.svc.cluster.local
metricsAddress:
requestHeader:
allowedNames:
clientCaFile:
extraHeadersPrefix:
groupHeaders:
usernameHeaders:
tls:
skipTLSVerify: true
certificateDirectory:
clientCaFile:
certFile:
cipherSuites:
minVersion:
privateKeyFile:
sniCertKey:
zmon:
kariosdbEndpoint:
tokenName:
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
scalingSchedule:
enabled: false

View File

@ -78,6 +78,15 @@ rules:
- get
- list
- watch
- apiGroups:
- zalando.org
resources:
- clusterscalingschedules
- scalingschedules
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding

View File

@ -0,0 +1,119 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: scalingschedules.zalando.org
spec:
group: zalando.org
names:
kind: ScalingSchedule
listKind: ScalingScheduleList
plural: scalingschedules
singular: scalingschedule
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: ScalingSchedule describes a namespaced time based metric to be
used in autoscaling operations.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
properties:
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
resource. All the schedules defined here will result on the value
to the same metric. New metrics require a new ScalingSchedule resource.
items:
description: Schedule is the schedule details to be used inside
a ScalingSchedule.
properties:
date:
description: Defines the starting date of a OneTime schedule.
It has to be a RFC3339 formated date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
type: integer
period:
description: Defines the details of a Repeating schedule.
properties:
days:
description: The days that this schedule will be active.
items:
description: ScheduleDay represents the valid inputs for
days in a SchedulePeriod.
enum:
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
type: string
type: array
startTime:
description: The startTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
timezone:
description: The location name corresponding to a file in
the IANA Time Zone database, like Europe/Berlin.
type: string
required:
- days
- startTime
- timezone
type: object
type:
description: Defines if the schedule is a OneTime schedule or
Repeating one. If OneTime, date has to be defined. If Repeating,
Period has to be defined.
enum:
- OneTime
- Repeating
type: string
value:
description: The metric value that will be returned for the
defined schedule.
type: integer
required:
- durationMinutes
- type
- value
type: object
type: array
required:
- schedules
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

View File

@ -1,4 +1,4 @@
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: custom-metrics-consumer
@ -6,7 +6,7 @@ metadata:
labels:
application: custom-metrics-consumer
annotations:
# metric-config.<metricType>.<metricName>.<collectorName>/<configKey>
# metric-config.<metricType>.<metricName>.<collectorType>/<configKey>
metric-config.pods.queue-length.json-path/json-key: "$.queue.length"
metric-config.pods.queue-length.json-path/path: /metrics
metric-config.pods.queue-length.json-path/port: "9090"
@ -25,24 +25,37 @@ spec:
# - type: Resource
# resource:
# name: cpu
# targetAverageUtilization: 50
# current:
# averageUtilization: 50
- type: Pods
pods:
metricName: queue-length
targetAverageValue: 1k
metric:
name: queue-length
target:
averageValue: 1k
type: AverageValue
- type: Object
object:
metricName: requests-per-second
target:
describedObject:
apiVersion: extensions/v1beta1
kind: Ingress
name: custom-metrics-consumer
targetValue: 10 # this will be treated as targetAverageValue
metric:
name: requests-per-second
target:
averageValue: "10"
type: AverageValue
- type: External
external:
metricName: sqs-queue-length
metricSelector:
matchLabels:
queue-name: foobar
region: eu-central-1
targetAverageValue: 30
metric:
name: app-queue-length
selector:
matchLabels:
type: sqs-queue-length
queue-name: foobar
region: eu-central-1
target:
averageValue: "30"
type: AverageValue

112
go.mod
View File

@ -1,91 +1,33 @@
module github.com/zalando-incubator/kube-metrics-adapter
require (
bitbucket.org/ww/goautoneg v0.0.0-20120707110453-75cd24fc2f2c // indirect
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/BurntSushi/toml v0.3.0 // indirect
github.com/NYTimes/gziphandler v1.0.1 // indirect
github.com/PuerkitoBio/purell v1.1.0 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/Sirupsen/logrus v1.0.6 // indirect
github.com/aws/aws-sdk-go v1.16.6
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/boltdb/bolt v1.3.1 // indirect
github.com/coreos/bbolt v1.3.0 // indirect
github.com/coreos/etcd v3.3.9+incompatible // indirect
github.com/coreos/go-semver v0.2.0 // indirect
github.com/coreos/go-systemd v0.0.0-20180705093442-88bfeed483d3 // indirect
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/docker/docker v1.13.1 // indirect
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect
github.com/emicklei/go-restful v2.8.0+incompatible // indirect
github.com/emicklei/go-restful-swagger12 v0.0.0-20170926063155-7524189396c6 // indirect
github.com/evanphx/json-patch v4.1.1-0.20190203004735-bbf30d639737+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/jsonpointer v0.0.0-20180322222829-3a0015ad55fa // indirect
github.com/go-openapi/jsonreference v0.0.0-20180322222742-3fb327e6747d // indirect
github.com/go-openapi/spec v0.0.0-20180801175345-384415f06ee2 // indirect
github.com/go-openapi/swag v0.0.0-20180715190254-becd2f08beaf // indirect
github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gorilla/websocket v1.3.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.4.1 // indirect
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47 // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20190116221620-b7016fc85e1c
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852
github.com/onsi/ginkgo v1.6.0 // indirect
github.com/onsi/gomega v1.4.1 // indirect
github.com/pborman/uuid v0.0.0-20180122190007-c65b2f87fee3 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/prometheus/client_golang v0.9.0-pre1.0.20180824101016-4eb539fa85a2
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 // indirect
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 // indirect
github.com/sirupsen/logrus v1.3.0
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.2 // indirect
github.com/stretchr/testify v1.2.2
github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 // indirect
github.com/ugorji/go v1.1.1 // indirect
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect
github.com/aws/aws-sdk-go v1.39.2
github.com/go-openapi/spec v0.20.3
github.com/influxdata/influxdb-client-go v0.2.0
github.com/influxdata/line-protocol v0.0.0-20201012155213-5f565037cbc9 // indirect
github.com/kubernetes-sigs/custom-metrics-apiserver v0.0.0-20201216091021-1b9fa998bbaa
github.com/mailru/easyjson v0.7.7 // indirect
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/common v0.25.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.1.3
github.com/spyzhov/ajson v0.4.2
github.com/stretchr/testify v1.7.0
github.com/zalando-incubator/cluster-lifecycle-manager v0.0.0-20180921141935-824b77fb1f84
golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e // indirect
golang.org/x/net v0.0.0-20180824152047-4bcd98cce591 // indirect
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect
google.golang.org/appengine v1.2.0 // indirect
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 // indirect
google.golang.org/grpc v1.14.0 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.2.1 // indirect
k8s.io/api v0.0.0-20190226173710-145d52631d00
k8s.io/apimachinery v0.0.0-20190221084156-01f179d85dbc
k8s.io/apiserver v0.0.0-20190226174732-cf2f1d68202d
k8s.io/client-go v2.0.0-alpha.0.0.20190226174127-78295b709ec6+incompatible
k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c // indirect
k8s.io/metrics v0.0.0-20190226180357-f3f09b9076d1
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.20.5
k8s.io/apimachinery v0.20.5
k8s.io/apiserver v0.20.5
k8s.io/client-go v0.20.5
k8s.io/code-generator v0.20.5
k8s.io/component-base v0.20.5
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
k8s.io/metrics v0.20.5
sigs.k8s.io/controller-tools v0.5.0
)
go 1.16

Some files were not shown because too many files have changed in this diff Show More