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

feat: support pvc expansion #285

Merged
merged 4 commits into from
Sep 21, 2023
Merged

feat: support pvc expansion #285

merged 4 commits into from
Sep 21, 2023

Conversation

kqzh
Copy link
Contributor

@kqzh kqzh commented Sep 20, 2023

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Description:

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

@kqzh kqzh requested a review from MegaByte875 September 20, 2023 09:38
}
}
if oldPVC == nil {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

If the first one is nil, then other volumeClaim and replicas do not need to be processed?

@veezhang
Copy link
Contributor

How about support automatic expansion?

@@ -504,3 +504,36 @@ func updatePod(clientSet kube.ClientSet, newPod, oldPod *corev1.Pod) error {
func isPending(pod *corev1.Pod) bool {
return pod.Status.Phase == corev1.PodPending
}

// 1. new pvc is not nil, old pvc is not nil, update storage
func syncPVC(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to check whether pvc supports expansion?

Copy link
Contributor

@MegaByte875 MegaByte875 left a comment

Choose a reason for hiding this comment

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

LGTM

if oldPVC == nil {
return nil
}
if volumeClaim.Spec.Resources.Requests.Storage().Cmp(*oldPVC.Spec.Resources.Requests.Storage()) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if new PVC requests less than old PVC

@MegaByte875 MegaByte875 merged commit 0d9dbbe into vesoft-inc:master Sep 21, 2023
1 check passed
@wey-gu wey-gu added the doc affected PR: improvements or additions to documentation label Sep 21, 2023
@wey-gu
Copy link
Contributor

wey-gu commented Sep 21, 2023

So very excited about this feature!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affected PR: improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PVC expansion
4 participants