207 Commits

Author SHA1 Message Date
Ann Taraday
befa073495 Bump taskflow version
Taskflow 4.4.0 contains essential fix for jobboard behaviour on
Storage failure [1].

Also add jobboard_redis_sentinel parameter to allow usage sentinel
for Redis jobboard. Support of this also appear in 4.4.0 version.

[1] - https://docs.openstack.org/releasenotes/taskflow/unreleased.html#bug-fixes

Change-Id: I48245b3322b0f2e5f2c11594a15632501a7e4086
2020-09-10 14:12:39 +00:00
Zuul
9a732565e9 Merge "Refactoring amphora stats driver interface" 2020-09-09 02:10:53 +00:00
Zuul
49912974b7 Merge "Deprecate the Spares Pool feature for removal in X" 2020-09-09 00:44:19 +00:00
asingh12
5092597f6b Refactoring amphora stats driver interface
Previously the stats driver was responsible for parsing the health
message, which should have been done prior to passing the stats to the
driver interface.

Removed the driver interface for the health updater because it is core
Octavia functionality.

Stats drivers is now a singleton and can load multiple drivers.

Both the amphora health manager AND provider statistics should use the
new driver interface.

Co-Authored-By: Stephanie Djajadi <stephanie.djajadi@gmail.com>
Co-Authored-By: Adam Harwell <flux.adam@gmail.com>
Change-Id: I3a013aebd1eb89cd4f983fbf4f8ae8d6639548cd
2020-09-08 15:32:04 -07:00
Adam Harwell
29a2ec7187 Deprecate the Spares Pool feature for removal in X
Use of the spares pool was originally recommended to increase provisioning
speed, but since Nova's server groups do not support adding existing VMs,
Octavia cannot support use of the spares pool with the Active-Standby
topology. Since this is our recommended topology for production deployments,
and speed is less essential in development/testing environments (the
only place we could recommend the use of Single topology), the overhead of
maintaining spares pool support exceeds its theoretical usefulness.

Change-Id: I7375e9758c7ae80e2370189117e8e63c79446490
2020-09-08 14:29:58 -07:00
Carlos Goncalves
a422e5a203 Introduce an image driver interface
With this image driver interface, we align our codebase with other
existing driver interfaces like compute, network and volume.

This interface also allows the amphora provider driver to check for
existence of tagged images at API level (e.g. amphora image tag
capability in Octavia flavors).

Change-Id: Id808c082808fafe1a1e004957ff47eca57f97ee8
2020-09-03 20:06:35 +00:00
Carlos Goncalves
f3b5e6e147 Switch to live from noop drivers
The switch to live drivers ease greenfield deployments by not requiring
deployers to explicitly set live drivers. The switch also helps
deployers identify production-ready from experimental drivers.
Experimental features like volume and distributor remain defaulted to
their noop drivers.

This patch also fixes some tests that were not mocked properly.

Change-Id: I1e4e3c4f0e4142fa0d0d1ac895b10e2349d79c20
2020-08-28 20:51:45 +00:00
Carlos Goncalves
a5f0524fd0 Add ALPN support for TLS-terminated HTTPS LBs
ALPN is a TLS extension for application-layer protocol negotiation
within the TLS handshake [1].

This patch extends the Listener API to include a new 'alpn_protocols'
parameter. With this parameter, users can set an ALPN preference list
(descending order of preference).

Presently, the amphora provider driver is limited to http/1.0 and
http/1.1 ALPN protocol IDs. Support for "h2" (HTTP/2 over TLS) depends
on HAProxy 2.0 or newer.

[1] https://tools.ietf.org/html/rfc7301

Change-Id: If08a8169498cdfaa75440e8971ba0caff45ac4c4
2020-08-27 13:19:52 +02:00
Zuul
2d97ebcd24 Merge "Allow amphorav2 to run without jobboard" 2020-08-25 22:47:04 +00:00
Zuul
13faf288e4 Merge "Fix memory consumption issues with default connection_limit" 2020-08-24 07:50:16 +00:00
Carlos Goncalves
bb9b30be7e Allow amphorav2 to run without jobboard
This patch adds a new configuration setting to enable/disable jobboard
functionality in the amphorav2 provider. When disabled, the amphorav2
provider behaves similarly to the amphora v1 provider.

