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

fix: Discover default storage class when none specified #293

Merged

Conversation

jonathan-innis
Copy link
Member

@jonathan-innis jonathan-innis commented Apr 13, 2023

Fixes aws/karpenter-provider-aws#3647

Description

Previously, when the following volumeClaimTemplate was used for Deployments, we would not discover the storageClassName that is being used as the default and fail to find the driver associated with a volume

volumes:
- name: scratch-volume
  ephemeral:
      volumeClaimTemplate:
         spec:
           accessModes: [ "ReadWriteOnce" ]
           resources:
             requests:
               storage: 3Gi

This meant that Karpenter and the kube-scheduler would disagree. Karpenter would think that more pods could schedule on the node and the kube-scheduler would reject this due to the volume limits on the node. This change fixes this discovery by finding the default storage class (if one is specified) and using that if no storageClassName is specified

How was this change tested?

  • make presubmit
  • Manual Testing

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

@jonathan-innis jonathan-innis force-pushed the discover-default-sc branch 3 times, most recently from 866d826 to bd4608f Compare April 13, 2023 19:18
@coveralls
Copy link

coveralls commented Apr 13, 2023

Pull Request Test Coverage Report for Build 4696862521

  • 21 of 25 (84.0%) changed or added relevant lines in 1 file are covered.
  • 19 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.2%) to 81.423%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/scheduling/volumeusage.go 21 25 84.0%
Files with Coverage Reduction New Missed Lines %
pkg/controllers/state/cluster.go 6 84.47%
pkg/controllers/deprovisioning/controller.go 13 79.51%
Totals Coverage Status
Change from base Build 4692105904: 0.2%
Covered Lines: 6750
Relevant Lines: 8290

💛 - Coveralls

@jonathan-innis jonathan-innis marked this pull request as ready for review April 13, 2023 22:26
@jonathan-innis jonathan-innis requested a review from a team as a code owner April 13, 2023 22:26
@jonathan-innis jonathan-innis requested a review from njtran April 13, 2023 22:26
@jonathan-innis jonathan-innis enabled auto-merge (squash) April 13, 2023 22:30
@jonathan-innis jonathan-innis force-pushed the discover-default-sc branch 2 times, most recently from fc32bdd to ba01dcc Compare April 13, 2023 22:34
@jonathan-innis jonathan-innis force-pushed the discover-default-sc branch 3 times, most recently from fde2a85 to dd772db Compare April 13, 2023 23:22
Copy link
Contributor

@tzneal tzneal left a comment

Choose a reason for hiding this comment

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

lgtm

@jonathan-innis jonathan-innis merged commit ace3584 into kubernetes-sigs:main Apr 14, 2023
jonathan-innis added a commit to jonathan-innis/karpenter that referenced this pull request Apr 14, 2023
jonathan-innis added a commit to jonathan-innis/karpenter that referenced this pull request Apr 14, 2023
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.

Karpenter does not respect volume-attach-limit set for EBS volumes.
3 participants