-
Notifications
You must be signed in to change notification settings - Fork 789
Update the Kubernetes autoscaling API to v2 (#2722) #2842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the Kubernetes autoscaling API to v2 (#2722) #2842
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2842 +/- ##
=======================================
Coverage 20.76% 20.76%
=======================================
Files 68 68
Lines 7372 7372
=======================================
Hits 1531 1531
Misses 5727 5727
Partials 114 114
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@Lunik You will need to update auto generated files.
It updates deep copy file and CRD definition for the function.
|
This should looks good with ac7f53b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to replace all
.AutoscalingV2beta2()
calls with .AutoscalingV2()
These are referred via kubernetes client
-> % ack ".AutoscalingV2()"
pkg/executor/util/hpa/hpa.go
123: existingHpa, err = hpaops.kubernetesClient.AutoscalingV2beta2().HorizontalPodAutoscalers(depl.ObjectMeta.Namespace).Update(ctx, existingHpa, metav1.UpdateOptions{})
132: cHpa, err := hpaops.kubernetesClient.AutoscalingV2beta2().HorizontalPodAutoscalers(depl.ObjectMeta.Namespace).Create(ctx, hpa, metav1.CreateOptions{})
135: cHpa, err = hpaops.kubernetesClient.AutoscalingV2beta2().HorizontalPodAutoscalers(depl.ObjectMeta.Namespace).Get(ctx, hpaName, metav1.GetOptions{})
148: return hpaops.kubernetesClient.AutoscalingV2beta2().HorizontalPodAutoscalers(ns).Get(ctx, name, metav1.GetOptions{})
152: _, err := hpaops.kubernetesClient.AutoscalingV2beta2().HorizontalPodAutoscalers(hpa.ObjectMeta.Namespace).Update(ctx, hpa, metav1.UpdateOptions{})
157: return hpaops.kubernetesClient.AutoscalingV2beta2().HorizontalPodAutoscalers(ns).Delete(ctx, name, metav1.DeleteOptions{})
pkg/executor/reaper/reaper.go
59: err := kubeClient.AutoscalingV2beta2().HorizontalPodAutoscalers(kubeobj.Namespace).Delete(ctx, kubeobj.Name, metav1.DeleteOptions{})
183: hpaList, err := client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(ctx, listOps)
196: err := client.AutoscalingV2beta2().HorizontalPodAutoscalers(hpa.ObjectMeta.Namespace).Delete(ctx, hpa.ObjectMeta.Name, metav1.DeleteOptions{})
pkg/fission-cli/cmd/support/resources/kubernetes.go
119: objs, err := res.client.AutoscalingV2beta2().HorizontalPodAutoscalers(metav1.NamespaceAll).List(ctx, metav1.ListOptions{LabelSelector: res.selector})
Also please rebase the PR as I have updated Kubernetes version in CI. |
- k8s.io/api/autoscaling/v2 Signed-off-by: Lunik <lunik@tiwabbit.fr>
Signed-off-by: Lunik <lunik@tiwabbit.fr>
Signed-off-by: Lunik <lunik@tiwabbit.fr>
ac7f53b
to
b874136
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM code changes.
We will need change CI versions again in a separate PR and do couple of changes in the CI.
Thanks for raising PR 🎉
Description
This PR update the Kubernetes Autoscaling API to v2.
This allow support for Kubernetes cluster in version v1.26 and latest. However, this drop the support for Kubernetes clusters in version under v1.23
Which issue(s) this PR fixes:
Fixes #2722
Fixes #2838
Testing
./hack/runtests.sh
fission/fission-bundle
image locally withgoreleaser
and replaced theexecutor
imageChecklist: