-
Notifications
You must be signed in to change notification settings - Fork 50
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
Deploy statefulset as component. #365
Conversation
@abdasgupta Labels area/todo, kind/todo do not exist. |
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.
Please remove this function as it is not used anymore
@gardener/etcd-druid-maintainers the PR is ready for review. |
leaseDeployer := componentlease.New(r.Client, etcd.Namespace, val.Lease) | ||
if etcd.Spec.Etcd.Image == nil { | ||
if etcdImage == "" { | ||
return nil, nil, fmt.Errorf("either etcd resource or image vector should have %s image while deploying statefulset", common.Etcd) |
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.
This will result in re-queueing of request and since the image is now nil this will keep getting re-queued right?
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.
Actually it'll only be re-queued if the images are nil and etcd
or etcd-backup-restore
images cannot be found in charts/images.yaml
, see
etcd-druid/controllers/etcd_controller.go
Line 992 in 954f6ef
images, err = imagevector.FindImages(im, imageNames) |
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.
So if the images cannot be found, re-queue will also never help, so continuously re-queueing will block on worker all the time with no real advantage. Is there any alert raised?
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.
Yes, you are right. I added a TODO that this is supposed to be part of a validating webhook. No, there is no alert but the error message is put to etcd.status.lastError
.
|
||
if etcd.Spec.Backup.Image == nil { | ||
if etcdBackupImage == "" { | ||
return nil, nil, fmt.Errorf("either etcd resource or image vector should have %s image while deploying statefulset", common.BackupRestore) |
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.
This will result in re-queueing of request and since the image is now nil this will keep getting re-queued right?
Thanks for your valuable feedback @unmarshall. I addressed most of the points in 9d31a98 and replied to the rest of the comments. |
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.
/lgtm
Comments resolved.
How to categorize this PR?
/area robustness
/kind enhancement
What this PR does / why we need it:
This PR converts the statefulset yaml to client-go code to create ETCD statefulset programmatically. Earlier an example yaml was decoded and merged with correct values to create statefulset yaml. But this PR removes the use of yaml. Instead, it fetches values from ETCD spec and directly creates statefulset using client-go for kubernetes API.
This PR also removes the logic for claiming statefulset based on label selector.
Which issue(s) this PR fixes:
Fixes part of #278
Special notes for your reviewer:
Release note: