-
Notifications
You must be signed in to change notification settings - Fork 49
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
Enhance Etcd configMap to provide consistency and controllability #771
Conversation
/hold until backup-restore PR #715 is merged. |
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.
A lot of these changes we will have to be re-done once the #728 is opened up for review. This is a bit unfortunate. What i would suggest is either to include these changes in the refactor PR OR do it after that gets merged.
What happens for configmaps that are still having the old naming convention for all existing etcd-clusters created for shoots which are either active or hibernated?
api/v1alpha1/types_etcd.go
Outdated
@@ -443,7 +446,7 @@ func (e *Etcd) GetServiceAccountName() string { | |||
|
|||
// GetConfigmapName returns the name of the configmap for the Etcd. | |||
func (e *Etcd) GetConfigmapName() string { | |||
return fmt.Sprintf("etcd-bootstrap-%s", string(e.UID[:6])) | |||
return fmt.Sprintf("%s-bootstrap-%s", e.Name, (e.UID[:6])) |
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.
Maybe we should just name this as <etcd-name>-config-<etcd UID suffix>
. There is no need of including bootstrap
as part of the name IMHO.
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 reason I left it like that is because the closed PR tried to do the same and since this is a revival of it, I went with what they proposed in it. But yeah that is good, I'll update it.
api/v1alpha1/types_etcd.go
Outdated
@@ -208,6 +208,9 @@ type EtcdConfig struct { | |||
// Quota defines the etcd DB quota. | |||
// +optional | |||
Quota *resource.Quantity `json:"quota,omitempty"` | |||
// SnapshotCount defines the number of committed transactions to trigger a snapshot to disk | |||
// +optional | |||
SnapshotCount *int `json:"snapshotCount,omitempty"` |
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.
- once we include this as a configurable parameter, we will also have to check what happens when this parameter is updated since this is now going to be part of an etcd spec.
- The description can simply be:
configures the number of applied Raft entries to hold in-memory before compaction
and also provide a link to https://etcd.io/docs/v3.4/op-guide/maintenance/#raft-log-retention
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.
we will also have to check what happens when this parameter is updated since this is now going to be part of an etcd spec.
Sorry, I didn't get this. If the param is updated, then in the next reconciliation it will be reflected in the configMap. Is your question about how etcd container reacts to this change? I've tried this locally and it didn't affect the cluster in anyway. Pls correct me if this is about something else.
The description can simply be: configures the number of applied Raft entries to hold in-memory before compaction
Sure, this is more readable. I'll update.
@@ -563,6 +563,10 @@ spec: | |||
serverPort: | |||
format: int32 | |||
type: integer | |||
snapshotCount: | |||
description: SnapshotCount defines the number of committed transactions |
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.
adjust the description.
@unmarshall thanks for the review.
That's fine, if that PR decides to incorporate these, then I'll close this. Else, we can merge this after that.
For that, some temporary code has been added here to delete the old configmaps during the reconciliation. That can be removed once all the configmaps of every shoot namespace are deleted, probably after a few releases. |
f247507
to
fec5c09
Compare
How to categorize this PR?
/area quality
/kind cleanup
/kind enhancement
What this PR does / why we need it:
This PR is to cleanup the Etcd ConfigMap to :
etcd.Name
instead of just havingetcd
. This is for consistency with other resources that gets created as part of Etcd Reconciliation, like leases, role, rolebinding, etc. This also involves cleanup logic for the existing configMap with older name.snapshot-count
configurable with the flagsnapshotCount
fromspec.etcd
section of etcd CR thus the operator is able to control the no.of transactions before committing a snapshot to disk if they want to.initial-advertise-peer-urls
andadvertise-client-urls
properties of the configMap and thereby fixing [Enhancement] Simplify etcd configuration and use proper URL instead of using @ as separator #476Which issue(s) this PR fixes:
Fixes #717
Special notes for your reviewer:
Release note: