Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
feat(bootstrap): Add more granular eb scripts
[csit.git]
/
resources
/
libraries
/
python
/
LoadBalancerUtil.py
diff --git
a/resources/libraries/python/LoadBalancerUtil.py
b/resources/libraries/python/LoadBalancerUtil.py
index
c8e6c0d
..
471bc87
100644
(file)
--- a/
resources/libraries/python/LoadBalancerUtil.py
+++ b/
resources/libraries/python/LoadBalancerUtil.py
@@
-1,4
+1,4
@@
-# Copyright (c) 20
19
Intel and/or its affiliates.
+# Copyright (c) 20
23
Intel and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@
-84,13
+84,13
@@
class LoadBalancerUtil:
protocol: tcp or udp. (int)
port: destination port. (int)
encap: encap is ip4 GRE(0) or ip6 (1GRE) or L3DSR(2) or NAT4(3) or
protocol: tcp or udp. (int)
port: destination port. (int)
encap: encap is ip4 GRE(0) or ip6 (1GRE) or L3DSR(2) or NAT4(3) or
-
NAT6(4). (int)
+ NAT6(4). (int)
dscp: dscp bit corresponding to VIP
type: service type
target_port: Pod's port corresponding to specific service
node_port: Node's port
new_len: Size of the new connections flow table used
dscp: dscp bit corresponding to VIP
type: service type
target_port: Pod's port corresponding to specific service
node_port: Node's port
new_len: Size of the new connections flow table used
-
for this VIP
+ for this VIP
is_del: 1 if the VIP should be removed otherwise 0.
:type node: dict
is_del: 1 if the VIP should be removed otherwise 0.
:type node: dict
@@
-108,16
+108,17
@@
class LoadBalancerUtil:
target_port = kwargs.pop(u"target_port", 0)
node_port = kwargs.pop(u"node_port", 0)
new_len = kwargs.pop(u"new_len", 1024)
target_port = kwargs.pop(u"target_port", 0)
node_port = kwargs.pop(u"node_port", 0)
new_len = kwargs.pop(u"new_len", 1024)
+ src_ip_sticky = kwargs.pop(u"src_ip_sticky", 0)
is_del = kwargs.pop(u"is_del", 0)
is_del = kwargs.pop(u"is_del", 0)
- cmd = u"lb_add_del_vip"
+ cmd = u"lb_add_del_vip
_v2
"
err_msg = f"Failed to add vip on host {node[u'host']}"
vip_addr = ip_address(vip_addr).packed
args = dict(
pfx={
u"len": 128,
err_msg = f"Failed to add vip on host {node[u'host']}"
vip_addr = ip_address(vip_addr).packed
args = dict(
pfx={
u"len": 128,
- u"address": {u"un": {u"ip": vip_addr}, u"af": 0}
+ u"address": {u"un": {u"ip
4
": vip_addr}, u"af": 0}
},
protocol=protocol,
port=port,
},
protocol=protocol,
port=port,
@@
-127,7
+128,8
@@
class LoadBalancerUtil:
target_port=target_port,
node_port=node_port,
new_flows_table_length=int(new_len),
target_port=target_port,
node_port=node_port,
new_flows_table_length=int(new_len),
- is_del=is_del
+ src_ip_sticky=src_ip_sticky,
+ is_del=is_del,
)
with PapiSocketExecutor(node) as papi_exec:
)
with PapiSocketExecutor(node) as papi_exec:
@@
-150,7
+152,7
@@
class LoadBalancerUtil:
as_addr: The application server address. (str)
is_del: 1 if the VIP should be removed otherwise 0. (int)
is_flush: 1 if the sessions related to this AS should be flushed
as_addr: The application server address. (str)
is_del: 1 if the VIP should be removed otherwise 0. (int)
is_flush: 1 if the sessions related to this AS should be flushed
-
otherwise 0. (int)
+ otherwise 0. (int)
:type node: dict
:type kwargs: dict
:type node: dict
:type kwargs: dict
@@
-174,11
+176,11
@@
class LoadBalancerUtil:
args = dict(
pfx={
u"len": 128,
args = dict(
pfx={
u"len": 128,
- u"address": {u"un": {u"ip": vip_addr}, u"af": 0}
+ u"address": {u"un": {u"ip
4
": vip_addr}, u"af": 0}
},
protocol=protocol,
port=port,
},
protocol=protocol,
port=port,
- as_address={u"un": {u"ip": as_addr}, u"af": 0},
+ as_address={u"un": {u"ip
4
": as_addr}, u"af": 0},
is_del=is_del,
is_flush=is_flush
)
is_del=is_del,
is_flush=is_flush
)