From 91d22dd40fab3b410709bb7cabcf0b0f830214bc Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Thu, 23 Jun 2022 16:43:26 +0100 Subject: [PATCH] Install etcd binary from github Removes a dependency on RDO for install etcd in CentOS images. Aligns version of etcd across all distributions, see below: ``` (venv-kolla) [will@juno kolla]$ docker run --rm -it kolla/ubuntu-source-etcd:yoga bash ()[etcd@730a011b670a /]$ etcd --version etcd Version: 3.2.26 Git SHA: Not provided (use ./build instead of go build) Go Version: go1.13.7 Go OS/Arch: linux/amd64 ``` ``` (venv-kolla) [will@juno kolla]$ sudo docker run -it kolla/centos-source-etcd:yoga bash ()[etcd@9aa486c9e94f /]$ etcd --version etcd Version: 3.2.21 Git SHA: 3ac81f3 Go Version: go1.12.8 Go OS/Arch: linux/amd64 ``` ``` (venv-kolla) [will@juno kolla]$ docker run --rm -it kolla/debian-source-etcd:yoga bash ()[etcd@b49cb5fcdf87 /]$ etcd --version etcd Version: 3.3.25 Git SHA: Not provided (use ./build instead of go build) Go Version: go1.15.9 Go OS/Arch: linux/amd64 ``` This will also allow us to update to a more recent version in the future. We have to be careful not to jump by more than one point release to ensure compatibility: https://etcd.io/docs/v3.5/upgrades/upgrading-etcd/#upgrading-an-etcd-v3x-cluster Change-Id: I62a34256fb7395d0448af169ac3cf036f60cd290 --- docker/etcd/Dockerfile.j2 | 16 ++++++++++------ .../etcd-binary-install-fc88930f4bf6ce2c.yaml | 6 ++++++ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/etcd-binary-install-fc88930f4bf6ce2c.yaml diff --git a/docker/etcd/Dockerfile.j2 b/docker/etcd/Dockerfile.j2 index dc39acbe2f..6f55b0b15a 100644 --- a/docker/etcd/Dockerfile.j2 +++ b/docker/etcd/Dockerfile.j2 @@ -9,12 +9,16 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {{ macros.configure_user(name='etcd') }} -{% if base_package_type == 'rpm' %} - {% set etcd_packages = ['etcd'] %} -{% elif base_package_type == 'deb' %} - {% set etcd_packages = ['etcd'] %} -{% endif %} -{{ macros.install_packages(etcd_packages | customizable("packages")) }} +{% block etcd_repository_version %} +# NOTE(wszumski): It is suggested to upgrade one minor version at a time: +# https://github.com/etcd-io/website/blob/3e04053d1cb15b2ddc2904ba4121ca5aa73bea66/content/en/docs/v3.3/upgrades/upgrade_3_3.md#upgrade-requirements +ARG etcd_version=v3.3.27 +ARG etcd_url=https://github.com/etcd-io/etcd/releases/download/${etcd_version}/etcd-${etcd_version}-linux-{{debian_arch}}.tar.gz +{% endblock %} + +RUN curl ${etcd_url} -o /tmp/etcd.tar.gz \ + && tar -C /usr/bin -xvz --strip-components=1 --wildcards '*/etcd' --wildcards '*/etcdctl' -f /tmp/etcd.tar.gz \ + && rm -f /tmp/etcd.tar.gz COPY etcd_sudoers /etc/sudoers.d/kolla_etcd_sudoers COPY extend_start.sh /usr/local/bin/kolla_extend_start diff --git a/releasenotes/notes/etcd-binary-install-fc88930f4bf6ce2c.yaml b/releasenotes/notes/etcd-binary-install-fc88930f4bf6ce2c.yaml new file mode 100644 index 0000000000..d76ee06a17 --- /dev/null +++ b/releasenotes/notes/etcd-binary-install-fc88930f4bf6ce2c.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + ``etcd`` is now installed from the upstream binaries published to github + rather than via the OS package manager. This aligns the etcd version across + all distributions for compatibility.