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

Replace etcd init script and bump etcd version #29109

Merged

Conversation

JamesLaverack
Copy link
Member

@JamesLaverack JamesLaverack commented Nov 10, 2023

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!

This is a follow-on PR from #26352, that rebases much of the work and changes the approach.

This change replaces the etcd init script that is normally executed in the etcd container when starting clustermesh-apiserver. Instead the etcd binary is bundled into the clustermesh-apiserver container image, and a new command is added in Go that will start the server and initalise the data directory.

This is intended as a direct replacement of the current etcd in clustermesh deployments.

Previously, we have been unable to update the etcd image as the script requires sh to be present, which isn't in newer etcd images that have moved to distroless.

Fixes: #23770

Replace etcd init script used for clustermesh with a Go equivalent.
Upgrade etcd to v3.5.10.

@JamesLaverack JamesLaverack requested review from a team as code owners November 10, 2023 16:30
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 10, 2023
@JamesLaverack
Copy link
Member Author

/ci-clustermesh

@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Nov 10, 2023
@giorio94 giorio94 self-requested a review November 10, 2023 16:43
@JamesLaverack JamesLaverack force-pushed the etcd-init-clustermesh-single-image branch 3 times, most recently from c65e8e1 to 37f9e79 Compare November 10, 2023 17:43
@giorio94 giorio94 added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. area/clustermesh Relates to multi-cluster routing functionality in Cilium. labels Nov 10, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Nov 10, 2023
clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
images/clustermesh-apiserver/Dockerfile Outdated Show resolved Hide resolved
pkg/etcd/init/init.go Outdated Show resolved Hide resolved
install/kubernetes/cilium/values.yaml.tmpl Outdated Show resolved Hide resolved
@tommyp1ckles tommyp1ckles removed the kind/community-contribution This was a contribution made by a community member. label Nov 11, 2023
Copy link
Member

@giorio94 giorio94 left a comment

Choose a reason for hiding this comment

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

Nice work @JamesLaverack!

The overall structure looks good to me. You can find a few comments and suggestions inline.

clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Outdated Show resolved Hide resolved
pkg/etcd/init/init.go Outdated Show resolved Hide resolved
pkg/etcd/init/init.go Outdated Show resolved Hide resolved
pkg/etcd/init/init.go Outdated Show resolved Hide resolved
pkg/etcd/init/init.go Outdated Show resolved Hide resolved
pkg/etcd/init/init.go Outdated Show resolved Hide resolved
@thorn3r thorn3r removed their request for review November 13, 2023 14:06
@maintainer-s-little-helper
Copy link

Commits f9abac2, ecdf98c, 86e0deb do not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Nov 14, 2023
@JamesLaverack JamesLaverack requested a review from a team as a code owner November 14, 2023 19:44
@maintainer-s-little-helper
Copy link

Commits f9abac2, ecdf98c, 86e0deb, 7f5476e do not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commits f9abac2, ecdf98c, 86e0deb, 7f5476e, 7504106 do not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commits f9abac2, ecdf98c, 86e0deb, 7f5476e, 7504106, 234086c do not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@JamesLaverack JamesLaverack force-pushed the etcd-init-clustermesh-single-image branch from 234086c to 59bd78e Compare November 14, 2023 20:02
Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Helm changes look good to me, thanks!

This change replaces the etcd init script that is normally executed in
the etcd container when starting clustermesh-apiserver. Instead the etcd
binary is bundled into the clustermesh-apiserver container image, and
a new command is added in Go that will start the server and init the data
directory.

This is intended as a direct replacement of the current etcd in
clustermesh deployments.

Previously, we have been unable to update the etcd image as the script
requires sh to be present, which isn't in newer etcd images that have
moved to distroless.

Signed-off-by: James Laverack <james@isovalent.com>
@JamesLaverack JamesLaverack force-pushed the etcd-init-clustermesh-single-image branch from cf6cb44 to 94ee894 Compare November 15, 2023 14:58
@JamesLaverack
Copy link
Member Author

/test

@JamesLaverack
Copy link
Member Author

Looks like a flake on one of the conformance tests?

/test

@giorio94
Copy link
Member

Looks like a flake on one of the conformance tests?

/test

FYI, you can restart a single test using the trigger phrase part of the workflow name (e.g., ci-clustermesh). Flakes should also be tracked linking them to an existing issue when present, or creating a new one.

Copy link
Member

