-
Notifications
You must be signed in to change notification settings - Fork 47
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
Move bootstrap script out of etcd-druid #162
Move bootstrap script out of etcd-druid #162
Conversation
Corresponding PR on etcd-custom image has been created here -> gardener/etcd-custom-image#1 |
Hi @shreyas-s-rao , |
@ishan16696 only the bootstrap script ( |
692d934
to
57cd875
Compare
@abdasgupta made few changes to the PR. Please re-review the code changes. Thanks |
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 please clean up the image versions? Also, a question about tests below.
api/v1alpha1/etcd_types_test.go
Outdated
imageEtcd := "eu.gcr.io/gardener-project/gardener/etcd:v3.4.13" | ||
imageBR := "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.11.1" | ||
imageEtcd := "eu.gcr.io/gardener-project/gardener/etcd:v3.4.13-bootstrap" | ||
imageBR := "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3" |
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.
imageBR := "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3" | |
imageBR := "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0" |
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.
Did not want to change these yet, as etcdbrctl:v0.12.0
hasn't been released yet, and testing in local gardener setup becomes cumbersome since the etcd resource deployed per control plane doesn't specify image versions, so the default image versions are used, and changing it becomes difficult as it gets reconciled unless we turn off gardenlet, hence made these image versions point to latest etcdbr version.
Once we make etcdbr release, all these image versions will be changed to reflect that. Hope that's ok.
- name: ENABLE_TLS | ||
value: {{ .Values.etcd.enableTLS }} | ||
- name: BACKUP_ENDPOINT | ||
value: "http{{ if .Values.etcd.enableTLS }}s{{ end }}://{{ .Values.name }}-local:{{ .Values.backup.port }}" | ||
- name: FAIL_BELOW_REVISION_PARAMETER | ||
value: "{{ if .Values.backup.failBelowRevision }}&failbelowrevision={{ int $.Values.backup.failBelowRevision }}{{ end }}" |
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.
Just for my information, what are these for?
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.
Since bootstrap script will now reside on etcd custom image, we need a way to pass some "configurable" parts of the bootstrap script to the etcd container, like backup endpoint and whether tls is enabled or not (to set the root CA certs). Hence passing them as env vars. They can also be mounted as configmap values, but env vars seemed like the simpler option. You can check the current (old) bootstrap script to see all the config that's coming in from the chart's values.yaml
file
@@ -29,7 +29,7 @@ spec: | |||
role: test | |||
etcd: | |||
metrics: basic | |||
image: eu.gcr.io/gardener-project/gardener/etcd:v3.4.13 | |||
image: eu.gcr.io/gardener-project/gardener/etcd:v3.4.13-bootstrap |
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.
Shouldn't the etcdbrctl
image version be changed too?
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, will make this change.
charts/images.yaml
Outdated
@@ -2,8 +2,8 @@ images: | |||
- name: etcd-backup-restore | |||
sourceRepository: github.com/gardener/etcd-backup-restore | |||
repository: eu.gcr.io/gardener-project/gardener/etcdbrctl | |||
tag: "v0.11.1" | |||
tag: "v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3" |
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.
tag: "v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3" | |
tag: "v0.12.0" |
controllers/etcd_controller_test.go
Outdated
imageEtcd = "eu.gcr.io/gardener-project/gardener/etcd:v3.4.13" | ||
imageBR = "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.11.1" | ||
imageEtcd = "eu.gcr.io/gardener-project/gardener/etcd:v3.4.13-bootstrap" | ||
imageBR = "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3" |
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.
imageBR = "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3" | |
imageBR = "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0" |
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 can't make this change yet since etcdbrctl:v0.12.0
has not yet been released, so the tests would fail. Have used the latest etcdbr version from master at the moment
controllers/etcd_controller_test.go
Outdated
}, | ||
{ | ||
Name: "backup-restore", | ||
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.11.1", | ||
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3", |
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.
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3", | |
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0", |
controllers/etcd_controller_test.go
Outdated
}, | ||
{ | ||
Name: "backup-restore", | ||
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.11.1", | ||
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3", |
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.
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3", | |
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0", |
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
LGTM |
Signed-off-by: Shreyas Rao <shreyas.sriganesh.rao@sap.com>
57cd875
to
2386ff1
Compare
Signed-off-by: Shreyas Rao shreyas.sriganesh.rao@sap.com
How to categorize this PR?
/area backup
/kind enhancement
/priority blocker
What this PR does / why we need it:
This PR moves bootstrap script out of etcd-druid. The bootstrap will now reside in the custom etcd image itself, to avoid the out-of-sync configmap and statefulset spec issue described by gardener-attic/gardener-resource-manager#104.
Which issue(s) this PR fixes:
Fixes #159
Special notes for your reviewer:
Druid now passes config to the bootstrap script by setting environment variables in the etcd container.
Older etcd versions (
v3.4.13
,v3.4.14
andv3.5.0-alpha.0
) have been "backported" by manually building new container images of these with the built-in bootstrap script, taggedv3.4.13-bootstrap
,v3.4.14-bootstrap
andv3.5.0-alpha.0-bootstrap
respectively. Please test these new, manually built images before merging.Release note: