Translate LBaaS TERMINATED_HTTPS to NSX equivalent
When LBaaS specifies protocol as TERMINATED_HTTPS, NSX Edge should be configured with protocol-type=https. Also, as Edge supports HTTPS without termination as well, we do not need to use TCP as protocol type for HTTPS as well. Change-Id: I16ae69537706862634e1f1bda3be6ae0aeb052d3
This commit is contained in:
parent
e3fd04ea1b
commit
42342b3cfa
@ -25,11 +25,13 @@ BALANCE_MAP = {
|
||||
LB_PROTOCOL_TCP = 'TCP'
|
||||
LB_PROTOCOL_HTTP = 'HTTP'
|
||||
LB_PROTOCOL_HTTPS = 'HTTPS'
|
||||
LB_PROTOCOL_TERMINATED_HTTPS = 'TERMINATED_HTTPS'
|
||||
|
||||
PROTOCOL_MAP = {
|
||||
LB_PROTOCOL_TCP: 'tcp',
|
||||
LB_PROTOCOL_HTTP: 'http',
|
||||
LB_PROTOCOL_HTTPS: 'tcp'}
|
||||
LB_PROTOCOL_HTTPS: 'https',
|
||||
LB_PROTOCOL_TERMINATED_HTTPS: 'https'}
|
||||
|
||||
LB_HEALTH_MONITOR_PING = 'PING'
|
||||
LB_HEALTH_MONITOR_TCP = 'TCP'
|
||||
|
@ -38,7 +38,8 @@ def listener_to_edge_app_profile(listener, edge_cert_id):
|
||||
'template': listener.protocol,
|
||||
}
|
||||
|
||||
if listener.protocol == 'HTTPS':
|
||||
if (listener.protocol == lb_const.LB_PROTOCOL_HTTPS
|
||||
or listener.protocol == lb_const.LB_PROTOCOL_TERMINATED_HTTPS):
|
||||
if edge_cert_id:
|
||||
edge_app_profile['clientSsl'] = {
|
||||
'caCertificate': [],
|
||||
@ -75,7 +76,7 @@ def listener_to_edge_vse(listener, vip_address, default_pool, app_profile_id):
|
||||
'name': 'vip_' + listener.id,
|
||||
'description': listener.description,
|
||||
'ipAddress': vip_address,
|
||||
'protocol': listener.protocol,
|
||||
'protocol': lb_const.PROTOCOL_MAP[listener.protocol],
|
||||
'port': listener.protocol_port,
|
||||
'connectionLimit': max(0, listener.connection_limit),
|
||||
'defaultPoolId': default_pool,
|
||||
|
@ -40,7 +40,7 @@ EDGE_APP_PROF_DEF = {'sslPassthrough': False, 'insertXForwardedFor': False,
|
||||
'serverSslEnabled': False, 'name': LISTENER_ID,
|
||||
'template': 'HTTP'}
|
||||
EDGE_VIP_ID = 'vip-aaa'
|
||||
EDGE_VIP_DEF = {'protocol': 'HTTP', 'name': 'vip_' + LISTENER_ID,
|
||||
EDGE_VIP_DEF = {'protocol': 'http', 'name': 'vip_' + LISTENER_ID,
|
||||
'connectionLimit': 0, 'defaultPoolId': None,
|
||||
'ipAddress': LB_VIP, 'port': 80,
|
||||
'applicationProfileId': EDGE_APP_PROFILE_ID, 'description': ''}
|
||||
|
Loading…
x
Reference in New Issue
Block a user