From af0e077bf05ca97853bf58b4a746e2b67cf429e3 Mon Sep 17 00:00:00 2001 From: Tiago Pasqualini Date: Mon, 29 Aug 2022 18:29:39 -0300 Subject: [PATCH] Add amphora connection timeouts options to charm This patch adds the possibility to configure the number of retries and the timeout between those retries when connection to the amphorae. Closes-bug: #1988094 Change-Id: Idf25c327fe34f751f622a3a467a5ba8f73125681 (cherry picked from commit d1d369c70314532eea341e8cce4247727f4d8410) (cherry picked from commit f3617cafd8063fc0b97c23337fe79061ef28baab) --- src/config.yaml | 23 +++++++++++++++++++++++ src/templates/victoria/octavia.conf | 5 +++++ src/templates/xena/octavia.conf | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/src/config.yaml b/src/config.yaml index d68603bd..6d314406 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -198,3 +198,26 @@ options: to expire before raising a Critical alert. openstack-origin: default: yoga + connection-max-retries: + default: 120 + type: int + description: | + Retry threshold for connecting to amphorae. This is used when waiting + for a new amphora to become available as well as during a failover. + connection-retry-interval: + default: 5 + type: int + description: | + Retry timeout between connection attempts in seconds. This is used + when waiting for a new amphora to become available as well as during a + failover. + active-connection-max-retries: + default: 15 + type: int + description: | + Retry threshold for connecting to an active amphora. + active-connection-retry-interval: + default: 2 + type: int + description: | + Retry timeout between connection attempts in seconds for active amphora. diff --git a/src/templates/victoria/octavia.conf b/src/templates/victoria/octavia.conf index a356e313..b6da7e40 100644 --- a/src/templates/victoria/octavia.conf +++ b/src/templates/victoria/octavia.conf @@ -100,6 +100,11 @@ server_ca = {{ options.issuing_cacert }} # This certificate is used by the ``Octavia`` controller when it takes on the # role as a "client" connecting to the ``Amphorae``. client_cert = {{ options.controller_cert }} +connection_max_retries = {{ options.connection_max_retries }} +connection_retry_interval = {{ options.connection_retry_interval }} +active_connection_max_retries = {{ options.active_connection_max_retries }} +active_connection_retry_interval = {{ options.active_connection_retry_interval }} + {% include "parts/section-database" %} diff --git a/src/templates/xena/octavia.conf b/src/templates/xena/octavia.conf index 4e8ca3fb..1f1bfa6d 100644 --- a/src/templates/xena/octavia.conf +++ b/src/templates/xena/octavia.conf @@ -105,6 +105,10 @@ server_ca = {{ options.issuing_cacert }} # This certificate is used by the ``Octavia`` controller when it takes on the # role as a "client" connecting to the ``Amphorae``. client_cert = {{ options.controller_cert }} +connection_max_retries = {{ options.connection_max_retries }} +connection_retry_interval = {{ options.connection_retry_interval }} +active_connection_max_retries = {{ options.active_connection_max_retries }} +active_connection_retry_interval = {{ options.active_connection_retry_interval }} {% include "parts/section-database" %}