Change amphora logging to dedicated socket

In some environments running older versions of gunicorn in the
amphora image, gunicorn can fail to start do to /dev/log socket
issues (timing, configuration, etc.).

This patch sets up a dedicated rsyslog socket /run/rsyslog/octavia/log
for gunicorn and haproxy to use. This should resolve any issues with
systemd overriding the /dev/log socket.

This also bumps the gunicorn minimum verison to 19.9.0.

Change-Id: I1e1ad8fde2ad8c1ffba95b1867afb130503b0a5b
changes/61/674961/2
Michael Johnson 3 years ago
parent 6053c4baeb
commit afa917a3de
  1. 1
      elements/amphora-agent/element-deps
  2. 4
      elements/amphora-agent/static/etc/rsyslog.d/55-octavia-socket.conf
  3. 2
      lower-constraints.txt
  4. 2
      octavia/cmd/agent.py
  5. 4
      octavia/common/jinja/haproxy/combined_listeners/templates/base.j2
  6. 4
      octavia/common/jinja/haproxy/split_listeners/templates/base.j2
  7. 4
      octavia/tests/unit/amphorae/backends/agent/api_server/test_haproxy_compatibility.py
  8. 4
      octavia/tests/unit/common/sample_configs/sample_configs_combined.py
  9. 4
      octavia/tests/unit/common/sample_configs/sample_configs_split.py
  10. 2
      requirements.txt

@ -1,4 +1,5 @@
dib-init-system
install-static
package-installs
pkg-map
source-repositories

@ -0,0 +1,4 @@
module(load="imuxsock")
input(type="imuxsock"
Socket="/run/rsyslog/octavia/log"
CreatePath="on")

@ -43,7 +43,7 @@ futures==3.0.0
gitdb2==2.0.3
GitPython==2.1.8
greenlet==0.4.13
gunicorn==19.0.0
gunicorn==19.9.0
hacking==0.12.0
idna==2.6
imagesize==1.0.0

@ -83,7 +83,7 @@ def main():
'syslog': True,
'syslog_facility': 'local{}'.format(
CONF.amphora_agent.administrative_log_facility),
'syslog_addr': 'unix://dev/log',
'syslog_addr': 'unix://run/rsyslog/octavia/log#dgram',
}
AmphoraAgent(server_instance.app, options).run()

@ -17,8 +17,8 @@
global
daemon
user nobody
log {{ log_http | default('/dev/log', true)}} local{{ user_log_facility }}
log {{ log_server | default('/dev/log', true)}} local{{ administrative_log_facility }} notice
log {{ log_http | default('/run/rsyslog/octavia/log', true)}} local{{ user_log_facility }}
log {{ log_server | default('/run/rsyslog/octavia/log', true)}} local{{ administrative_log_facility }} notice
stats socket {{ sock_path }} mode 0666 level user
{% if loadbalancer.global_connection_limit is defined %}
maxconn {{ loadbalancer.global_connection_limit }}

@ -17,8 +17,8 @@
global
daemon
user nobody
log {{ log_http | default('/dev/log', true)}} local{{ user_log_facility }}
log {{ log_server | default('/dev/log', true)}} local{{ administrative_log_facility }} notice
log {{ log_http | default('/run/rsyslog/octavia/log', true)}} local{{ user_log_facility }}
log {{ log_server | default('/run/rsyslog/octavia/log', true)}} local{{ administrative_log_facility }} notice
stats socket {{ sock_path }} mode 0666 level user
{% if loadbalancer.global_connection_limit is defined %}
maxconn {{ loadbalancer.global_connection_limit }}

@ -28,8 +28,8 @@ class HAProxyCompatTestCase(base.TestCase):
"global\n"
" daemon\n"
" user nobody\n"
" log /dev/log local0\n"
" log /dev/log local1 notice\n"
" log /run/rsyslog/octavia/log local0\n"
" log /run/rsyslog/octavia/log local1 notice\n"
" stats socket /var/lib/octavia/sample_loadbalancer_id_1.sock"
" mode 0666 level user\n"
" maxconn {maxconn}\n\n"

@ -1085,8 +1085,8 @@ def sample_base_expected_config(frontend=None, backend=None,
"global\n"
" daemon\n"
" user nobody\n"
" log /dev/log local0\n"
" log /dev/log local1 notice\n"
" log /run/rsyslog/octavia/log local0\n"
" log /run/rsyslog/octavia/log local1 notice\n"
" stats socket /var/lib/octavia/sample_loadbalancer_id_1.sock"
" mode 0666 level user\n" +
global_opts + defaults + peers + frontend + backend)

@ -1103,8 +1103,8 @@ def sample_base_expected_config(frontend=None, backend=None,
"global\n"
" daemon\n"
" user nobody\n"
" log /dev/log local0\n"
" log /dev/log local1 notice\n"
" log /run/rsyslog/octavia/log local0\n"
" log /run/rsyslog/octavia/log local1 notice\n"
" stats socket /var/lib/octavia/sample_listener_id_1.sock"
" mode 0666 level user\n" +
global_opts + defaults + peers + frontend + backend)

@ -55,5 +55,5 @@ netifaces>=0.10.4 # MIT
ipaddress>=1.0.17;python_version<'3.3' # PSF
cryptography>=2.1 # BSD/Apache-2.0
pyroute2>=0.4.21;sys_platform!='win32' # Apache-2.0 (+ dual licensed GPL2)
gunicorn>=19.0.0 # MIT
gunicorn>=19.9.0 # MIT
Werkzeug>=0.14.1 # BSD License

Loading…
Cancel
Save