@giorio94 giorio94 left a comment

Choose a reason for hiding this comment

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

Looks great to me 🚀, thanks @JamesLaverack!

Just a few final nits inline (feel free to ignore them if you don't want to go through a new round of CI testing though).

clustermesh-apiserver/etcdinit/root.go Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Show resolved Hide resolved
install/kubernetes/cilium/values.yaml.tmpl Show resolved Hide resolved
pkg/kvstore/etcdinit/init.go Show resolved Hide resolved
clustermesh-apiserver/etcdinit/root.go Show resolved Hide resolved
@maintainer-s-little-helper maintainer-s-little-helper bot added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Nov 16, 2023
@giorio94
Copy link
Member

Removing the ready to merge label, to wait for Tom's review.

@giorio94 giorio94 removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 16, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 16, 2023
@giorio94 giorio94 added dont-merge/bad-bot To prevent MLH from marking ready-to-merge. and removed ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Nov 16, 2023
@tommyp1ckles
Copy link
Contributor

@JamesLaverack @giorio94 sorry for the late review, looks good

@giorio94 giorio94 removed the dont-merge/bad-bot To prevent MLH from marking ready-to-merge. label Nov 21, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 21, 2023
@julianwiedmann julianwiedmann merged commit 4bfc508 into cilium:main Nov 21, 2023
61 checks passed
@JamesLaverack JamesLaverack deleted the etcd-init-clustermesh-single-image branch November 21, 2023 09:09
JamesLaverack added a commit to JamesLaverack/cilium that referenced this pull request Nov 29, 2023
This is a follow on from the review of
cilium#29109, and is a collection of
minor changes:
- Remove unused variables in install/kubernetes Makefile values file
- Remove etcd image from check-docker-images.sh script
- Remove now-unused external dependencies block from
  check-docker-images.sh script
- Clarify doc comment for ClusterMeshEtcdInit function, to correctly
  state the purpose of the hasConfig key
- defer etcdClient.Close() after creating etcdClient
- Use errors.Join to handle errors in defered cleanup code, where the
  main function may have also returned an error
- Correct typo in comment: "it's" to "its"

Signed-off-by: James Laverack <james@isovalent.com>
giorio94 pushed a commit to JamesLaverack/cilium that referenced this pull request Dec 1, 2023
This is a follow on from the review of
cilium#29109, and is a collection of
minor changes:
- Remove unused variables in install/kubernetes Makefile values file
- Remove etcd image from check-docker-images.sh script
- Remove now-unused external dependencies block from
  check-docker-images.sh script
- Clarify doc comment for ClusterMeshEtcdInit function, to correctly
  state the purpose of the hasConfig key
- defer etcdClient.Close() after creating etcdClient
- Use errors.Join to handle errors in defered cleanup code, where the
  main function may have also returned an error
- Correct typo in comment: "it's" to "its"

Signed-off-by: James Laverack <james@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Dec 1, 2023
This is a follow on from the review of
#29109, and is a collection of
minor changes:
- Remove unused variables in install/kubernetes Makefile values file
- Remove etcd image from check-docker-images.sh script
- Remove now-unused external dependencies block from
  check-docker-images.sh script
- Clarify doc comment for ClusterMeshEtcdInit function, to correctly
  state the purpose of the hasConfig key
- defer etcdClient.Close() after creating etcdClient
- Use errors.Join to handle errors in defered cleanup code, where the
  main function may have also returned an error
- Correct typo in comment: "it's" to "its"

Signed-off-by: James Laverack <james@isovalent.com>
pjablonski123 pushed a commit to pjablonski123/cilium that referenced this pull request Dec 15, 2023
This is a follow on from the review of
cilium#29109, and is a collection of
minor changes:
- Remove unused variables in install/kubernetes Makefile values file
- Remove etcd image from check-docker-images.sh script
- Remove now-unused external dependencies block from
  check-docker-images.sh script
- Clarify doc comment for ClusterMeshEtcdInit function, to correctly
  state the purpose of the hasConfig key
- defer etcdClient.Close() after creating etcdClient
- Use errors.Join to handle errors in defered cleanup code, where the
  main function may have also returned an error
- Correct typo in comment: "it's" to "its"

Signed-off-by: James Laverack <james@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clustermesh Relates to multi-cluster routing functionality in Cilium. kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update clustermesh-apiserver initContainer to configure etcd for v3.5.7 or later
5 participants