Repository: kubernetes/autoscaler (Go)

Issue:
Remove v1beta2 API
Follow up to #4969, remove the deprecated API.

> Beta API versions must be supported for 9 months or 3 releases (whichever is longer) after deprecation

Deprecation was in [VPA 0.13.0](https://github.com/kubernetes/autoscaler/releases/tag/vertical-pod-autoscaler-0.13.0), which was released on 2023-02-03; In the mean time we had [VPA 0.14.0](https://github.com/kubernetes/autoscaler/releases/tag/vertical-pod-autoscaler-0.14.0).

So  the next VPA can't drop the API yet (it will be 3rd one). We also need to wait at least until 2023-11-03 before dropping the API.

So likely the release triggered by K8s 1.28 in August keeps the API.

And the release triggered by K8s 1.29 can drop it.



Discussion: Any update on this issue, as current k8s version is k8s v1.31and v1beta2 API (with depricated message) is still present in [vpa-v1-crd-gen.yaml](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml) file.
cc @jbartosik @voelzmo @kwiesmueller
Agreed, we should be able to drop this now and document that the new release won't work with k8s versions < v1.29
SGTM
> Agreed, we should be able to drop this now and document that the new release won't work with k8s versions < v1.29

Isn't the removal of the CRD/API related to the VPA version and not the Kubernetes version?
We've been trying to release a VPA version roughly every k8s minor version so that's likely what Joachim was meaning here.
> We've been trying to release a VPA version roughly every k8s minor version so that's likely what Joachim was meaning here.

Oh interesting, I never knew that.
Since that's not a promise we make to users (directly or indirectly) I'd suggest that the communication about deprecation references which version of the VPA drops support, not which versions of Kubernetes drop support.


> Since that's not a promise we make to users (directly or indirectly)

I see we do have it written down here: https://github.com/kubernetes/autoscaler/blob/16210e3da03def7e7cd5cc55012dd2ff6ffd8683/vertical-pod-autoscaler/RELEASE.md#L3-L4

So we do kinda promise it to the user, I guess.
/assign 



Fix (patch):
diff --git a/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml b/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
index 6499413aa751..70345adcccd6 100644
--- a/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
+++ b/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
@@ -217,7 +217,7 @@ spec:
                 type: string
             type: object
         type: object
-    served: true
+    served: false
     storage: false
 ---
 apiVersion: apiextensions.k8s.io/v1
@@ -828,7 +828,7 @@ spec:
         required:
         - spec
         type: object
-    served: true
+    served: false
     storage: false
     subresources:
       status: {}
diff --git a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go
index fa21da2337cb..b58fe35b15ea 100644
--- a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go
+++ b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2/types.go
@@ -50,6 +50,7 @@ type VerticalPodAutoscalerList struct {
 // +k8s:prerelease-lifecycle-gen:deprecated=0.13.0
 // +k8s:prerelease-lifecycle-gen:replacement=autoscaling,v1,VerticalPodAutoscaler
 // +kubebuilder:deprecatedversion:warning=autoscaling.k8s.io/v1beta2 API is deprecated
+// +kubebuilder:unservedversion
 type VerticalPodAutoscaler struct {
 	metav1.TypeMeta   `json:",inline"`
 	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
@@ -275,6 +276,7 @@ type VerticalPodAutoscalerCondition struct {
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
 // +kubebuilder:resource:shortName=vpacheckpoint
 // +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes/kubernetes/pull/63797"
+// +kubebuilder:unservedversion
 
 // VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that
 // is used for recovery after recommender's restart.