karmada
karmada copied to clipboard
using autoscalingv2 instead of autoscalingv1
Signed-off-by: Garrybest [email protected]
What type of PR is this? /kind cleanup
What this PR does / why we need it:
The APIVersion autoscalingv2 is the default version now.
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
NONE
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign kevin-wangzefeng after the PR has been reviewed.
You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
The APIVersion autoscalingv2 is the default version now.
In which release?
In which release?
1.23, https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.23.md#horizontalpodautoscaler-v2-graduates-to-ga
New changes are detected. LGTM label has been removed.
Codecov Report
Merging #2322 (1a3f55f) into master (e47d6cb) will increase coverage by
0.25%. The diff coverage isn/a.
@@ Coverage Diff @@
## master #2322 +/- ##
==========================================
+ Coverage 38.34% 38.60% +0.25%
==========================================
Files 207 206 -1
Lines 18999 18846 -153
==========================================
- Hits 7286 7275 -11
+ Misses 11284 11142 -142
Partials 429 429
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 38.60% <ø> (+0.25%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| pkg/search/proxy/store/util.go | 92.41% <0.00%> (-1.90%) |
:arrow_down: |
| ...nterpreter/configurableinterpreter/configurable.go | ||
| ...terpreter/configurableinterpreter/dependencyset.go | ||
| pkg/util/hashset/hashset.go | 100.00% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
cc @RainbowMango
/assign
The release-1.23 doesn't deprecate the v1 HorizontalPodAutoscaler API. My concern is this patch probably limits the controller to workable only for Kubernetes v1.23+ clusters.
I'm not sure if v2 could be transformed to v1:
- if yes, we probably shouldn't do it as it breaks the compatibility.
- if no, seems it also breaks the compatibility.
anyway, @jwcesign could you please help to confirm it?
You can apply a v2 HorizontalPodAutoscaler and see if the
hpacontrollercan get the events. (test should against the master branch)
Got it, it makes sense. The object autoscalingv2.HorizontalPodAutoscaler will be encapsulated into work and distribute among member clusters, which are probably not able to support autoscalingv2.
You can apply a v2 HorizontalPodAutoscaler and see if the hpacontroller can get the events. (test should against the master branch)
answer by myself.
After I applied a HorizontalPodAutoscaler of autoscaling/v2, the HorizontalPodAutoscalerController seems no reaction.
I1216 06:30:33.173343 1 detector.go:213] Reconciling object: autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache
I1216 06:30:33.173438 1 detector.go:321] attempts to match policy for resource(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache)
I1216 06:30:33.173683 1 compare.go:44] No propagationpolicy match for resource(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache)
I1216 06:30:33.173697 1 detector.go:347] attempts to match cluster policy for resource(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache)
I1216 06:30:33.173705 1 detector.go:354] no clusterpropagationpolicy find.
I1216 06:30:33.173713 1 detector.go:693] Add object(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache) to waiting list, length of list is: 189
I1216 06:30:33.178940 1 detector.go:213] Reconciling object: autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache
I1216 06:30:33.178971 1 detector.go:321] attempts to match policy for resource(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache)
I1216 06:30:33.179211 1 compare.go:44] No propagationpolicy match for resource(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache)
I1216 06:30:33.179226 1 detector.go:347] attempts to match cluster policy for resource(autoscaling/v2, kind=HorizontalPodAutoscaler, default/php-apache)
I1216 06:30:33.179234 1 detector.go:354] no clusterpropagationpolicy find.
I1216 06:30:33.179319 1 recorder.go:103] "events: No policy match for resource" type="Warning" object={Kind:HorizontalPodAutoscaler Namespace:default Name:php-apache UID:ee866682-d446-433c-977c-981419bfc322 APIVersion:autoscali"
I1216 06:30:37.282652 1 cluster_status_controller.go:109] Syncing cluster status: member2
I1216 06:30:37.844641 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 4 items received
I1216 06:30:38.567009 1 cluster_status_controller.go:109] Syncing cluster status: member1
I1216 06:30:47.300611 1 cluster_status_controller.go:109] Syncing cluster status: member2
I1216 06:30:48.581374 1 cluster_status_controller.go:109] Syncing cluster status: member1
I1216 06:30:48.844938 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 5 items received
I1216 06:30:50.996820 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 7 items received
I1216 06:30:51.801618 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 0 items received
I1216 06:30:57.316005 1 cluster_status_controller.go:109] Syncing cluster status: member2
I1216 06:30:58.603089 1 cluster_status_controller.go:109] Syncing cluster status: member1
I1216 06:31:04.842510 1 reflector.go:559] sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:262: Watch close - *v1.ClusterRole total 0 items received
I1216 06:31:07.332833 1 cluster_status_controller.go:109] Syncing cluster status: member2
I1216 06:31:07.924125 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 8 items received
I1216 06:31:08.620374 1 cluster_status_controller.go:109] Syncing cluster status: member1
I1216 06:31:10.772709 1 reflector.go:559] sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:262: Watch close - *v1alpha1.Work total 3 items received
I1216 06:31:10.985458 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 0 items received
I1216 06:31:12.917350 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 4 items received
I1216 06:31:17.348663 1 cluster_status_controller.go:109] Syncing cluster status: member2
I1216 06:31:17.919264 1 reflector.go:559] k8s.io/client-go/dynamic/dynamicinformer/informer.go:91: Watch close - *unstructured.Unstructured total 6 items received
I1216 06:31:18.633096 1 cluster_status_controller.go:109] Syncing cluster status: member1
I won't be surprised that V2 is not compatible with V1, because that's the rule. I tested with following yaml:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: php-apache
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: php-apache
minReplicas: 1
maxReplicas: 10