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
This commit is contained in:
Will Szumski 2022-06-23 16:43:26 +01:00
parent 9931f83913
commit 91d22dd40f
2 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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.