-
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
Create member, delta/full-snapshot Leases
#262
Conversation
6687900
to
e2870a6
Compare
e2870a6
to
9b4c140
Compare
/invite @stoyanr |
@stoyanr You have pull request review open invite, please check |
9b4c140
to
282cdc9
Compare
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 Tim for a well-written PR. I just have few minor suggestions.
api/v1alpha1/etcd_types.go
Outdated
@@ -201,6 +201,9 @@ type EtcdConfig struct { | |||
// EtcdDefragTimeout defines the timeout duration for etcd defrag call | |||
// +optional | |||
EtcdDefragTimeout *metav1.Duration `json:"etcdDefragTimeout,omitempty"` | |||
// HeartbeatDuration defines the time members send a heartbeat. The default value is 10s. |
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.
// HeartbeatDuration defines the time members send a heartbeat. The default value is 10s. | |
// HeartbeatDuration defines the timeout for members to send heartbeats. The default value is 10s. |
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.
Can you explain why timeout? It's actually the duration after which a member renews the member lease.
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.
Okay. Then, instead of time
we should use duration
@@ -293,6 +293,10 @@ spec: | |||
description: EtcdDefragTimeout defines the timeout duration for | |||
etcd defrag call | |||
type: string | |||
heartbeatDuration: | |||
description: HeartbeatDuration defines the time members send a |
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.
See above suggestion regarding this
"k8s.io/apimachinery/pkg/types" | ||
) | ||
|
||
type Values struct { |
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.
Instead of struct, should we make Values as map[string]interface{}
? If we make it as struct, we need to pass separate structs to the getMapFromEtcd
function for separate components in future. WDYT?
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.
Hm yes, got your point. However, getMapFromEtcd
will only be there as long as we have not entirely transitioned all manifests to components. For the transitioning phase it should be fine to do so, wdyt?
The awkward point about map[string]interface{}
is the missing type safety for values and that you need to create constants for the keys, so that other components can use them.
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.. Sadly, until getMapFromEtcd is removed completely, parameter list of getMapFromEtcd
for each component type
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 added another componentetcd.Values
struct which aggregates the different sub values. I hope that's fine.
Thanks a lot for your review @abdasgupta. Please see my 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.
Thanks @timuthy for the PR!
I have one suggestion and one minor nitpick
/ping @abdasgupta |
Message
|
@timuthy You need rebase this pull request with latest master branch. Please check. |
0822067
to
735d69c
Compare
Thanks a lot for your review @abdasgupta. I addressed your comments in 735d69c, PTAL. |
/lgtm |
* Add lease component * Add HeartbeatDuration configuration * Add label selector for member check * Use etcd-member-unknown-threshold flag instead of LeaseDurationSeconds * Address review feedback * Address review feedback
* Add lease component * Add HeartbeatDuration configuration * Add label selector for member check * Use etcd-member-unknown-threshold flag instead of LeaseDurationSeconds * Address review feedback * Address review feedback
How to categorize this PR?
/area control-plane
/kind enhancement
What this PR does / why we need it:
This PR adds member, full snapshot and delta snapshot
Leases
which are maintained byetcd-backup-restore
.Which issue(s) this PR fixes:
Fixes part of #158
Fixes part of #278
Special notes for your reviewer:
A "component" concept was introduced in this PR which in the long run can replace the chart that we use and instead build the K8s resources within the code to achieve a better test-ability and more control how the client is used to reconcile the objects (e.g. used verb
UPDATE
vsPATCH
) or how merging objects will be implemented. The same approach was taken ingardener/gardener
.Please see this comment for more information.
Release note: