signalfx / signalfx-k8s-metrics-adapter

Horizontal Pod Autoscaler custom/external metrics provider for Kubernetes that uses SignalFx as the backend
Apache License 2.0
10 stars 15 forks source link

Update API specs for K8s v1.22 compatibility #21

Closed bambro closed 1 year ago

bambro commented 2 years ago

With the introduction of K8s v1.22, API deprecations (apiregistration.k8s.io/v1beta1, authorization.k8s.io/v1beta1) have had an impact on external metric resolution, resulting in the following errors:

E1129 07:10:22.361450       1 webhook.go:196] Failed to make webhook authorizer request: the server could not find the requested resource
E1129 07:10:22.361615       1 errors.go:77] the server could not find the requested resource
...

This PR aims to update the SignalFX adapter to use the new autoscaling/v2beta2 version of the HorizontalPodAutoscaler API for support of K8s versions >1.22. Integration tests have also been updated to use the v2beta2 spec.

dloucasfx commented 2 years ago

@bambro Thanks for the PR. I am working on fixing and expanding the workflow to newer version of k8s, this will help us ensure that changes are tested and backward compatible. I'll review your changes once CI is fixed.

dloucasfx commented 2 years ago

@bambro can you rebase to pickup the latest github workflow. Thanks

bambro commented 2 years ago

Hi @dloucasfx thanks for taking a look at the PR and for making the workflow changes. Branch has been rebased so should be alright for another run

bambro commented 2 years ago

@dloucasfx examples have been updated as requested. Also added an additional change to the adapater/main.go to initialize the klog flags (i.e. --logtostderr, --v) as these were missing in part due to the dependency upgrades.