-
Notifications
You must be signed in to change notification settings - Fork 48
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
PVC resizing support #616
PVC resizing support #616
Conversation
01405de
to
19b279a
Compare
90e5907
to
5bc9c45
Compare
config/rbac/role.yaml
Outdated
verbs: | ||
- get | ||
- list | ||
- patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to patch storageclasses
objects 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Env: []v1.EnvVar{ | ||
{Name: "SVC_NAME", Value: kmc.GetEtcdServiceName()}, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of this? I get that it checks the etcd svc can resolve, but why do we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check ensures the node is accessible from the other nodes during the join process.
return fmt.Errorf("failed to delete pod '%s' for resizing: %w", fmt.Sprintf("%s-%d", stsName, i), err) | ||
} | ||
} else { | ||
// Do not check other PVCs if expansion is not allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, maybe we should somehow tell user this? I see two options, update the reconcile state and/or create an event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
return "200Mi" == sts.Spec.VolumeClaimTemplates[0].Spec.Resources.Requests.Storage().String(), nil | ||
}) | ||
s.Require().NoError(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in the current test setup we cannot check much more as the local provisioners do not really support resizing?
In optimal case I think we'd need to verify couple things:
- resize actually happened
- no data has been lost
- child cluster still behaves properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Updated the test.
dc9aa9b
to
df144a4
Compare
Signed-off-by: Alexey Makhov <[email protected]>
df8e4bc
to
088de56
Compare
@@ -299,6 +299,18 @@ func (r *ClusterReconciler) initialCluster(kmc *km.Cluster, replicas int32) stri | |||
|
|||
func (r *ClusterReconciler) generateEtcdInitContainers(kmc *km.Cluster) []v1.Container { | |||
return []v1.Container{ | |||
{ | |||
// Wait for the pods dns name is resolvable, since it takes some tima after the pod is created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo here, tima instead of time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed!
return false, nil | ||
} | ||
|
||
return "250Mi" == sts.Spec.VolumeClaimTemplates[0].Spec.Resources.Requests.Storage().String(), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also verify that the etcd volume has been resized to 70Mi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes a lot of sense, thanks! Added the check for etcd statefulset
Signed-off-by: Alexey Makhov <[email protected]>
Fixes #610
k0smotron removes and recreates the Statefulset with an updated size. If the StorageClass allows expansion, k0smotron resizes PVCs and deletes pods to apply the changed PVC.
Also includes a minor etcd improvement, that makes check-etcd-scaling test pass