The default setting is jobboard disabled while jobboard remains an
experimental feature.

Change-Id: I063d832f5a049d7ae38378766200c7f82a35996d
2020-08-17 13:57:33 +00:00
Zuul
c78a1b2c29 Merge "Add quota support to octavia's l7policy and l7rule" 2020-07-27 21:01:51 +00:00
Gregory Thiemonge
f4305e036c Fix memory consumption issues with default connection_limit
With 1.8.x releases, haproxy consumes a lot of memory when
using 1,000,000 as default connection_limit.

This commit introduces a new configuration option for the Amphora
provider: [haproxy_amphora].default_connection_limit (defaulted to
50,000). This value is used when creating a listener with -1 (which is
the default) as connection_limit, or when unsetting connection_limit in
a listener.
Updating an existing listener by setting connection_limit to -1 also
sets it to default_connection_limit.

The global connection_limit for a load balancer is the sum of the
connection_limit of the listeners, but it cannot be over
HAPROXY_MAX_MAXCONN (which is still 1,000,000).

Story: 2007794
Task: 40046

Change-Id: Ibc525d9a046a5ab7f090a942459d80a2df66ae2e
2020-07-23 09:58:23 +02:00
Brian Haley
7890f0d999 Remove blacklist terminology in the Octavia tree
The configuration option tls_cipher_blacklist has been
deprecated and replaced by tls_cipher_prohibit_list.

Change-Id: I6152838c697e12d19b27343e3a0714e55ca52d88
2020-07-08 15:19:52 -04:00
Zuul
b8a351092f Merge "Remove amp_image_id option" 2020-06-30 17:54:32 +00:00
Brian Haley
f6a66d86d4 Remove deprecated status_update_threads option
It was marked for removal in the Stein cycle.

Change-Id: Ib82014f92eecbcfd96a4219f2de307e5631486cb
2020-06-29 21:51:01 -04:00
Zuul
179f00e839 Merge "Add minimum TLS version option in octavia.conf" 2020-06-29 22:47:36 +00:00
Carlos Goncalves
33d28b07c2 Remove amp_image_id option
This option entered deprecation in Mitaka and is long due to be removed.

Change-Id: Ide048da1c87a4e9bc6574b39e2cf6b96b4dfaf95
2020-06-23 19:54:20 +02:00
Zuul
d8aceef0d5 Merge "Update the API audit map" 2020-06-21 16:23:51 +00:00
Zuul
3e765636c5 Merge "Fix API audit CADF audit map for failover action" 2020-06-21 16:22:44 +00:00
Michael Johnson
955bb88406 Refactor the failover flows
This patch refactors the failover flows to improve the performance
and reliability of failovers in Octavia.

Specific improvements are:
* More tasks and flows will retry when other OpenStack services are
  failing.
* Failover can now succeed even when all of the amphora are missing
  for a given load balancer.
* It will check and repair the load balancer VIP should the VIP
  port(s) become corrupted in neutron.
* It will cleanup extra resources that may be associated with a
  load balancer in the event of a cloud service failure.

This patch also removes some dead code.

Change-Id: I04cb2f1f10ec566298834f81df0cf8b100ca916c
Story: 2003084
Task: 23166
Story: 2004440
Task: 28108
2020-06-18 16:25:21 -07:00
Michael Johnson
e77355714b Update the API audit map
Recent additions to the Octavia API did not update the Octavia API
CADF audit map. This patch corrects that by adding the new API
paths.

Change-Id: I22107317837e68e54a29f8a4051c464120b29809
2020-06-18 21:43:34 +00:00
Michael Johnson
18887f5f60 Fix API audit CADF audit map for failover action
There was a bug in the CADF audit map file for the "failover" action.

This patch corrects the audit map file to handle "failover" correctly
and stop keystonemiddleware from raising an exception.

