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

chore: migrate to v1 APIs #6502

Merged
merged 29 commits into from
Jul 12, 2024
Merged

chore: migrate to v1 APIs #6502

merged 29 commits into from
Jul 12, 2024

Conversation

jmdeal
Copy link
Contributor

@jmdeal jmdeal commented Jul 12, 2024

Fixes #N/A

Description
This PR updates all in-code references to the v1beta1 APIs to v1. This is largely just find and replace, but there are a few changes to note:

  • APIVersion is updated to Group in NodeClassRef
  • KubeletConfig is first parsed from the compat annotation, and then the new field on the EC2NodeClass
  • Changed the storage version from v1beta1 to v1 for CRDs

We've also updated the naming for package aliases due to the new v1 conflicts. These packages have new names:

package old alias new alias
k8s.io/api/core/v1 v1 corev1
github.com/aws/karpenter-provider-aws/pkg/apis/v1(beta1) v1beta1 v1(beta1)
sigs.k8s.io/karpenter/pkg/apis/v1(beta1) corev1beta1 karpv1(beta1)

How was this change tested?
make presubmit and /karpenter snapshot

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jmdeal jmdeal requested a review from a team as a code owner July 12, 2024 07:18
@jmdeal jmdeal requested a review from jigisha620 July 12, 2024 07:18
Copy link

netlify bot commented Jul 12, 2024

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit e321ff5
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/6691b41a3f33d10008e75114

@coveralls
Copy link

coveralls commented Jul 12, 2024

Pull Request Test Coverage Report for Build 9915073368

Details

  • 490 of 551 (88.93%) changed or added relevant lines in 47 files are covered.
  • 263 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+1.1%) to 79.826%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/apis/v1beta1/ec2nodeclass.go 0 1 0.0%
pkg/controllers/controllers.go 0 1 0.0%
pkg/controllers/nodeclass/hash/controller.go 10 11 90.91%
pkg/controllers/nodeclass/status/ami.go 5 6 83.33%
pkg/controllers/nodeclass/status/controller.go 3 4 75.0%
pkg/test/nodeclass.go 111 112 99.11%
pkg/cloudprovider/events/events.go 2 4 50.0%
pkg/controllers/nodeclaim/tagging/controller.go 7 9 77.78%
pkg/providers/launchtemplate/launchtemplate.go 13 15 86.67%
pkg/controllers/interruption/events/events.go 15 18 83.33%
Files with Coverage Reduction New Missed Lines %
pkg/apis/v1beta1/ec2nodeclass.go 12 35.0%
pkg/apis/v1beta1/ec2nodeclass_status.go 14 0.0%
pkg/apis/v1beta1/zz_generated.deepcopy.go 237 0.0%
Totals Coverage Status
Change from base Build 9914998503: 1.1%
Covered Lines: 5797
Relevant Lines: 7262

💛 - Coveralls

Copy link
Contributor Author

@jmdeal jmdeal left a comment

Choose a reason for hiding this comment

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

/karpenter snapshot

Copy link
Contributor

Snapshot successfully published to oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter:0-46bc2acb8543d367f9a97672fe197e80428a1028.
To install you must login to the ECR repo with an AWS account:

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 021119463062.dkr.ecr.us-east-1.amazonaws.com

helm upgrade --install karpenter oci://021119463062.dkr.ecr.us-east-1.amazonaws.com/karpenter/snapshot/karpenter --version "0-46bc2acb8543d367f9a97672fe197e80428a1028" --namespace "kube-system" --create-namespace \
  --set "settings.clusterName=${CLUSTER_NAME}" \
  --set "settings.interruptionQueue=${CLUSTER_NAME}" \
  --set controller.resources.requests.cpu=1 \
  --set controller.resources.requests.memory=1Gi \
  --set controller.resources.limits.cpu=1 \
  --set controller.resources.limits.memory=1Gi \
  --wait

Copy link
Contributor

@njtran njtran left a comment

Choose a reason for hiding this comment

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

Really nice work! Thanks for doing this. I think I found some artifacts of your testing

pkg/utils/utils.go Outdated Show resolved Hide resolved
pkg/providers/amifamily/resolver.go Outdated Show resolved Hide resolved
pkg/providers/launchtemplate/suite_test.go Outdated Show resolved Hide resolved
njtran
njtran previously approved these changes Jul 12, 2024
Copy link
Contributor

@njtran njtran left a comment

Choose a reason for hiding this comment

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

LGTM

@njtran njtran enabled auto-merge (squash) July 12, 2024 22:56
@njtran njtran merged commit c32ccc4 into aws:main Jul 12, 2024
18 checks passed
@jmdeal jmdeal deleted the chore/v1-migration branch August 14, 2024 22:41
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.

3 participants