Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
etcd: fix service config to work with latest versions
Browse files Browse the repository at this point in the history
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] etcd-io/etcd#12093 (comment)

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
  • Loading branch information
ASBishop committed Jun 15, 2022
1 parent 9ed1c7b commit 796f6a5
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions deployment/etcd/etcd-container-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 796f6a5

Please sign in to comment.