Change-Id: If3954ba34740e26937dba10bdd8061acde758c88
Story: 2007831
Task: 40116
2020-06-18 10:03:59 -07:00
Zuul
0a697a352c Merge "Switch oslo.policy over to yaml" 2020-06-11 22:11:11 +00:00
Michael Johnson
fafabad042 Switch oslo.policy over to yaml
Oslo.policy is moving away from using json format policy files[1].

This patch updates the Octavia documentation, policy configuration file, and
legacy admin-or-owner policy file to be in yaml format.

Octavia will continue to honor and support the json format file as long
as oslo.policy does, but this patch will encourage new deployments
to use the yaml format.

[1] https://docs.openstack.org/oslo.policy/latest/admin/policy-json-file.html

Change-Id: I925cc05981e677c0552b18f845fdbc512d2af22c
2020-06-08 08:54:07 -07:00
Yang JianFeng
5d91913136 Add quota support to octavia's l7policy and l7rule
Current octavia has no l7policy and l7rule quota definitions. But
they are necessary for some scenarios. For example, implement
product design compatible with Neutron Lbaas.

Story: 2003382
Task: 24457
Change-Id: I09ee23dcb83f5f08a56e25cc05ff77caa3ad4230
2020-06-08 02:28:51 +00:00
Dawson Coleman
270b973bf9 Add minimum TLS version option in octavia.conf
Add new configuration option "minimum_tls_versions" to octavia.conf.
Listeners, pools, or the default values for either will be blocked from
using lower versions.

Change-Id: Ifa0d695c2227772d6b37987a7857fe58ca660dc8
Story: 2006733
Task: 37171
Depends-On: I480b7fb9756d98ba9dbcdfd1d4b193ce6868e291
2020-06-04 13:11:01 -07:00
Dawson Coleman
9a6da86481 Add TLS version configuration for pools
Add field tls_versions to pools for restricing TLS versions used.
This is a colon-separated string of versions to be used.
Available values (as defined in octavia-lib):
SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3

Add default_pool_tls_versions in octavia.conf

Note: TLSv1.3 connections will use haproxy's default ciphers
instead of the listener's tls_ciphers field

Change-Id: I480b7fb9756d98ba9dbcdfd1d4b193ce6868e291
Story: 2006733
Task: 37173
Depends-On: Ic33d9b9a256490ae1b048cdfd2475d6340509fdb
2020-06-03 21:58:47 +00:00
Dawson Coleman
6aad5d8b9f Add TLS version configuration for listeners
Add field tls_versions to listeners for restricting TLS versions used.
This is a list of versions to be used.
Available values (as defined in octavia-lib):
SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3

Add default_listener_tls_versions in octavia.conf.

Note that at this time TLS 1.3 ciphersuites are not impelemented,
so any TLS 1.3 connections will use haproxy's default ciphers
instead of what's specified by tls_ciphers.

Change-Id: Ic33d9b9a256490ae1b048cdfd2475d6340509fdb
Story: 2006733
Task: 37170
Task: 37169
2020-06-03 14:57:47 -07:00
Zuul
bcef33a3ff Merge "Add TLS cipher blacklist to octavia.conf" 2020-05-19 15:54:33 +00:00
Dawson Coleman
85f5b8181b Add TLS cipher blacklist to octavia.conf
Add new configuration option "tls_cipher_blacklist" to octavia.conf.
Blacklisted ciphers are blocked from being used in listeners, pools, or
default cipher strings.

Change-Id: I44fd4da1b47faee9cc01b9426898a28b6f13f223
Story: 2006627
Task: 37168
2020-05-03 16:56:40 -05:00
Lingxian Kong
a33d42fa59 Validate resource access when creating loadbalancer or member
* Make sure the user has access to the subnet in the request for
  creating or updating pool member.
* Make sure the user has access to port or subnet or network for
  creating load balancer

Story: 2007531
Task: 39339

Change-Id: I479019a911b5a1acfc1951d1cbbc2a351089cb4d
2020-04-22 16:19:38 +12:00
Zuul
73fbc05386 Merge "Jobboard based controller" 2020-04-09 00:10:44 +00:00
Ann Taraday
9c13499d21 Jobboard based controller
Introduce TaskFlowServiceController which uses taskflow
jobboard feature and saves jobs info into persistence backend.

