WIP: HPA upgrade
This PR investigates upgrading HPA.
- Presently we use v2beta1 - this will no longer be served in 1.25 of k8s
- This PR initial looks to upgrade to v2 spec which is available from 1.23 of k8s.
- As many users are still using older versions of k8s this may not presently be a good choice
- If we upgrade to v2beta2 this will be deprecated in 1.26 of k8s but is available in 1.19 of Kubernetes which is probably the oldest release we should probably support (Note latest istio supports/tested from 1.21 onwards)
If we do upgrade there will be a breaking change for users of existing HPA v2beta1 as the spec has changed in some parts in v2beta2 and thus v2.
Useful research from Kubeflow users:

Check out this pull request on ![]()
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign cliveseldon
You can assign the PR to them by writing /assign @cliveseldon 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
/test integration
/test integration
/test notebooks
/test integration
/test notebooks
Looking at the logs from the integration tests, we may need to update the Kind environment where they are run to use a newer version of K8s?
2023-02-03T18:11:57.985330Z warn installer retrieving resources to prune type autoscaling/v2beta1, Kind=HorizontalPodAutoscaler: no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1" not found
2023-02-03T18:11:57.998849Z warn installer retrieving resources to prune type policy/v1beta1, Kind=PodDisruptionBudget: no matches for kind "PodDisruptionBudget" in version "policy/v1beta1" not found
2023-02-03T18:12:01.266601Z warn installer retrieving resources to prune type networking.istio.io/v1alpha3, Kind=DestinationRule: no matches for kind "DestinationRule" in version "networking.istio.io/v1alpha3" not found
2023-02-03T18:12:01.277901Z warn installer retrieving resources to prune type networking.istio.io/v1alpha3, Kind=EnvoyFilter: no matches for kind "EnvoyFilter" in version "networking.istio.io/v1alpha3" not found
2023-02-03T18:12:01.288075Z warn installer retrieving resources to prune type networking.istio.io/v1alpha3, Kind=Gateway: no matches for kind "Gateway" in version "networking.istio.io/v1alpha3" not found
2023-02-03T18:12:01.818742Z warn installer retrieving resources to prune type networking.istio.io/v1alpha3, Kind=VirtualService: no matches for kind "VirtualService" in version "networking.istio.io/v1alpha3" not found
2023-02-03T18:12:02.460026Z warn installer retrieving resources to prune type security.istio.io/v1beta1, Kind=PeerAuthentication: no matches for kind "PeerAuthentication" in version "security.istio.io/v1beta1" not found
2023-02-03T18:12:03.099244Z warn installer retrieving resources to prune type admissionregistration.k8s.io/v1beta1, Kind=MutatingWebhookConfiguration: no matches for kind "MutatingWebhookConfiguration" in version "admissionregistration.k8s.io/v1beta1" not found
2023-02-03T18:12:03.738783Z warn installer retrieving resources to prune type admissionregistration.k8s.io/v1beta1, Kind=ValidatingWebhookConfiguration: no matches for kind "ValidatingWebhookConfiguration" in version "admissionregistration.k8s.io/v1beta1" not found
/test integration
/test integration
/test notebooks
/test notebooks
for record - notebook/integration tests pass
