Skip to content
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

Upgrade Kubernetes schema and client libraries to v1.32 #3343

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

rquitales
Copy link
Member

Proposed changes

Upgrade Kubernetes schema and client libraries to v1.32. Go is also updated to v1.23 as an upstream library requires this.

NOTE: This PR currently points to the first release candidate of v1.32 to surface any potential issues with upgrading. We'll need to point to the final release of v1.32 before we can merge this PR.

pulumi/cloud-ready-checks is also upgraded in pulumi/cloud-ready-checks#51

Related issues (optional)

Closes: #3295

@rquitales rquitales changed the title Upgrade Kubernetes schema and client libraries to v1.3 Upgrade Kubernetes schema and client libraries to v1.32 Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

Does the PR have any schema changes?

Looking good! No breaking changes found.

New resources:

  • admissionregistration.k8s.io/v1alpha1.MutatingAdmissionPolicy
  • admissionregistration.k8s.io/v1alpha1.MutatingAdmissionPolicyBinding
  • admissionregistration.k8s.io/v1alpha1.MutatingAdmissionPolicyBindingList
  • admissionregistration.k8s.io/v1alpha1.MutatingAdmissionPolicyBindingPatch
  • admissionregistration.k8s.io/v1alpha1.MutatingAdmissionPolicyList
  • admissionregistration.k8s.io/v1alpha1.MutatingAdmissionPolicyPatch
  • coordination.k8s.io/v1alpha2.LeaseCandidate
  • coordination.k8s.io/v1alpha2.LeaseCandidateList
  • coordination.k8s.io/v1alpha2.LeaseCandidatePatch
  • resource.k8s.io/v1alpha3.ResourceSliceList
  • resource.k8s.io/v1beta1.DeviceClass
  • resource.k8s.io/v1beta1.DeviceClassList
  • resource.k8s.io/v1beta1.DeviceClassPatch
  • resource.k8s.io/v1beta1.ResourceClaim
  • resource.k8s.io/v1beta1.ResourceClaimList
  • resource.k8s.io/v1beta1.ResourceClaimPatch
  • resource.k8s.io/v1beta1.ResourceClaimTemplate
  • resource.k8s.io/v1beta1.ResourceClaimTemplateList
  • resource.k8s.io/v1beta1.ResourceClaimTemplatePatch
  • resource.k8s.io/v1beta1.ResourceSlice
  • resource.k8s.io/v1beta1.ResourceSliceList
  • resource.k8s.io/v1beta1.ResourceSlicePatch

@rquitales
Copy link
Member Author

Note: need to merge in the deleted types to support customers of older clusters.

Within the `tests/` and `provider/` folders, the following command was
run:

```sh
cat go.mod | grep "^\sk8s.io" | grep -v "// indirect" | awk '{print $1}' | xargs -I {} go get -u {}@v0.32.0-rc.0
```3
Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.08%. Comparing base (d440f53) to head (be4c345).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3343   +/-   ##
=======================================
  Coverage   41.08%   41.08%           
=======================================
  Files          85       85           
  Lines       12736    12736           
=======================================
  Hits         5232     5232           
  Misses       7115     7115           
  Partials      389      389           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@blampe blampe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick look at https://kubernetes.io/docs/reference/using-api/deprecation-guide/ and I think this is accurate for v1.32 as well as a couple resources we might have missed.

diff --git a/provider/pkg/kinds/deprecated.go b/provider/pkg/kinds/deprecated.go
index efda53a52..51db13ec3 100644
--- a/provider/pkg/kinds/deprecated.go
+++ b/provider/pkg/kinds/deprecated.go
@@ -89,8 +89,11 @@ var v121 = cluster.ServerVersion{Major: 1, Minor: 21}
 var v122 = cluster.ServerVersion{Major: 1, Minor: 22}
 var v124 = cluster.ServerVersion{Major: 1, Minor: 24}
 var v125 = cluster.ServerVersion{Major: 1, Minor: 25}
+var v126 = cluster.ServerVersion{Major: 1, Minor: 26}
 var v127 = cluster.ServerVersion{Major: 1, Minor: 27}
+var v129 = cluster.ServerVersion{Major: 1, Minor: 29}
 var v131 = cluster.ServerVersion{Major: 1, Minor: 31}
+var v132 = cluster.ServerVersion{Major: 1, Minor: 32}

 func gvkStr(gvk schema.GroupVersionKind) string {
        return gvk.GroupVersion().String() + "/" + gvk.Kind
@@ -298,6 +301,32 @@ func RemovedInVersion(gvk schema.GroupVersionKind) *cluster.ServerVersion {
                        return &v127
                }
                return nil
+       case AutoscalingV2B2:
+               if k == HorizontalPodAutoscaler {
+                       return &v126
+               }
+               return nil
+       case FlowcontrolV1B1:
+               switch k {
+               case FlowSchema, PriorityLevelConfiguration:
+                       return &v126
+               default:
+                       return nil
+               }
+       case FlowcontrolV1B2:
+               switch k {
+               case FlowSchema, PriorityLevelConfiguration:
+                       return &v129
+               default:
+                       return nil
+               }
+       case FlowcontrolV1B3:
+               switch k {
+               case FlowSchema, PriorityLevelConfiguration:
+                       return &v132
+               default:
+                       return nil
+               }
        default:
                return nil
        }

github.com/pkg/errors v0.9.1
github.com/pulumi/cloud-ready-checks v1.1.1-0.20241125001147-e1786eda07fe
github.com/pulumi/cloud-ready-checks v1.1.1-0.20241203165528-1365154e0aa4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still question if this is necessary, since c-r-k's go.mod simply specifies version minimums. e1786eda07fe is still compatible with 1.32, so (in theory) we don't need to change anything, but version conflicts with k8s stuff never fail to surprise me so who knows...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that we don't really need to upgrade cloud-ready-checks for compatibility support - but rather, it's so we have consistency across our codebases. There was only 1 release in the past (iirc v1.29) that strictly required cloud-ready-checks to also be upgraded due to interface inconsistencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Kubernetes v1.32 on release
2 participants