Jobboard could be operated via RedisTaskFlowDriver or
ZookeeperTaskFlowDriver, that could be set via the config.
RedisTaskFlowDriver is intoduced as default backend for jobboard.
Usage of jobboard allows to resume jobs in case of restart/stop
of Octavia controller services.

Persistence backend saves state of flow tasks that required in
case of resuming job. SQLAlchemy backend is used here.

Bump taskflow version to 3.7.1 and add dependency to
SQLAlchemy-Utils (required for taskflow sqlalchemy
backend support).

Story: 2005072
Task: 30806
Task: 30816
Task: 30817

Change-Id: I92ee4e879e98e4718d2e9aba56486341223a9157
2020-04-08 19:53:09 +04:00
Dawson Coleman
d47f164a60 Add ability to specify TLS cipher list for pools
Pools can now be each be assigned an OpenSSL cipher string with the
field tls_ciphers.  A new configuration option, default_pool_ciphers,
specifies what cipher string to use for new tls-enabled pools
if one is not explicitly specified at time of creation.

Change-Id: Iedb7774bfb8d70ea307d6a513248e1fe2389fa34
Depends-On: I77da6f14063877af0077f2c12df1aab5d5ead187
Story: 2006627
Task: 37172
2020-04-07 20:59:56 -05:00
Dawson Coleman
cd176e55c5 Add ability to set TLS cipher list for listeners
Listeners will now be able to each be assigned their own OpenSSL
cipher string with a new field: tls_ciphers.  There is also a new
configuration option, default_listener_ciphers, which specifies the
cipher string to assign to new listeners when one is not explicitly
specified.

Change-Id: I77da6f14063877af0077f2c12df1aab5d5ead187
Depends-On: Id5f4c20abd40dd092558a711987953012d4ae67f
Story: 2006627
Task: 36839
2020-04-06 17:06:32 -07:00
Sam Morrison
18020e6c88 Add oslo middleware healthcheck to Octavia API
healthcheck middleware adds a /healthcheck url that allows
unauthenticated access to provide a simple check when running
octavia-api behind a load balancer

https://docs.openstack.org/oslo.middleware/latest/reference/healthcheck_plugins.html

Co-authored-by: Michael Johnson <johnsomor@gmail.com>
Change-Id: I10db6226750f7b7c703067d2ab82eea3a9875112
2020-03-19 11:24:16 -07:00
Zuul
2a60c13863 Merge "Fix controller worker graceful shutdown" 2019-11-18 17:53:52 +00:00
Carlos Goncalves
8178bd37a2 Fix name of VRRP configuration option
The provided etc/octavia.conf file is typically installed by system
packages. It is important to set correct configuration option names and
default values even when commented out.

Task: 37525
Story: 2006891

Change-Id: Ia9da64d76e31422464af9d24b675094f25350f48
2019-11-17 15:43:17 +01:00
Gregory Thiemonge
215c4c2284 Fix controller worker graceful shutdown
Fix an issue that prevents graceful shutdown of controller workers.

