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

Get previous disk usage only from existing machine configs #6699

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

abhay-krishna
Copy link
Member

@abhay-krishna abhay-krishna commented Sep 19, 2023

During upgrade of an EKS-A vSphere cluster, one of the preflight checks we do is to validate whether the cumulative disk size requirements of the VSphereMachineConfigs can be met by the vCenter datastore. For this, we get the previous disk size requirement for each VSphereMachineConfig and then add it to the value in the new cluster config, and we sum this value across all VSphereMachineConfigs and compare it to the available space in the datastore. The previous disk usage is obtained by performing a kubectl get call on the VSphereMachineConfig object in the old cluster, but we are also doing this for newly added VSphereMachineConfig which don't exist on the old cluster, which leads to errors like

Error: "Validation failed {"validation": "vsphere provider validation", "error": "validating vsphere machine configs datastore usage: calculating datastore usage: getting eksa vsphere cluster Error from server (NotFound): [vspheremachineconfigs.anywhere.eks.amazonaws.com](http://vspheremachineconfigs.anywhere.eks.amazonaws.com/) \"new-vsphere-machine-config\" not found\n", "remediation": ""}"

We should try to fetch the object only if the previous count of the corresponding WorkerNodeConfiguration is greater than 0, which indicates that the VSphereMachineConfig exists on the old cluster.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 19, 2023
@abhay-krishna abhay-krishna force-pushed the fix-datastore-validation branch from 74525d4 to 03689d4 Compare September 19, 2023 07:42
@eks-distro-bot eks-distro-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 19, 2023
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (8382d1a) 75.59% compared to head (7e4d86a) 75.60%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6699   +/-   ##
=======================================
  Coverage   75.59%   75.60%           
=======================================
  Files         474      474           
  Lines       38250    38251    +1     
=======================================
+ Hits        28916    28920    +4     
+ Misses       7726     7724    -2     
+ Partials     1608     1607    -1     
Files Changed Coverage Δ
pkg/providers/vsphere/vsphere.go 68.82% <100.00%> (+0.39%) ⬆️

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

@abhay-krishna abhay-krishna force-pushed the fix-datastore-validation branch from 03689d4 to 56a73b5 Compare September 19, 2023 07:51
@abhay-krishna abhay-krishna force-pushed the fix-datastore-validation branch from 56a73b5 to 7e4d86a Compare September 19, 2023 07:57
@eks-distro-bot eks-distro-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 19, 2023
@abhay-krishna abhay-krishna changed the title Calculate previous datastore usage from existing machine configs Get previous disk usage only from existing machine configs Sep 19, 2023
@abhay-krishna
Copy link
Member Author

/approve
/backport release-0.17

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhay-krishna

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@eks-distro-bot eks-distro-bot merged commit 8f307c9 into aws:main Sep 19, 2023
5 checks passed
@abhay-krishna
Copy link
Member Author

/cherrypick release-0.17

@eks-distro-pr-bot
Copy link
Contributor

@abhay-krishna: new pull request created: #6700

In response to this:

/cherrypick release-0.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants