Compare commits

..

154 Commits

Author SHA1 Message Date
5a543781d7 Introduce context for collector interface
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-05-21 14:00:31 +02:00
ca8592013c Merge pull request #712 from zalando-incubator/aws-sdk-v2
Update to aws-sdk-go-v2
2024-05-21 13:40:51 +02:00
63517ebf70 Update to aws-sdk-go-v2
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-05-21 12:46:22 +02:00
5c942b9245 Merge pull request #711 from johnzheng1975/patch-2
Update README.md -- add kubernetes installation
2024-05-16 10:22:39 +02:00
e49845dc93 Update README.md -- add kubernetes installation
update Readme.md, for adding kubernetes installation
 Signed-off-by: John Zheng<john.zheng@hp.com>

Signed-off-by: John <john.zheng@hp.com>
2024-05-16 06:19:51 +00:00
f55afc0905 Merge pull request #708 from zalando-incubator/fix-apiserver-setup
Fix custom apiserver setup
2024-05-13 15:51:02 +02:00
04f350698f Fix apiserver setup
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-05-13 15:32:10 +02:00
cafe11a109 Merge pull request #707 from zalando-incubator/kubernetes-v1.29
Update to Kubernetes v1.29
2024-05-13 11:06:13 +02:00
d74b7a1632 Update to Kubernetes v1.29
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-05-13 10:41:51 +02:00
460ed1bd4c Merge pull request #706 from zalando-incubator/dependabot/go_modules/golang.org/x/oauth2-0.20.0
Bump golang.org/x/oauth2 from 0.18.0 to 0.20.0
2024-05-07 10:35:24 +02:00
8831ac62d2 Bump golang.org/x/oauth2 from 0.18.0 to 0.20.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.18.0 to 0.20.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.18.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 08:14:41 +00:00
ae5c2a538a Merge pull request #704 from zalando-incubator/dependabot/go_modules/github.com/szuecs/routegroup-client-0.28.2
Bump github.com/szuecs/routegroup-client from 0.28.1 to 0.28.2
2024-05-06 10:12:42 +02:00
68bd36ed7b Bump github.com/szuecs/routegroup-client from 0.28.1 to 0.28.2
Bumps [github.com/szuecs/routegroup-client](https://github.com/szuecs/routegroup-client) from 0.28.1 to 0.28.2.
- [Release notes](https://github.com/szuecs/routegroup-client/releases)
- [Commits](https://github.com/szuecs/routegroup-client/compare/v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: github.com/szuecs/routegroup-client
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 07:39:13 +00:00
7cd565c100 Bump golang.org/x/net from 0.23.0 to 0.24.0 (#703)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.24.0.
- [Commits](https://github.com/golang/net/compare/v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 09:38:15 +02:00
8f0b25517c Bump github.com/aws/aws-sdk-go from 1.51.11 to 1.51.32 (#705)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.51.11 to 1.51.32.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG_PENDING.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.51.11...v1.51.32)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 09:37:57 +02:00
c8372976e6 Bump golang.org/x/sync from 0.6.0 to 0.7.0 (#699)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.6.0 to 0.7.0.
- [Commits](https://github.com/golang/sync/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 09:37:24 +02:00
dcedc0c17e Merge pull request #695 from zalando-incubator/kubernetes-v1.28
Update to Kubernetes v1.28
2024-04-17 13:30:12 +02:00
f1a2e80d15 Update to Kubernetes v1.28
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-04-17 12:27:35 +02:00
2f9aefc4e7 Merge pull request #390 from zalando-incubator/dependabot/go_modules/github.com/influxdata/influxdb-client-go-1.4.0
Bump github.com/influxdata/influxdb-client-go from 0.2.0 to 1.4.0
2024-04-09 15:32:42 +02:00
63120a8c1e Remove pointer for influxDBClient
Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2024-04-09 11:46:02 +02:00
dcf686b9c5 make test changes
Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2024-04-03 17:02:05 +02:00
77a04c49b6 Update querying
Signed-off-by: Katyanna Moura <amelie.kn@gmail.com>
2024-04-03 16:38:54 +02:00
b237f5a9d2 Bump github.com/influxdata/influxdb-client-go from 0.2.0 to 1.4.0
Bumps [github.com/influxdata/influxdb-client-go](https://github.com/influxdata/influxdb-client-go) from 0.2.0 to 1.4.0.
- [Release notes](https://github.com/influxdata/influxdb-client-go/releases)
- [Changelog](https://github.com/influxdata/influxdb-client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/influxdata/influxdb-client-go/compare/v0.2.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/influxdata/influxdb-client-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-03 16:38:33 +02:00
136d31e97f Merge pull request #692 from zalando-incubator/dependabot/go_modules/github.com/szuecs/routegroup-client-0.28.1
Bump github.com/szuecs/routegroup-client from 0.25.0 to 0.28.1
2024-04-03 16:35:45 +02:00
4d4d5d44bf Merge pull request #693 from zalando-incubator/dependabot/go_modules/google.golang.org/grpc-1.57.1
Bump google.golang.org/grpc from 1.57.0 to 1.57.1
2024-04-03 16:35:27 +02:00
a46a544bce Bump google.golang.org/grpc from 1.57.0 to 1.57.1
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.57.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.57.0...v1.57.1)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-03 13:54:49 +00:00
ea4a3eb421 Bump github.com/szuecs/routegroup-client from 0.25.0 to 0.28.1
Bumps [github.com/szuecs/routegroup-client](https://github.com/szuecs/routegroup-client) from 0.25.0 to 0.28.1.
- [Release notes](https://github.com/szuecs/routegroup-client/releases)
- [Commits](https://github.com/szuecs/routegroup-client/compare/v0.25.0...v0.28.1)

---
updated-dependencies:
- dependency-name: github.com/szuecs/routegroup-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-03 13:53:47 +00:00
897fcdd423 Merge pull request #683 from Demonware/master
Adding Argo Rollouts object support for pod label selector
2024-04-03 15:52:17 +02:00
61e5cde106 use background context in pod connector test
Signed-off-by: daftping <21245083+daftping@users.noreply.github.com>
2024-04-02 02:46:34 -07:00
f9141fd882 adding Argo Rollouts object support for pod label selector
Signed-off-by: daftping <21245083+daftping@users.noreply.github.com>
2024-04-02 02:38:14 -07:00
aece0b5efa Merge pull request #688 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.51.11
Bump github.com/aws/aws-sdk-go from 1.50.38 to 1.51.11
2024-04-02 11:05:03 +02:00
856ce2c391 Merge pull request #685 from zalando-incubator/dependabot/go_modules/github.com/spyzhov/ajson-0.9.1
Bump github.com/spyzhov/ajson from 0.9.0 to 0.9.1
2024-04-02 11:04:41 +02:00
66b324bb30 Bump github.com/aws/aws-sdk-go from 1.50.38 to 1.51.11
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.50.38 to 1.51.11.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.50.38...v1.51.11)

---
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>
2024-04-01 07:24:24 +00:00
c765317359 Bump github.com/spyzhov/ajson from 0.9.0 to 0.9.1
Bumps [github.com/spyzhov/ajson](https://github.com/spyzhov/ajson) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/spyzhov/ajson/releases)
- [Commits](https://github.com/spyzhov/ajson/compare/v0.9.0...v0.9.1)

---
updated-dependencies:
- dependency-name: github.com/spyzhov/ajson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 07:23:37 +00:00
c973a9e712 Merge pull request #680 from zalando-incubator/kubernetes-v1.27
Update to Kubernetes v1.27
2024-03-25 11:43:31 +01:00
ef26f47884 Update to Kubernetes v1.27
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-03-25 11:31:46 +01:00
2ec9b26ec8 Merge pull request #675 from zalando-incubator/dependabot/go_modules/github.com/szuecs/routegroup-client-0.25.0
Bump github.com/szuecs/routegroup-client from 0.24.0 to 0.25.0
2024-03-01 12:06:32 +01:00
7cc533c892 Bump github.com/szuecs/routegroup-client from 0.24.0 to 0.25.0
Bumps [github.com/szuecs/routegroup-client](https://github.com/szuecs/routegroup-client) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/szuecs/routegroup-client/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: github.com/szuecs/routegroup-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 10:44:45 +00:00
c9ab7402c5 Merge pull request #677 from zalando-incubator/dependabot/go_modules/golang.org/x/oauth2-0.17.0
Bump golang.org/x/oauth2 from 0.16.0 to 0.17.0
2024-03-01 11:43:26 +01:00
0e22243de6 Bump golang.org/x/oauth2 from 0.16.0 to 0.17.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 07:45:46 +00:00
91acacb4f4 Merge pull request #669 from zalando-incubator/update-deps-2024-02
Update deps
2024-02-01 15:16:20 +01:00
0678ef1131 Update to Kubernetes v1.25
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-02-01 15:01:55 +01:00
130c67cdf1 Merge pull request #659 from zalando-incubator/rps-metric-typo
Fix typo on metric annotation for external RPS metric
2024-01-19 10:54:25 +01:00
1661d7c4bc Fix typo on metric annotation for external RPS metric
Signed-off-by: Lucas Thiesen <lucassthiesen@gmail.com>
2024-01-19 10:38:28 +01:00
905cf8a06f Merge pull request #658 from zalando-incubator/update-deps-2024-01
Update dependencies
2024-01-02 10:24:50 +01:00
15ceeb7316 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2024-01-02 10:17:40 +01:00
776ee93d4d Merge pull request #649 from dilinade/hpa-example-fix
change apiVersion for k8s autoscaling
2023-12-15 17:30:23 +01:00
99a194fe1a change apiVersion for k8s autoscaling
Signed-off-by: Dilina <macowtdy@gmail.com>

Signed-off-by: dilinade <nisalya@gmail.com>
2023-12-14 22:01:31 +00:00
7a63a04668 Merge pull request #646 from zalando-incubator/fix-nakadi-table
Fix table for nakadi docs
2023-12-12 15:08:13 +01:00
8190553285 Fix type for value target
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-12-08 17:02:21 +01:00
cb43919967 Fix table for nakadi docs
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-12-07 16:50:40 +01:00
49f9f5ffe0 Merge pull request #636 from zalando-incubator/nakadi-collector
Add support for scaling based on Nakadi
2023-12-07 12:12:13 +01:00
43dd2e9741 Update wording in README
Co-authored-by: Andrey <andrey.dyachkov@gmail.com>
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-12-07 10:30:43 +01:00
4aeebc853c Add support for scaling based on Nakadi
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-12-04 17:20:15 +01:00
45a09c12a0 Merge pull request #640 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.48.10
Bump github.com/aws/aws-sdk-go from 1.47.0 to 1.48.10
2023-12-04 14:15:28 +01:00
789c2dee79 Merge pull request #642 from zalando-incubator/dependabot/go_modules/golang.org/x/net-0.19.0
Bump golang.org/x/net from 0.17.0 to 0.19.0
2023-12-04 14:15:00 +01:00
bbe5a8a1f7 Merge pull request #645 from zalando-incubator/dependabot/go_modules/golang.org/x/sync-0.5.0
Bump golang.org/x/sync from 0.4.0 to 0.5.0
2023-12-04 14:14:39 +01:00
32e9a39be0 Merge pull request #637 from zalando-incubator/dependabot/go_modules/github.com/spf13/cobra-1.8.0
Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
2023-12-04 14:13:47 +01:00
afea8de1d9 Bump golang.org/x/sync from 0.4.0 to 0.5.0
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.4.0 to 0.5.0.
- [Commits](https://github.com/golang/sync/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 07:34:01 +00:00
a17ad004d3 Bump golang.org/x/net from 0.17.0 to 0.19.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.17.0 to 0.19.0.
- [Commits](https://github.com/golang/net/compare/v0.17.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 07:33:34 +00:00
ec77258ba4 Bump github.com/aws/aws-sdk-go from 1.47.0 to 1.48.10
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.47.0 to 1.48.10.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.47.0...v1.48.10)

---
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>
2023-12-01 07:33:16 +00:00
3ef92536c1 Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 07:32:32 +00:00
ae5c4af76f Bump github.com/aws/aws-sdk-go from 1.45.27 to 1.47.0 (#634) 2023-11-01 09:34:13 +01:00
b130ce5fa7 Merge pull request #629 from zalando-incubator/dependabot/go_modules/google.golang.org/grpc-1.56.3
Bump google.golang.org/grpc from 1.55.0 to 1.56.3
2023-10-26 14:35:47 +02:00
8cd076b01d Bump google.golang.org/grpc from 1.55.0 to 1.56.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.55.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.55.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-25 22:38:46 +00:00
15cffaee88 Merge pull request #628 from zalando-incubator/ghrc-io
Use ghcr.io in example
2023-10-24 11:57:59 +02:00
82a96580a2 Use ghcr.io in example
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-10-19 14:55:01 +02:00
08825c4920 Merge pull request #627 from zalando-incubator/update-deps-2023-10-18
Update dependencies
2023-10-18 06:28:57 -07:00
ac3c500d84 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-10-18 15:12:04 +02:00
656a05fe07 Merge pull request #626 from zalando-incubator/dependabot/go_modules/golang.org/x/net-0.17.0
Bump golang.org/x/net from 0.16.0 to 0.17.0
2023-10-17 05:13:41 -07:00
e54f3b88cf Enable pushing to ghcr.io on merge to master (#625)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-10-12 16:02:54 +02:00
f5124993a2 Bump golang.org/x/net from 0.16.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-11 23:25:05 +00:00
7c1339a6f2 Merge pull request #620 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.45.24
Bump github.com/aws/aws-sdk-go from 1.45.12 to 1.45.24
2023-10-10 17:15:53 +02:00
fc2f6aa5df Merge pull request #622 from zalando-incubator/dependabot/go_modules/golang.org/x/oauth2-0.13.0 2023-10-10 15:15:30 +00:00
7448688788 Bump github.com/aws/aws-sdk-go from 1.45.12 to 1.45.24
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.12 to 1.45.24.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.12...v1.45.24)

---
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>
2023-10-10 11:52:51 +00:00
0e1302a97e Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.12.0 to 0.13.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-10 11:52:45 +00:00
749c1a7e25 Merge pull request #621 from zalando-incubator/dependabot/go_modules/golang.org/x/net-0.16.0
Bump golang.org/x/net from 0.15.0 to 0.16.0
2023-10-10 13:51:05 +02:00
e7eb21a773 Merge pull request #623 from zalando-incubator/dependabot/go_modules/golang.org/x/sync-0.4.0 2023-10-10 11:49:53 +00:00
2c3247bf57 Bump golang.org/x/sync from 0.3.0 to 0.4.0
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.3.0 to 0.4.0.
- [Commits](https://github.com/golang/sync/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 11:06:02 +00:00
6860217a71 Bump golang.org/x/net from 0.15.0 to 0.16.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/net/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-09 11:05:37 +00:00
a66ce04128 Merge pull request #618 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.45.19
Bump github.com/aws/aws-sdk-go from 1.45.12 to 1.45.19
2023-10-09 13:04:22 +02:00
9eabbd53d9 Merge pull request #619 from zalando-incubator/dependabot/go_modules/github.com/prometheus/client_golang-1.17.0
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
2023-10-09 13:04:01 +02:00
ec8622c028 Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.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>
2023-10-01 07:36:31 +00:00
166865edbb Bump github.com/aws/aws-sdk-go from 1.45.12 to 1.45.19
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.12 to 1.45.19.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.12...v1.45.19)

---
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>
2023-10-01 07:36:07 +00:00
85f1c3e13d Merge pull request #617 from zalando-incubator/base-image
Use latest base image
2023-09-19 16:36:54 +02:00
1a5297d6b2 Use latest base image
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-09-19 16:19:31 +02:00
be0e0d485e Merge pull request #610 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.45.12
Bump github.com/aws/aws-sdk-go from 1.45.1 to 1.45.12
2023-09-19 15:07:01 +02:00
a07eb0b79c Merge pull request #614 from zalando-incubator/dependabot/go_modules/golang.org/x/oauth2-0.12.0
Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0
2023-09-19 15:06:52 +02:00
34dc968e77 Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-19 11:06:27 +00:00
9174f2550a Bump github.com/aws/aws-sdk-go from 1.45.1 to 1.45.12
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.1 to 1.45.12.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.1...v1.45.12)

---
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>
2023-09-19 11:05:01 +00:00
6c4dfd682b Merge pull request #607 from zalando-incubator/update-deps-2023-09
Update to Kubernetes v1.24.17
2023-09-19 13:03:53 +02:00
aa3f8ab969 Merge pull request #598 from zalando-incubator/build-ghrc-images
Setup multi-arch container build to ghcr
2023-09-19 12:13:26 +02:00
437bca4de8 Update to Kubernetes v1.24.17
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-09-01 12:13:56 +02:00
c2fe13d21d Setup container build to ghcr
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-08-13 15:32:19 +02:00
bbfd982fb6 Merge pull request #591 from zalando-incubator/dependabot/go_modules/github.com/spyzhov/ajson-0.9.0
Bump github.com/spyzhov/ajson from 0.8.0 to 0.9.0
2023-08-01 10:18:39 +02:00
e9112a7114 Merge pull request #590 from zalando-incubator/dependabot/go_modules/github.com/aws/aws-sdk-go-1.44.313
Bump github.com/aws/aws-sdk-go from 1.44.299 to 1.44.313
2023-08-01 10:18:26 +02:00
2c526dd498 Bump github.com/spyzhov/ajson from 0.8.0 to 0.9.0
Bumps [github.com/spyzhov/ajson](https://github.com/spyzhov/ajson) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/spyzhov/ajson/releases)
- [Commits](https://github.com/spyzhov/ajson/compare/v0.8.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-01 07:23:34 +00:00
29b782160d Bump github.com/aws/aws-sdk-go from 1.44.299 to 1.44.313
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.299 to 1.44.313.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.299...v1.44.313)

---
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>
2023-08-01 07:22:54 +00:00
28f3d96061 Merge pull request #588 from zalando-incubator/update-deps-2023-07-13
Update dependencies
2023-07-13 17:26:40 +02:00
24b7276282 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-07-13 17:05:57 +02:00
542d90d9fe Merge pull request #577 from zalando-incubator/update-golangci-lint-cfg
Update golangci-lint config
2023-06-30 09:24:57 +02:00
0f359920af Update golangci-lint config
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-06-30 09:08:14 +02:00
54e2d2d564 Merge pull request #576 from AlexanderYastrebov/fix-codespell-typos
all: fix typos discovered by codespell
2023-06-12 13:48:47 +02:00
16ec43c361 all: fix typos discovered by codespell
```
codespell --skip .git | less
```

See https://github.com/codespell-project/codespell

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
2023-06-12 11:48:39 +02:00
ffcbfcee48 Merge pull request #574 from zalando-incubator/update-deps-2023-06-01
Update dependencies
2023-06-01 14:00:05 +02:00
69f95534e8 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-06-01 13:48:06 +02:00
c2179a35ba Merge pull request #552 from zalando-incubator/hostname-rps-collector
Add hostname RPS metric collector
2023-05-26 11:13:42 +02:00
35e3fe83e8 Update README.md
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-05-25 10:14:53 +02:00
69df60e724 Update flags with new metric collector name
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:58:29 +02:00
d171e049bf Update documentation with new metric name
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:55:20 +02:00
b89ca19e6a Rename collector to external RPS
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:38 +02:00
a276b64576 Fix error string warnings
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:38 +02:00
ff6d479f1a Compile regex at plugin level for time optimization
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:38 +02:00
cd986058e4 Delete unwanted comments
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:38 +02:00
d6a33fed63 Update documentation for multi hostnames per metric and weight param
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:38 +02:00
b8532b756b Update HPA to autoscaling/v2 in new collectors
Reference links: https://github.com/zalando-incubator/kube-metrics-adapter/pull/551

Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:37 +02:00
f28653de74 Use regexp.Compile to avoid performance problems
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:37 +02:00
2f5d3f5a42 Change hostname collector type to requests-per-second
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:37 +02:00
153d754353 Add support for traffic weight specification
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:37 +02:00
02ec2282ab Add multi hostname per metric support
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:37 +02:00
65dd585813 Add documentation regarding hostname-rps collector to readme
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:36 +02:00
aa7b64e637 Add hostname RPS metric collector
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:36 +02:00
7633ac551e Extract fake controller to use it in other tests
Signed-off-by: Lucas Thiesen <lucas.thiesen@zalando.de>
2023-05-23 15:46:36 +02:00
a103a3295e Merge pull request #563 from antoinedeschenes/helm-use-image-0.2.0 2023-05-12 23:23:44 +02:00
f63915f7ff helm: bump app version to v0.2.0
Signed-off-by: Antoine Deschênes <antoine.deschenes@linux.com>
2023-05-12 10:26:06 -04:00
c4a1e08fdf Update HPA to autoscaling/v2 apiVersion (#551) 2023-05-03 23:01:19 +02:00
61e0336247 Merge pull request #562 from zalando-incubator/update-deps-2023-05-01
Update dependencies
2023-05-02 10:09:20 +02:00
2492bdf5c1 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-05-02 09:19:36 +02:00
88b7d747d1 Merge pull request #549 from zalando-incubator/scaling-schedule-status
Add scaling schedule controller to updating status
2023-04-12 11:51:53 +02:00
0794873fcb Add scaling schedule controller to updating status
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-04-06 17:53:35 +02:00
e2a922f110 Move generic functions to controller package
Move defaultTimeZone to a flag.

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-04-06 17:53:17 +02:00
b631a4fe08 Update dependencies (#548)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-04-03 10:03:24 +02:00
90fea54307 Merge pull request #539 from zalando-incubator/chart-release
added chart release workflow
2023-03-16 13:39:11 +01:00
8b6a54627d added chart release workflow
Signed-off-by: Sebastien THOMAS <sebastien.thomas@wunderkind.co>
2023-03-13 22:45:37 +01:00
75738f1eb7 Merge pull request #538 from zalando-incubator/update-deps-2023-03-01
Update dependencies
2023-03-01 13:59:48 +01:00
d8934ebbc1 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-03-01 13:26:19 +01:00
17bef811f3 Merge pull request #528 from zalando-incubator/dependabot/go_modules/github.com/emicklei/go-restful-2.16.0incompatible
Bump github.com/emicklei/go-restful from 2.15.0+incompatible to 2.16.0+incompatible
2023-02-09 17:44:13 +01:00
7a041c991a Bump github.com/emicklei/go-restful
Bumps [github.com/emicklei/go-restful](https://github.com/emicklei/go-restful) from 2.15.0+incompatible to 2.16.0+incompatible.
- [Release notes](https://github.com/emicklei/go-restful/releases)
- [Changelog](https://github.com/emicklei/go-restful/blob/v3/CHANGES.md)
- [Commits](https://github.com/emicklei/go-restful/compare/v2.15.0...v2.16.0)

---
updated-dependencies:
- dependency-name: github.com/emicklei/go-restful
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-09 16:00:27 +00:00
979ae68eab Merge pull request #527 from zalando-incubator/update-deps-2023-02-01
Update dependencies
2023-02-01 15:51:19 +01:00
e9a209aa31 Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-02-01 15:25:58 +01:00
838edd9082 Update dependencies 2023-01-02 (#516)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2023-01-02 18:13:28 +01:00
c50d9ccd18 Merge pull request #506 from zalando-incubator/fix-null-pointer
Fix nil pointer dereference
2022-12-21 15:48:01 +01:00
c60253e90c add test for end date in incorrect format
Signed-off-by: zlawrence <zak.lawrence@zalando.de>
2022-12-21 14:08:44 +01:00
680e0feea1 fix nil pointer dereference
Signed-off-by: zlawrence <zak.lawrence@zalando.de>
2022-12-21 14:08:41 +01:00
070f9ab299 Merge pull request #505 from zalando-incubator/update-scalingschedule-config
Update scalingschedule config
2022-12-13 20:24:01 +01:00
8ba4d19c35 Add end date support for Repeating schedule. Added tests 2022-12-13 12:53:05 +01:00
37bf73c7fe Add end date support for OneTime schedule 2022-12-12 20:02:15 +01:00
d01a3f6347 Merge pull request #496 from zalando-incubator/update-deps-2022-11-01
Update dependencies
2022-12-01 13:48:01 +01:00
50633ba06c Update deps 2022-12
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-12-01 13:05:51 +01:00
bce27b748c Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-11-01 08:58:12 +01:00
9e057c1075 Merge pull request #471 from zalando-incubator/update-deps-09-2022
Update dependencies and Go version
2022-09-14 18:12:22 +02:00
55ce2d8c3d Update dependencies
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-09-13 23:21:39 +02:00
37969486fe Merge pull request #448 from zalando-incubator/multi-arch-image
Build multi-arch image
2022-06-28 11:52:25 +02:00
1be6357c8e Build multi-arch image
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2022-06-24 23:34:31 +02:00
69 changed files with 4971 additions and 2463 deletions

View File

@ -1,5 +1,11 @@
name: ci
on: [push, pull_request]
on:
push:
branches-ignore:
- 'gh-pages'
pull_request:
branches-ignore:
- 'gh-pages'
jobs:
tests:
runs-on: ubuntu-latest
@ -7,12 +13,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.18'
go-version: '^1.19'
- run: go version
- run: go install github.com/mattn/goveralls@latest
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_RELEASE}
env:
GOLANGCI_RELEASE: v1.46.2
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- run: make build.docker
- run: make test
- run: make check

View File

@ -38,11 +38,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.22'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -56,7 +61,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@ -69,4 +74,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

91
.github/workflows/gh-packages.yaml vendored Normal file
View File

@ -0,0 +1,91 @@
name: gh-package-deploy
permissions: {}
on:
push:
branches:
- master
tags:
- '*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository }}"
jobs:
docker:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
# Adding this block will overridw default values to None if not specified in the block
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: read
actions: read
packages: write # to push packages
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
# https://www.npmjs.com/package/semver#caret-ranges-123-025-004
go-version: '^1.21'
- name: Login to Github Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435
id: get-latest-tag
- name: Build binaries
run: |
make build.linux.amd64 build.linux.arm64
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
build-args: BASE_IMAGE=alpine:3
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Build and push latest tag
- name: Build and push latest
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
build-args: BASE_IMAGE=alpine:3
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}

27
.github/workflows/release-chart.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Release Charts
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.4.0
with:
charts_dir: docs
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

View File

@ -1,19 +1,13 @@
run:
linters-settings:
golint:
min-confidence: 0.9
concurrency: 4
linters:
disable-all: true
enable:
- staticcheck
- ineffassign
- golint
- goimports
- errcheck
issues:
exclude-rules:
# Exclude some staticcheck messages
- linters:
- staticcheck
text: "SA9003:"
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused

View File

@ -50,7 +50,7 @@ contribution is in line with our goals.
- Make sure you sign-off on your commits `git commit -s -m "adding X to change Y"`
- Write good commit messages (see below).
- Push your changes to a topic branch in your fork of the repository.
- As you push your changes, update the pull request with new infomation and tasks as you complete them
- As you push your changes, update the pull request with new information and tasks as you complete them
- Project maintainers might comment on your work as you progress
- When you are done, remove the `work in progess` label and ping the maintainers for a review
- Your pull request must receive a :thumbsup: from two [maintainers](MAINTAINERS)

View File

@ -1,9 +1,11 @@
FROM registry.opensource.zalan.do/library/alpine-3.13:latest
ARG BASE_IMAGE=registry.opensource.zalan.do/library/alpine-3:latest
FROM ${BASE_IMAGE}
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
RUN apk add --no-cache tzdata
# add binary
ADD build/linux/kube-metrics-adapter /
ARG TARGETARCH
ADD build/linux/${TARGETARCH}/kube-metrics-adapter /
ENTRYPOINT ["/kube-metrics-adapter"]

View File

@ -34,7 +34,7 @@ $(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
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1 paths=./pkg/apis/... output:crd:dir=docs
mv docs/zalando.org_clusterscalingschedules.yaml docs/cluster_scaling_schedules_crd.yaml
mv docs/zalando.org_scalingschedules.yaml docs/scaling_schedules_crd.yaml
@ -50,7 +50,9 @@ $(OPENAPI): go.mod
build.local: build/$(BINARY) $(GENERATED_CRDS)
build.linux: build/linux/$(BINARY)
build.osx: build/osx/$(BINARY)
build.linux.amd64: build/linux/amd64/$(BINARY)
build.linux.arm64: build/linux/arm64/$(BINARY)
build/$(BINARY): go.mod $(SOURCES) $(GENERATED)
CGO_ENABLED=0 go build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" .
@ -58,11 +60,14 @@ build/$(BINARY): go.mod $(SOURCES) $(GENERATED)
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) $(GENERATED)
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
build/linux/amd64/$(BINARY): go.mod $(SOURCES)
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/amd64/$(BINARY) -ldflags "$(LDFLAGS)" .
build/linux/arm64/$(BINARY): go.mod $(SOURCES)
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/arm64/$(BINARY) -ldflags "$(LDFLAGS)" .
build.docker: build.linux
docker build --rm -t "$(IMAGE):$(TAG)" -f $(DOCKERFILE) .
docker build --rm -t "$(IMAGE):$(TAG)" -f $(DOCKERFILE) --build-arg TARGETARCH= .
build.push: build.docker
docker push "$(IMAGE):$(TAG)"

185
README.md
View File

@ -17,7 +17,7 @@ Here's an example of a `HorizontalPodAutoscaler` resource configured to get
`requests-per-second` metrics from each pod of the deployment `myapp`.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -54,10 +54,8 @@ policy](https://kubernetes.io/docs/setup/release/version-skew-policy/) offered
for Kubernetes, this project aims to support the latest three minor releases of
Kubernetes.
The default supported API is `autoscaling/v2beta2` (available since `v1.12`).
This API MUST be available in the cluster which is the default. However for
GKE, this requires GKE v1.15.7 according to this [GKE
Issue](https://issuetracker.google.com/issues/135624588).
The default supported API is `autoscaling/v2` (available since `v1.23`).
This API MUST be available in the cluster which is the default.
## Building
@ -73,6 +71,15 @@ export GO111MODULE=on # needed if the project is checked out in your $GOPATH.
$ make
```
## Install in Kubernetes
Clone this repository, and run as below:
```sh
$ cd kube-metrics-adapter/docs
$ kubectl apply -f .
```
## Collectors
Collectors are different implementations for getting metrics requested by an
@ -84,9 +91,12 @@ HPA resource, or via additional annotations on the HPA resource.
## Pod collector
The pod collector allows collecting metrics from each pod matched by the HPA.
The pod collector allows collecting metrics from each pod matching the label selector defined in the HPA's `scaleTargetRef`.
Currently only `json-path` collection is supported.
### Supported HPA `scaleTargetRef`
The Pod Collector utilizes the `scaleTargetRef` specified in an HPA resource to obtain the label selector from the referenced Kubernetes object. This enables the identification and management of pods associated with that object. Currently, the supported Kubernetes objects for this operation are: `Deployment`, `StatefulSet` and [`Rollout`](https://argoproj.github.io/argo-rollouts/features/specification/).
### Supported metrics
| Metric | Description | Type | K8s Versions |
@ -99,7 +109,7 @@ This is an example of using the pod collector to collect metrics from a json
metrics endpoint of each pod matched by the HPA.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -219,7 +229,7 @@ with the result of the query.
This allows having multiple prometheus queries associated with a single HPA.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -331,7 +341,7 @@ This is an example of an HPA that will scale based on `requests-per-second` for
an ingress called `myapp`.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -365,7 +375,7 @@ This is an example of an HPA that will scale based on `requests-per-second` for
a routegroup called `myapp`.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -404,6 +414,64 @@ the `backend` label under `matchLabels` for the metric. The ingress annotation
where the backend weights can be obtained can be specified through the flag
`--skipper-backends-annotation`.
## External RPS collector
The External RPS collector, like Skipper collector, is a simple wrapper around the Prometheus collector to
make it easy to define an HPA for scaling based on the RPS measured for a given hostname. When
[skipper](https://github.com/zalando/skipper) is used as the ingress
implementation in your cluster everything should work automatically, in case another reverse proxy is used as ingress, like [Nginx](https://github.com/kubernetes/ingress-nginx) for example, its necessary to configure which prometheus metric should be used through `--external-rps-metric-name <metric-name>` flag. Assuming `skipper-ingress` is being used or the appropriate metric name is passed using the flag mentioned previously this collector provides the correct Prometheus queries out of the
box so users don't have to define those manually.
### Supported metrics
| Metric | Description | Type | Kind | K8s Versions |
| ------------ | -------------- | ------- | -- | -- |
| `requests-per-second` | Scale based on requests per second for a certain hostname. | External | | `>=1.12` |
### Example: External Metric
This is an example of an HPA that will scale based on `requests-per-second` for the RPS measured in the hostnames called: `www.example1.com` and `www.example2.com`; and weighted by 42%.
```yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
annotations:
metric-config.external.example-rps.requests-per-second/hostnames: www.example1.com,www.example2.com
metric-config.external.example-rps.requests-per-second/weight: "42"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: custom-metrics-consumer
minReplicas: 1
maxReplicas: 10
metrics:
- type: External
external:
metric:
name: example-rps
selector:
matchLabels:
type: requests-per-second
target:
type: AverageValue
averageValue: "42"
```
### Multiple hostnames per metric
This metric supports a relation of n:1 between hostnames and metrics. The way it works is the measured RPS is the sum of the RPS rate of each of the specified hostnames. This value is further modified by the weight parameter explained below.
### Metric weighting based on backend
There are ingress-controllers, like skipper-ingress, that supports sending traffic to different backends based on some kind of configuration, in case of skipper annotations
present on the `Ingress` object, or weights on the RouteGroup backends. By
default the number of replicas will be calculated based on the full traffic
served by these components. If however only the traffic being routed to
a specific hostname should be used then the weight for the configured hostname(s) might be specified via the `weight` annotation `metric-config.external.<metric-name>.request-per-second/weight` for the metric being configured.
## InfluxDB collector
The InfluxDB collector maps [Flux](https://github.com/influxdata/flux) queries to metrics that can be used for scaling.
@ -426,7 +494,7 @@ the query name which will be associated with the result of the query. This
allows having multiple flux queries associated with a single HPA.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -514,7 +582,7 @@ This is an example of an HPA that will scale based on the length of an SQS
queue.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -566,7 +634,7 @@ This is an example of an HPA that will scale based on the specified value
exposed by a ZMON check with id `1234`.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -646,6 +714,93 @@ you need to define a `key` or other `tag` with a "star" query syntax like
metric label definitions. If both annotations and corresponding label is
defined, then the annotation takes precedence.
## Nakadi collector
The Nakadi collector allows scaling based on [Nakadi](https://nakadi.io/)
Subscription API stats metrics `consumer_lag_seconds` or `unconsumed_events`.
### Supported metrics
| Metric Type | Description | Type | K8s Versions |
|------------------------|-----------------------------------------------------------------------------|----------|--------------|
| `unconsumed-events` | Scale based on number of unconsumed events for a Nakadi subscription | External | `>=1.24` |
| `consumer-lag-seconds` | Scale based on number of max consumer lag seconds for a Nakadi subscription | External | `>=1.24` |
```yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
annotations:
# metric-config.<metricType>.<metricName>.<collectorType>/<configKey>
metric-config.external.my-nakadi-consumer.nakadi/interval: "60s" # optional
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: custom-metrics-consumer
minReplicas: 0
maxReplicas: 8 # should match number of partitions for the event type
metrics:
- type: External
external:
metric:
name: my-nakadi-consumer
selector:
matchLabels:
type: nakadi
subscription-id: "708095f6-cece-4d02-840e-ee488d710b29"
metric-type: "consumer-lag-seconds|unconsumed-events"
target:
# value is compatible with the consumer-lag-seconds metric type.
# It describes the amount of consumer lag in seconds before scaling
# additionally up.
# if an event-type has multiple partitions the value of
# consumer-lag-seconds is the max of all the partitions.
value: "600" # 10m
type: Value
# averageValue is compatible with unconsumed-events metric type.
# This means for every 30 unconsumed events a pod is added.
# unconsumed-events is the sum of of unconsumed_events over all
# partitions.
averageValue: "30"
type: AverageValue
```
The `subscription-id` is the Subscription ID of the relevant consumer. The
`metric-type` indicates whether to scale on `consumer-lag-seconds` or
`unconsumed-events` as outlined below.
`unconsumed-events` - is the total number of unconsumed events over all
partitions. When using this `metric-type` you should also use the target
`averageValue` which indicates the number of events which can be handled per
pod. To best estimate the number of events per pods, you need to understand the
average time for processing an event as well as the rate of events.
*Example*: You have an event type producing 100 events per second between 00:00
and 08:00. Between 08:01 to 23:59 it produces 400 events per second.
Let's assume that on average a single pod can consume 100 events per second,
then we can define 100 as `averageValue` and the HPA would scale to 1 between
00:00 and 08:00, and scale to 4 between 08:01 and 23:59. If there for some
reason is a short spike of 800 events per second, then it would scale to 8 pods
to process those events until the rate goes down again.
`consumer-lag-seconds` - describes the age of the oldest unconsumed event for
a subscription. If the event type has multiple partitions the lag is defined as
the max age over all partitions. When using this `metric-type` you should use
the target `value` to indicate the max lag (in seconds) before the HPA should
scale.
*Example*: You have a subscription with a defined SLO of "99.99 of events are
consumed within 30 min.". In this case you can define a target `value` of e.g.
20 min. (1200s) (to include a safety buffer) such that the HPA only scales up
from 1 to 2 if the target of 20 min. is breached and it needs to work faster
with more consumers.
For this case you should also account for the average time for processing an
event when defining the target.
## HTTP Collector
The http collector allows collecting metrics from an external endpoint specified in the HPA.
@ -663,7 +818,7 @@ This is an example of using the HTTP collector to collect metrics from a json
metrics endpoint specified in the annotations.
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
@ -830,7 +985,7 @@ An HPA can reference the deployed `ClusterScalingSchedule` object as
this example:
```yaml
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: "myapp-hpa"

View File

@ -30,3 +30,17 @@ pipeline:
IMAGE=$IMAGE VERSION=$VERSION make build.docker
git diff --stat --exit-code
IMAGE=$IMAGE VERSION=$VERSION make build.push
- desc: Build and push image to Zalando's registry
cmd: |
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter
VERSION=$(git describe --tags --always)
else
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter-test
VERSION=$CDP_BUILD_VERSION
fi
make build.linux.amd64 build.linux.arm64
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
docker buildx build --rm --build-arg BASE_IMAGE=container-registry.zalando.net/library/alpine-3:latest -t "${IMAGE}:${VERSION}" --platform linux/amd64,linux/arm64 --push .
cdp-promote-image "${IMAGE}:${VERSION}"

View File

@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: clusterscalingschedules.zalando.org
spec:
group: zalando.org
@ -15,21 +14,32 @@ spec:
singular: clusterscalingschedule
scope: Cluster
versions:
- name: v1
- additionalPrinterColumns:
- description: Whether one or more schedules are currently active.
jsonPath: .status.active
name: Active
type: boolean
name: v1
schema:
openAPIV3Schema:
description: ClusterScalingSchedule describes a cluster scoped time based
metric to be used in autoscaling operations.
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'
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'
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
@ -42,22 +52,32 @@ spec:
format: int64
type: integer
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
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.
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.
description: |-
Defines the starting date of a OneTime schedule. It has to
be a RFC3339 formatted date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
description: |-
The duration in minutes (default 0) that the configured value will be
returned for the defined schedule.
type: integer
endDate:
description: |-
Defines the ending date of a OneTime schedule. It must be
a RFC3339 formatted date.
format: date-time
type: string
period:
description: Defines the details of a Repeating schedule.
properties:
@ -76,13 +96,18 @@ spec:
- Sat
type: string
type: array
endTime:
description: The endTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
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.
description: |-
The location name corresponding to a file in the IANA
Time Zone database, like Europe/Berlin.
type: string
required:
- days
@ -90,7 +115,8 @@ spec:
- timezone
type: object
type:
description: Defines if the schedule is a OneTime schedule or
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:
@ -103,7 +129,6 @@ spec:
format: int64
type: integer
required:
- durationMinutes
- type
- value
type: object
@ -111,14 +136,20 @@ spec:
required:
- schedules
type: object
status:
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
properties:
active:
default: false
description: |-
Active is true if at least one of the schedules defined in the
scaling schedule is currently active.
type: boolean
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
subresources:
status: {}

View File

@ -22,7 +22,7 @@ spec:
serviceAccountName: custom-metrics-apiserver
containers:
- name: kube-metrics-adapter
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter:latest
image: ghcr.io/zalando-incubator/kube-metrics-adapter:latest
args:
# - --v=9
- --prometheus-server=http://prometheus.kube-system.svc.cluster.local

View File

@ -1,6 +1,6 @@
apiVersion: v2
name: kube-metrics-adapter
version: 0.1.18
version: 0.2.0
description: kube-metrics-adapter helm chart
home: https://github.com/zalando-incubator/kube-metrics-adapter
maintainers:

View File

@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: clusterscalingschedules.zalando.org
spec:
@ -15,7 +15,12 @@ spec:
singular: clusterscalingschedule
scope: Cluster
versions:
- name: v1
- additionalPrinterColumns:
- description: Whether one or more schedules are currently active.
jsonPath: .status.active
name: Active
type: boolean
name: v1
schema:
openAPIV3Schema:
description: ClusterScalingSchedule describes a cluster scoped time based
@ -36,6 +41,11 @@ spec:
spec:
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
properties:
scalingWindowDurationMinutes:
description: Fade the scheduled values in and out over this many minutes.
If unset, the default per-cluster value will be used.
format: int64
type: integer
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
resource. All the schedules defined here will result on the value
@ -46,13 +56,18 @@ spec:
properties:
date:
description: Defines the starting date of a OneTime schedule.
It has to be a RFC3339 formated date.
It has to be a RFC3339 formatted date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
description: The duration in minutes (default 0) that the configured
value will be returned for the defined schedule.
type: integer
endDate:
description: Defines the ending date of a OneTime schedule.
It must be a RFC3339 formatted date.
format: date-time
type: string
period:
description: Defines the details of a Repeating schedule.
properties:
@ -71,6 +86,10 @@ spec:
- Sat
type: string
type: array
endTime:
description: The endTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
startTime:
description: The startTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
@ -95,9 +114,9 @@ spec:
value:
description: The metric value that will be returned for the
defined schedule.
format: int64
type: integer
required:
- durationMinutes
- type
- value
type: object
@ -105,11 +124,22 @@ spec:
required:
- schedules
type: object
status:
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
properties:
active:
default: false
description: Active is true if at least one of the schedules defined
in the scaling schedule is currently active.
type: boolean
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""

View File

@ -164,6 +164,9 @@ spec:
{{- if .Values.skipperIngressMetrics }}
- --skipper-ingress-metrics={{ .Values.skipperIngressMetrics }}
{{- end}}
{{- if .Values.skipperRouteGroupMetrics }}
- --skipper-routegroup-metrics={{ .Values.skipperRouteGroupMetrics }}
{{- end}}
{{- if .Values.log.stderrThreshold }}
- --stderrthreshold={{ .Values.log.stderrThreshold }}
{{- end}}

View File

@ -59,12 +59,22 @@ rules:
- statefulsets
verbs:
- get
{{- if .Values.skipperRouteGroupMetrics }}
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
{{- end }}
{{- if .Values.skipperRouteGroupMetrics }}
- apiGroups:
- zalando.org
resources:
- routegroups
verbs:
- get
{{- end }}
- apiGroups:
- autoscaling
resources:
@ -83,6 +93,13 @@ rules:
- get
- list
- watch
- apiGroups:
- zalando.org
resources:
- clusterscalingschedules/status
- scalingschedules/status
verbs:
- update
{{- end}}
---
apiVersion: rbac.authorization.k8s.io/v1

View File

@ -3,19 +3,26 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
name: scalingschedules.zalando.org
spec:
group: zalando.org
names:
categories:
- all
kind: ScalingSchedule
listKind: ScalingScheduleList
plural: scalingschedules
singular: scalingschedule
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- description: Whether one or more schedules are currently active.
jsonPath: .status.active
name: Active
type: boolean
name: v1
schema:
openAPIV3Schema:
description: ScalingSchedule describes a namespaced time based metric to be
@ -36,6 +43,11 @@ spec:
spec:
description: ScalingScheduleSpec is the spec part of the ScalingSchedule.
properties:
scalingWindowDurationMinutes:
description: Fade the scheduled values in and out over this many minutes.
If unset, the default per-cluster value will be used.
format: int64
type: integer
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
resource. All the schedules defined here will result on the value
@ -46,13 +58,18 @@ spec:
properties:
date:
description: Defines the starting date of a OneTime schedule.
It has to be a RFC3339 formated date.
It has to be a RFC3339 formatted date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
description: The duration in minutes (default 0) that the configured
value will be returned for the defined schedule.
type: integer
endDate:
description: Defines the ending date of a OneTime schedule.
It must be a RFC3339 formatted date.
format: date-time
type: string
period:
description: Defines the details of a Repeating schedule.
properties:
@ -71,6 +88,10 @@ spec:
- Sat
type: string
type: array
endTime:
description: The endTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
startTime:
description: The startTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
@ -95,9 +116,9 @@ spec:
value:
description: The metric value that will be returned for the
defined schedule.
format: int64
type: integer
required:
- durationMinutes
- type
- value
type: object
@ -105,11 +126,22 @@ spec:
required:
- schedules
type: object
status:
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
properties:
active:
default: false
description: Active is true if at least one of the schedules defined
in the scaling schedule is currently active.
type: boolean
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""

View File

@ -4,7 +4,7 @@ replicas: 1
registry:
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
imageTag: v0.1.10
imageTag: v0.2.0
imagePullPolicy: IfNotPresent
service:
@ -22,6 +22,7 @@ http2MaxStreamsPerConnection:
listerKubeConfig:
skipperBackendsAnnotation:
skipperIngressMetrics:
skipperRouteGroupMetrics:
token:
vmodule:

View File

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

View File

@ -3,33 +3,45 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: scalingschedules.zalando.org
spec:
group: zalando.org
names:
categories:
- all
kind: ScalingSchedule
listKind: ScalingScheduleList
plural: scalingschedules
singular: scalingschedule
scope: Namespaced
versions:
- name: v1
- additionalPrinterColumns:
- description: Whether one or more schedules are currently active.
jsonPath: .status.active
name: Active
type: boolean
name: v1
schema:
openAPIV3Schema:
description: ScalingSchedule describes a namespaced time based metric to be
used in autoscaling operations.
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'
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'
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
@ -42,22 +54,32 @@ spec:
format: int64
type: integer
schedules:
description: Schedules is the list of schedules for this ScalingSchedule
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.
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.
description: |-
Defines the starting date of a OneTime schedule. It has to
be a RFC3339 formatted date.
format: date-time
type: string
durationMinutes:
description: The duration in minutes that the configured value
will be returned for the defined schedule.
description: |-
The duration in minutes (default 0) that the configured value will be
returned for the defined schedule.
type: integer
endDate:
description: |-
Defines the ending date of a OneTime schedule. It must be
a RFC3339 formatted date.
format: date-time
type: string
period:
description: Defines the details of a Repeating schedule.
properties:
@ -76,13 +98,18 @@ spec:
- Sat
type: string
type: array
endTime:
description: The endTime has the format HH:MM
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
type: string
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.
description: |-
The location name corresponding to a file in the IANA
Time Zone database, like Europe/Berlin.
type: string
required:
- days
@ -90,7 +117,8 @@ spec:
- timezone
type: object
type:
description: Defines if the schedule is a OneTime schedule or
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:
@ -103,7 +131,6 @@ spec:
format: int64
type: integer
required:
- durationMinutes
- type
- value
type: object
@ -111,14 +138,20 @@ spec:
required:
- schedules
type: object
status:
description: ScalingScheduleStatus is the status section of the ScalingSchedule.
properties:
active:
default: false
description: |-
Active is true if at least one of the schedules defined in the
scaling schedule is currently active.
type: boolean
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
subresources:
status: {}

View File

@ -1,4 +1,4 @@
FROM registry.opensource.zalan.do/library/alpine-3.13:latest
FROM registry.opensource.zalan.do/library/alpine-3:latest
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
# add binary

View File

@ -1,4 +1,4 @@
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: custom-metrics-consumer

255
go.mod
View File

@ -1,123 +1,190 @@
module github.com/zalando-incubator/kube-metrics-adapter
require (
github.com/aws/aws-sdk-go v1.44.25
github.com/influxdata/influxdb-client-go v0.2.0
github.com/kubernetes-sigs/custom-metrics-apiserver v0.0.0-20201216091021-1b9fa998bbaa
github.com/prometheus/client_golang v1.12.2
github.com/prometheus/common v0.34.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.4.0
github.com/spyzhov/ajson v0.7.1
github.com/stretchr/testify v1.7.1
github.com/szuecs/routegroup-client v0.21.0
github.com/zalando-incubator/cluster-lifecycle-manager v0.0.0-20220201095549-bbdeecaa4fc1
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/apiserver v0.23.0
k8s.io/client-go v0.23.0
k8s.io/code-generator v0.23.0
k8s.io/component-base v0.23.0
github.com/argoproj/argo-rollouts v1.6.6
github.com/aws/aws-sdk-go-v2 v1.27.0
github.com/aws/aws-sdk-go-v2/config v1.27.15
github.com/aws/aws-sdk-go-v2/service/sqs v1.32.2
github.com/influxdata/influxdb-client-go v1.4.0
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/common v0.45.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spyzhov/ajson v0.9.1
github.com/stretchr/testify v1.9.0
github.com/szuecs/routegroup-client v0.28.2
github.com/zalando-incubator/cluster-lifecycle-manager v0.0.0-20230601114834-6ed1bba3c85d
golang.org/x/net v0.25.0
golang.org/x/oauth2 v0.20.0
golang.org/x/sync v0.7.0
k8s.io/api v0.29.4
k8s.io/apimachinery v0.29.4
k8s.io/apiserver v0.29.4
k8s.io/client-go v0.29.4
k8s.io/code-generator v0.29.4
k8s.io/component-base v0.29.4
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
k8s.io/metrics v0.21.9
sigs.k8s.io/controller-tools v0.8.0
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
k8s.io/metrics v0.29.4
sigs.k8s.io/controller-tools v0.14.0
sigs.k8s.io/custom-metrics-apiserver v1.29.0
)
require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
github.com/CloudyKit/jet/v6 v6.2.0 // indirect
github.com/Joker/jade v1.1.3 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.15 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.9 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.14.3+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/gobuffalo/flect v0.2.3 // indirect
github.com/deepmap/oapi-codegen v1.16.2 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/flosch/pongo2/v4 v4.0.2 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.10.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/iris-contrib/schema v0.0.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kataras/blocks v0.0.8 // indirect
github.com/kataras/golog v0.1.12 // indirect
github.com/kataras/iris/v12 v12.2.11 // indirect
github.com/kataras/pio v0.0.13 // indirect
github.com/kataras/sitemap v0.0.6 // indirect
github.com/kataras/tunnel v0.0.4 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/labstack/echo/v4 v4.12.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mailgun/raymond/v2 v2.0.48 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/afero v1.8.1 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/schollz/closestmatch v2.1.0+incompatible // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.etcd.io/etcd/api/v3 v3.5.1 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.1 // indirect
go.etcd.io/etcd/client/v3 v3.5.0 // indirect
go.opentelemetry.io/contrib v0.20.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
go.opentelemetry.io/otel v0.20.0 // indirect
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
go.opentelemetry.io/otel/metric v0.20.0 // indirect
go.opentelemetry.io/otel/sdk v0.20.0 // indirect
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
go.opentelemetry.io/otel/trace v0.20.0 // indirect
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.9 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.43.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/tdewolff/minify/v2 v2.20.21 // indirect
github.com/tdewolff/parse/v2 v2.7.14 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/yosssi/ace v0.0.5 // indirect
go.etcd.io/etcd/api/v3 v3.5.11 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.11 // indirect
go.etcd.io/etcd/client/v3 v3.5.11 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c // indirect
k8s.io/klog/v2 v2.40.1 // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.27 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.4 // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kms v0.29.4 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
go 1.18
go 1.22

1785
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ import (
"strings"
"time"
autoscalingv2 "k8s.io/api/autoscaling/v2beta2"
autoscalingv2 "k8s.io/api/autoscaling/v2"
)
const (

View File

@ -4,7 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
autoscalingv2 "k8s.io/api/autoscaling/v2beta2"
autoscalingv2 "k8s.io/api/autoscaling/v2"
)
func TestParser(t *testing.T) {

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,16 @@ import (
// ScalingSchedule describes a namespaced time based metric to be used
// in autoscaling operations.
// +k8s:deepcopy-gen=true
// +kubebuilder:resource:categories=all
// +kubebuilder:printcolumn:name="Active",type=boolean,JSONPath=`.status.active`,description="Whether one or more schedules are currently active."
// +kubebuilder:subresource:status
type ScalingSchedule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ScalingScheduleSpec `json:"spec"`
// +optional
Status ScalingScheduleStatus `json:"status"`
}
// +genclient
@ -28,12 +33,17 @@ type ScalingSchedule struct {
// ClusterScalingSchedule describes a cluster scoped time based metric
// to be used in autoscaling operations.
// +k8s:deepcopy-gen=true
// +kubebuilder:resource:categories=all
// +kubebuilder:printcolumn:name="Active",type=boolean,JSONPath=`.status.active`,description="Whether one or more schedules are currently active."
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
type ClusterScalingSchedule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ScalingScheduleSpec `json:"spec"`
// +optional
Status ScalingScheduleStatus `json:"status"`
}
// ScalingScheduleSpec is the spec part of the ScalingSchedule.
@ -58,11 +68,16 @@ type Schedule struct {
// +optional
Period *SchedulePeriod `json:"period,omitempty"`
// Defines the starting date of a OneTime schedule. It has to
// be a RFC3339 formated date.
// be a RFC3339 formatted date.
// +optional
Date *ScheduleDate `json:"date,omitempty"`
// The duration in minutes that the configured value will be
// Defines the ending date of a OneTime schedule. It must be
// a RFC3339 formatted date.
// +optional
EndDate *ScheduleDate `json:"endDate,omitempty"`
// The duration in minutes (default 0) that the configured value will be
// returned for the defined schedule.
// +optional
DurationMinutes int `json:"durationMinutes"`
// The metric value that will be returned for the defined schedule.
Value int64 `json:"value"`
@ -90,6 +105,10 @@ type SchedulePeriod struct {
// The startTime has the format HH:MM
// +kubebuilder:validation:Pattern="(([0-1][0-9])|([2][0-3])):([0-5][0-9])"
StartTime string `json:"startTime"`
// The endTime has the format HH:MM
// +kubebuilder:validation:Pattern="(([0-1][0-9])|([2][0-3])):([0-5][0-9])"
// +optional
EndTime string `json:"endTime"`
// The days that this schedule will be active.
Days []ScheduleDay `json:"days"`
// The location name corresponding to a file in the IANA
@ -116,6 +135,16 @@ const (
// +kubebuilder:validation:Format="date-time"
type ScheduleDate string
// ScalingScheduleStatus is the status section of the ScalingSchedule.
// +k8s:deepcopy-gen=true
type ScalingScheduleStatus struct {
// Active is true if at least one of the schedules defined in the
// scaling schedule is currently active.
// +kubebuilder:default:=false
// +optional
Active bool `json:"active"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ScalingScheduleList is a list of namespaced scaling schedules.

View File

@ -31,6 +31,7 @@ func (in *ClusterScalingSchedule) DeepCopyInto(out *ClusterScalingSchedule) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
@ -91,6 +92,7 @@ func (in *ScalingSchedule) DeepCopyInto(out *ScalingSchedule) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
@ -173,6 +175,22 @@ func (in *ScalingScheduleSpec) DeepCopy() *ScalingScheduleSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScalingScheduleStatus) DeepCopyInto(out *ScalingScheduleStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScalingScheduleStatus.
func (in *ScalingScheduleStatus) DeepCopy() *ScalingScheduleStatus {
if in == nil {
return nil
}
out := new(ScalingScheduleStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Schedule) DeepCopyInto(out *Schedule) {
*out = *in
@ -186,6 +204,11 @@ func (in *Schedule) DeepCopyInto(out *Schedule) {
*out = new(ScheduleDate)
**out = **in
}
if in.EndDate != nil {
in, out := &in.EndDate, &out.EndDate
*out = new(ScheduleDate)
**out = **in
}
return
}

View File

@ -33,8 +33,7 @@ type Interface interface {
ZalandoV1() zalandov1.ZalandoV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
// Clientset contains the clients for groups.
type Clientset struct {
*discovery.DiscoveryClient
zalandoV1 *zalandov1.ZalandoV1Client
@ -61,6 +60,10 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.UserAgent == "" {
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
}
// share the transport between all clients
httpClient, err := rest.HTTPClientFor(&configShallowCopy)
if err != nil {

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