etcd: fix service config to work with latest versions

This patch fixes a problem with OpenStack tooz's etcd3gw
driver when it attempts to communicate with the etcd service.
The tooz driver uses etcd's grpc gateway functionality, but
starting with etcd v3.3 the grpc gateway is not enabled by
default (for wallaby, centos-8 includes etcd v3.2, but
centos-9 incudes v3.4).

Per [1], the fix involves adding a small config change to the
etcd config file.

[1] https://github.com/etcd-io/etcd/issues/12093#issuecomment-691575955

Normally this would be handled by puppet-etcd, but that puppet
module is *not* an opendev project, and is quite out of date.
It would take a lot of work to update puppet-etcd, with little
benefit beyond supporting [1].

The solution implemented here is to enhance the puppet_config
tasks to add the missing config after puppet-etcd finishes. The
long term solution is to replace puppet-etcd with a tripleo-ansible
role, but that's a larger effort.

This patch also removes the container_puppet_tasks that were
originally intended so tripleo could inject key/value pairs into
etcd. However, that functionality was never utilized, and is
currently broken due to it mounting etcd's database directory
in read-only mode. The container_puppet_tasks need to be removed
in order for the new puppet_config tasks to work correctly.

Resolves: rhbz#2097058
Change-Id: I3ed29a14298f4df94b8a5520615bfa85cd291346
This commit is contained in:
Alan Bishop 2022-06-14 12:16:53 -07:00
parent 9ed1c7b920
commit 796f6a5dca
1 changed files with 5 additions and 12 deletions

View File

@ -172,6 +172,11 @@ outputs:
- "\n"
- - "['Etcd_key'].each |String $val| { noop_resource($val) }"
- "include tripleo::profile::base::etcd"
- "file_line { 'etcd enable-grpc-gateway':"
- " path => '/etc/etcd/etcd.yml',"
- " line => 'enable-grpc-gateway: true',"
- "}"
puppet_tags: etcd_config
kolla_config:
/var/lib/kolla/config_files/etcd.json:
command: /usr/bin/etcd --config-file /etc/etcd/etcd.yml
@ -270,18 +275,6 @@ outputs:
- /etc/pki/tls/private/etcd.key:/var/lib/kolla/config_files/src-tls/etc/pki/tls/private/etcd.key:ro
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
container_puppet_tasks:
# Etcd keys initialization occurs only on single node
step_2:
config_volume: 'etcd_init_tasks'
puppet_tags: 'etcd_key'
step_config: |
include tripleo::profile::base::etcd
config_image: *etcd_config_image
# TODO(mwhahaha): need to check if this works correctly or we need to switch to a bootstrap execution
volumes:
- /var/lib/config-data/puppet-generated/etcd/etc/etcd:/etc/etcd:ro
- /var/lib/etcd:/var/lib/etcd:ro
deploy_steps_tasks:
list_concat:
- - name: Manage etcd cluster membership