535 Commits

Author SHA1 Message Date
Mikkel Oscar Lyderik Larsen
37969486fe
Merge pull request #448 from zalando-incubator/multi-arch-image
Build multi-arch image
2022-06-28 11:52:25 +02:00
Mikkel Oscar Lyderik Larsen
1be6357c8e Build multi-arch image
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-06-24 23:34:31 +02:00
Katyanna Moura
7b592c6832
Merge pull request #447 from zalando-incubator/ingress-upgrade-v1
Limit ingress support to only networking.k8s.io/v1
v0.1.19
2022-06-22 11:12:21 +02:00
Katyanna Moura
203aaeafb9 Update supported K8s version for skipper-collector
Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2022-06-22 10:27:35 +02:00
Katyanna Moura
5926f1aea1 Limit ingress support to only networking.k8s.io/v1
Given the deprecation of extensions/v1beta1, remove it from Ingress possibilities.

Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2022-06-21 12:46:08 +02:00
Sandor Szücs
be1e1c635d
Create codeql-analysis.yml (#446)
Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2022-06-09 11:52:46 +02:00
Mikkel Oscar Lyderik Larsen
094a9f9b9d
Merge pull request #443 from zalando-incubator/update-deps-2022-06
Update dependencies + fix CI build
2022-06-01 16:03:37 +02:00
Mikkel Oscar Lyderik Larsen
47d34b328c Update dependencies + fix CI build
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-06-01 12:16:11 +02:00
owengo
4b5b96084b
adding nodeSelector + tolerations + affinity + priorityClassName + podAnnotations to helm chart (#421)
Signed-off-by: Olivier Schiavo <olivier.schiavo@wengo.com>

Co-authored-by: Olivier Schiavo <olivier.schiavo@wengo.com>
2022-05-02 16:02:24 +02:00
Mikkel Oscar Lyderik Larsen
18f4c82f07
Update dependencies and default to Go 1.18 (#419)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-05-02 15:57:34 +02:00
Mikkel Oscar Lyderik Larsen
10dc42b9e9
Merge pull request #401 from zalando-incubator/update-deps-02-14
Update dependencies
v0.1.18
2022-02-14 15:05:19 +01:00
Mikkel Oscar Lyderik Larsen
20db592a62
Use cdp-runtime for build (#398)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-02-14 14:41:57 +01:00
Mikkel Oscar Lyderik Larsen
d0a3ea1934
Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-02-14 14:36:06 +01:00
Mikkel Oscar Lyderik Larsen
837e7b9c5d
Update deps 2022 02 (#391)
* Update example

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

* Update dependencies 2022-02

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-02-01 18:13:48 +01:00
Katyanna Moura
9d8359b580
Merge pull request #380 from zalando-incubator/fix-metrics-map
Fix panic when trying to add key to nil map
2022-01-12 11:36:53 +01:00
Katyanna Moura
71a8e99d1f Fix panic when trying to add key to nil map
Bug was introduced trying to solved the following issue:
> When scenarios where two HPAs reference the same object but have
different metric calculation (e.g. ingresses with different weights),
kube-metrics-adapter calculates the two metrics but always overrides
one of the metrics when saving it to the store.

This commit fixes a issue where without the added `return` the system
was continuing in an invalid states where `labels2metric` wasn't
properly initialized, causing the system to panic.

Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2022-01-12 11:29:38 +01:00
Katyanna Moura
4d4c70c553 Fix test filename to match related file
Having the test filename prefix exactly as the tested file name helps systems
to identify the correlation.

Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2022-01-12 11:29:38 +01:00
Katyanna Moura
2ccd6903d9
Merge pull request #376 from zalando-incubator/custommetricsselector
Use labels hash in the custom metrics store and metrics store 💅
2021-11-25 10:24:44 +01:00
Jonathan Juares Beber
f58db31f98 Define stronger types for metrics store
The metrics store, both the custom and external one, make heavy usage of
maps of strings to strings. This leads to a presumable confusing or at
least hard to read codebase.

This commit tries to increase readability and maintainability of the
metric stores by using custom types. This commit has no effect in
performance or functionality, it's pure aesthetics.

Co-authored-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2021-11-24 17:41:03 +01:00
Jonathan Juares Beber
0bf8f5dd0f
Use labels hash in the custom metrics store
The current implementation of the metrics store for custom metrics uses
just the object name as key. When scenarios where two HPAs reference the
same object but have different metric calculation (e.g. ingresses with
different weights), kube-metrics-adapter calculates the two metrics but
always overrides one of the metrics when saving it to the store.

This commit implements the use of a labels hash in the custom metrics
store. This way, metrics are identified not just by the referenced
object, but also by its selectors.

Co-authored-by: Katyanna Moura <amelie.kn@gmail.com>
Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-11-23 18:11:18 +01:00
Jonathan Juares Beber
e600557636
Merge pull request #375 from zalando-incubator/kube1.21
Upgrade Kubernetes and its friends to 1.21
v0.1.17
2021-10-28 10:35:11 +02:00
Jonathan Juares Beber
0f06db7cdf
Upgrade Kubernetes and its friends to 1.21
This commit upgrades all the Kubernetes dependencies to 1.21.5. It
includes regenerated clients and specs.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-10-27 20:58:18 +02:00
Jonathan Juares Beber
1c9038b2cc
Merge pull request #374 from zalando-incubator/configurable-buckets
Make the number of ramp steps configurable
v0.1.16
2021-10-25 10:21:32 +02:00
Jonathan Juares Beber
fd4ead837e
Make the number of ramp steps configurable
In #371 we introduced steps to make the scaling up possible even when
the HPA forces a 10% change. The problem is that 10% might not be
sufficient for some specific scaling scenarios.

For example, a an application targeting 12 pods and using a
ScalingSchedule with the value of 10000 to achieve that, will require a
target of 833. With 10 ramp steps the 90% bucket will return a metric of
9000 and the HPA calculates (9000/833) 10.8 pods, rounding to 11 pods.
Once the metric reaches the time to return 100% it will won't be
effective, since the change of the current number of pods (11) and the
desired one (12) is less than 10%.

This commit does not try to tackle this problem completely, since the
10% rule is not fixed, might change among different clusters and is also
dependent on the value given to each ScalingSchedule. Therefore, this
commit makes the number of ramp steps configurable via the
`--scaling-schedule-ramp-steps` config flag, defaulting to 10.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-10-22 15:35:11 +02:00
Mikkel Oscar Lyderik Larsen
f46f801811
Merge pull request #373 from zalando-incubator/json-path-array
Handle more complex array in json path
2021-10-19 10:04:04 +02:00
Mikkel Oscar Lyderik Larsen
4acdf72ef7
Handle more complex array in json path
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-10-14 09:34:15 +02:00
Jonathan Juares Beber
e04cd10bfc
Merge pull request #371 from zalando-incubator/scaling-chunks
Use 10 buckets on ScalingSchedule ramp-up/down
v0.1.15
2021-10-01 10:39:57 +02:00
Jonathan Juares Beber
8fe330941a
Use 10 buckets on ScalingSchedule ramp-up/down
The HPA has a feature to do not scale up and down when the change in the
metric is less than 10%:

> We'll skip scaling if the ratio is sufficiently close to 1.0 (within a
> globally-configurable tolerance, from the
> `--horizontal-pod-autoscaler-tolerance` flag, which defaults to 0.1.

It could lead to pods scaling up to 10% less than the target for
ScalingSchedules and then not scaling to the actual value if the metric
calculated before was less than 10% of the target.

This commit uses 10 fixed buckets for scaling, this way we know the
metric returned during a scaling event is at least 10% more than a
previous one calculated during the period of ramp up. The same is valid
for the scaling down during a ramp-down

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-09-30 19:01:59 +02:00
aermakov-zalando
0730c6ef1e
Merge pull request #370 from zalando-incubator/schedule-scaling-window
Scheduled scaling: scale up/down slowly
v0.1.14
2021-09-24 15:47:44 +02:00
Alexey Ermakov
c5411c74b7 Scheduled scaling: add an optional scaling window
Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>
2021-09-24 15:33:49 +02:00
aermakov-zalando
4ba6b66441
Merge pull request #369 from zalando-incubator/fix-list
Fix the type for ClusterScalingScheduleList
v0.1.13
2021-09-17 11:37:47 +02:00
Alexey Ermakov
0dbe769e1b Fix the type for ClusterScalingScheduleList
Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>
2021-09-17 11:29:52 +02:00
Mikkel Oscar Lyderik Larsen
582a78d4ec
Merge pull request #350 from zalando-incubator/backend-tag
Use labels for specifying Ingress/RouteGroup backend
v0.1.12
2021-08-20 11:31:00 +02:00
Mikkel Oscar Lyderik Larsen
481df883e5
Merge pull request #349 from zalando-incubator/rg-support
Add support for scaling based on RouteGroup resource
2021-08-20 11:30:10 +02:00
Mikkel Oscar Lyderik Larsen
318d47e05e
Add deprecation comment
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-08-20 09:33:18 +02:00
Mikkel Oscar Lyderik Larsen
190f0db092
Use labels for specifying Ingress/RouteGroup backend
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-08-20 09:33:17 +02:00
Mikkel Oscar Lyderik Larsen
c618494177
return early if backendName is empty
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-08-20 09:32:48 +02:00
Mikkel Oscar Lyderik Larsen
a08860d06c
rename function
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-08-20 09:22:06 +02:00
Mikkel Oscar Lyderik Larsen
6b0afe5180
Add support for scaling based on RouteGroup resource
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-08-19 18:28:58 +02:00
Mikkel Oscar Lyderik Larsen
9722e38f62
Re-generate for go 1.17
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2021-08-19 18:28:57 +02:00
Mikkel Oscar Lyderik Larsen
35aa03c771
Merge pull request #368 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.40.22
Bump github.com/aws/aws-sdk-go from 1.40.12 to 1.40.22
2021-08-16 11:51:34 +02:00
dependabot[bot]
34c833e04a
Bump github.com/aws/aws-sdk-go from 1.40.12 to 1.40.22
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.40.12 to 1.40.22.
- [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.40.12...v1.40.22)

---
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-08-16 09:14:16 +00:00
Jonathan Juares Beber
c93c1dd7bb
Merge pull request #343 from zalando-incubator/dependabot/go_modules/github.com/prometheus/client_golang-1.11.0
Bump github.com/prometheus/client_golang from 1.10.0 to 1.11.0
2021-08-16 11:04:47 +02:00
dependabot[bot]
59d39bc51c
Bump github.com/prometheus/client_golang from 1.10.0 to 1.11.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.10.0 to 1.11.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.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 08:28:17 +00:00
Jonathan Juares Beber
4066e450e5
Merge pull request #360 from zalando-incubator/k8s-update
Update k8s dependencies
2021-08-11 10:18:31 +02:00
Jonathan Juares Beber
8415373f3d
Update dependencies
this commit updates the k8s dependencies from v0.20.5 to v0.20.9. It
also bundles other dependencies updates.

Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
2021-08-11 08:26:00 +02:00
Jonathan Juares Beber
d1969a3020
Merge pull request #348 from zalando-incubator/pitr-zmon
fixes for ZMON client
v0.1.11
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