Skip to content
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

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

shreyas-s-rao
Copy link
Contributor

@shreyas-s-rao shreyas-s-rao commented Apr 20, 2021

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 and v3.5.0-alpha.0) have been "backported" by manually building new container images of these with the built-in bootstrap script, tagged v3.4.13-bootstrap, v3.4.14-bootstrap and v3.5.0-alpha.0-bootstrap respectively. Please test these new, manually built images before merging.

Release note:

Etcd bootstrap script now resides in the custom etcd image instead of being mounted as a configmap.

@shreyas-s-rao shreyas-s-rao added this to the v0.5.0 milestone Apr 20, 2021
@shreyas-s-rao shreyas-s-rao requested a review from a team as a code owner April 20, 2021 17:45
@gardener-robot gardener-robot added area/backup Backup related kind/enhancement Enhancement, improvement, extension priority/blocker Needs to be resolved now, because it breaks the service needs/review Needs review size/l Size of pull request is large (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Apr 20, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 20, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 20, 2021
@shreyas-s-rao
Copy link
Contributor Author

Corresponding PR on etcd-custom image has been created here -> gardener/etcd-custom-image#1

@shreyas-s-rao shreyas-s-rao added area/robustness Robustness, reliability, resilience related component/etcd-druid ETCD Druid labels Apr 20, 2021
@ishan16696
Copy link
Member

Hi @shreyas-s-rao ,
So you are just moving out the Etcd bootstrap script only, not the etcd.conf.yaml which is also passed as config map right?
I am asking this because I am making auto-compaction configurable in this PR. So, just take care of which PR should go first

@shreyas-s-rao
Copy link
Contributor Author

@ishan16696 only the bootstrap script (bootstrap.sh) moves out, while etcd config (etcd.conf.yaml) stays within druid charts, so your PR will not be affected. Also, PRs will be merged in order of creation, so you need not rebase over my PR.

@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 22, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Apr 22, 2021
@shreyas-s-rao
Copy link
Contributor Author

@abdasgupta made few changes to the PR. Please re-review the code changes. Thanks

Copy link
Collaborator

@amshuman-kr amshuman-kr left a 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.

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
imageBR := "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3"
imageBR := "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0"

Copy link
Contributor Author

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.

Comment on lines +95 to +100
- 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 }}"
Copy link
Collaborator

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?

Copy link
Contributor Author

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
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tag: "v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3"
tag: "v0.12.0"

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
imageBR = "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3"
imageBR = "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0"

Copy link
Contributor Author

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

},
{
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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 Show resolved Hide resolved
},
{
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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0-dev-2cb339762d03d5cc9c78bda855fdf48f309de9c3",
Image: "eu.gcr.io/gardener-project/gardener/etcdbrctl:v0.12.0",

@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Apr 23, 2021
@shreyas-s-rao shreyas-s-rao added the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Apr 23, 2021
Copy link
Contributor

@abdasgupta abdasgupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ishan16696
Copy link
Member

LGTM

Signed-off-by: Shreyas Rao <shreyas.sriganesh.rao@sap.com>
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 26, 2021
@shreyas-s-rao shreyas-s-rao merged commit 001726d into gardener:master Apr 26, 2021
@shreyas-s-rao shreyas-s-rao deleted the move-bootstrap-script branch April 26, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backup Backup related area/robustness Robustness, reliability, resilience related component/etcd-druid ETCD Druid kind/enhancement Enhancement, improvement, extension needs/changes Needs (more) changes needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review needs/second-opinion Needs second review by someone else priority/blocker Needs to be resolved now, because it breaks the service reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies size/l Size of pull request is large (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Move out bootstrap script to etcd image
7 participants