cotyledon.Service.terminate function is by definition the graceful
termination function and doesn't have any 'graceful' optional boolean
argument (https://cotyledon.readthedocs.io/en/latest/api.html).

Because of this error, message_listener.wait() was never called in the
consumers' termination functions, so flows could be interrupted before
completion and could leave resources such as load balancer in a
PENDING_* provisioning state.

By default cotyledon.Service terminates the server after a timeout if
the worker could not shutdown itself gracefully. The default value
for the timeout is 300 seconds (set in devstack plugin) and can be
overriden using the graceful_shutdown_timeout setting in octavia.conf
The default value will be updated to a lower value when work on
persistant taskflow will be merged.

Story: 2006603
Task: 36770

Change-Id: I3f776bd018246897c9a889699a2d0ecbbfbb7098
2019-10-24 14:27:35 +02:00
Zuul
ff483f3457 Merge "Add long-running provider agent support" 2019-09-11 16:03:56 +00:00
Michael Johnson
78b1263237 Add long-running provider agent support
This patch adds support for long-running provider driver agents to
the Octavia driver-agent.
It will fork a process for all of the enabled provider driver
agents at startup.

Change-Id: Ib7042bcc48b1dd5b37b671dd5e64728b71ab9542
Story: 2006250
Task: 35863
2019-09-10 22:25:50 +00:00
sapd
93b509cfe5 Support create amphora instance from volume based.
In some deploy production, using volume based instead of localdisk
to protect data and live migrate can perform.

This patch adds:
 - creation a cinder volume for amphora
 - boot amphora with cinder volume
 - config options for cinder client
 - unit tests for cinder functionality

Story: 2001594
Co-authored-by: Vadim Ponomarev <velizarx@gmail.com>
Co-authored-by: Margarita Shakhova <shakhova.margarita@gmail.com>
Change-Id: I8181ed696b9ab556e7741c08839d79167aff8350
2019-09-10 22:21:42 +00:00
Michael Johnson
09efc2a423 Add get method support to the driver-agent
This patch adds support for the octavia-lib to get objects by ID.

Change-Id: I98b399891488e5972ea4d332c06b55b34f20fb11
Story: 2005870
Task: 33680
Co-Authored-By: Adam Harwell <flux.adam@gmail.com>
2019-09-09 22:47:10 +00:00
Carlos Goncalves
0978c776a2 Switch TaskFlow engine to parallel
The default TaskFlow engine is now set to 'parallel' instead of
'serial'. The parallel engine schedules tasks onto different threads to
allow for running non-dependent tasks simultaneously. This has the
benefit of accelerating the execution of some Octavia Amphora flows such
as provisioning of active-standby amphora loadbalancers.

Change-Id: I108b7f629d39c40b60ddf4a1878631f32e37b357
2019-08-14 11:27:49 +02:00
Vlad Gusev
ec83c69372 Add support for oslo_middleware http_proxy_to_wsgi
This sets up the HTTPProxyToWSGI middleware in front of Octavia API. The
purpose of this middleware is to set up the request URL correctly in
the case there is a proxy (For instance, a loadbalancer such as HAProxy)
in front of Octavia API.

So, when TLS connections are terminated at the proxy, and one tries to
get the versions from the '/' resource from Octavia API, one will notice
that the protocol is incorrect; It will show 'http' instead of 'https'.
So this middleware handles such cases.

The HTTPProxyToWSGI is off by default and needs to be enabled via a
configuration value.

It can be enabled with the option in octavia.conf:
[oslo_middleware]
enable_proxy_headers_parsing=True

Story: 2005105
Task: 29732
Change-Id: I276188530a83598ed75560f02ed9d80ce9afca2f
2019-07-31 17:10:54 -07:00
German Eichberger
686303e79d Amphora logging
Configure rsyslog to forward logs to a target host

Co-Authored-By: Michael Johnson <johnsomor@gmail.com>
Story: 1665069
Task: 33646

Change-Id: I00703f86555cbb574b943794b14a36fbc644f1b2
2019-06-14 09:02:26 -07:00
Michael Johnson
80ddbaeef4 Align logging in the amphora
This patch configures the primary components of the amphora to log
to syslog using consistent logging facilities.
By default, user traffic logs will go to LOG_LOCAL0 and the amphora
processes (haproxy, keepalived, etc.) will log to LOG_LOCAL1.

This is a patch supporting log offloading.

Change-Id: Ifda91e0310e812e34f1e398dd3176af8a9c58f89
Story: 1665069
Task: 5486
2019-06-13 12:42:18 -07:00
Michael Johnson
6d2e2be86a Remove references to OpenStack Anchor
The OpenStack Anchor project is now officially retired[1].

This patch removes the references to Anchor from Octavia.
These old references were confusing new users.

[1] https://review.opendev.org/#/c/611187/

Change-Id: Idfe90aa69b497e8270118174dde00567d7fab4ab
2019-06-03 14:58:44 -07:00
Adam Harwell
5b831f2a5b Force amp-agent communication to TLSv1.2
Also allow configuration of this minimum.
The previous default of SSLv2/3 is very insecure.

Change-Id: If34c7c34d9a6a77685fb177976dc2070760c7b37
2019-05-14 14:02:57 -07:00