| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@andrijapanicsb @svenvogel @rhtyd @DaanHoogland @onitake Any suggestions and comments are welcome ! |
Sorry, something went wrong.
|
@weizhouapache Can you provide test packages or should we build the PR ourselves? |
Sorry, something went wrong.
@onitake we can provide the packages. could you please tell me what os version you use ? |
Sorry, something went wrong.
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Sorry, something went wrong.
|
Packaging result: ✖centos7 ✔debian. JID-1606 |
Sorry, something went wrong.
|
@weizhouapache will this require a new systemvmtemplate? |
Sorry, something went wrong.
@rhtyd it requires haproxy 1.8+ for http2 support. As I remember haproxy 1.8 is installed in debian10 systemvm template. No other changes is needed in systemvm template |
Sorry, something went wrong.
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Sorry, something went wrong.
|
Trillian test result (tid-2382)
|
Sorry, something went wrong.
|
@weizhouapache can you look at failures? Thanks |
Sorry, something went wrong.
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Sorry, something went wrong.
@rhtyd I will do |
Sorry, something went wrong.
@rhtyd pushed a commit to fix it. can you re-kick off the tests ? |
Sorry, something went wrong.
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Sorry, something went wrong.
|
Packaging result: ✔centos7 ✔debian. JID-1752 |
Sorry, something went wrong.
|
It's a nice feature, is it possible to have it in 4.15 ? |
Sorry, something went wrong.
|
@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Sorry, something went wrong.
|
Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 419 |
Sorry, something went wrong.
| } | ||
|
|
||
| public void setLbConfigs(List<? extends LoadBalancerConfig> lbConfigs) { | ||
| if (lbConfigs == null || lbConfigs.size() == 0) { |
There was a problem hiding this comment.
We could use org.apache.commons.lang3.ArrayUtils here:
...
if (ArrayUtils.isEmpty(lbConfigs)) {
...
Sorry, something went wrong.
There was a problem hiding this comment.
@GutoVeronezi org.apache.commons.lang3.ArrayUtils package don't have isEmpty method which accepts List object. I have to override it like:
...
ArrayUtils.isEmpty(new List[]{lbConfigs})
...It imposes unnecessary conversion. What do you think?
Sorry, something went wrong.
| } | ||
|
|
||
| public boolean isForced() { | ||
| return (forced != null) ? forced : false; |
There was a problem hiding this comment.
We could use org.apache.commons.lang3.BooleanUtils here:
...
return BooleanUtils.toBoolean(forced);
...
Sorry, something went wrong.
| if (lb == null) { | ||
| return null; | ||
| } | ||
| return lb.getNetworkId(); |
There was a problem hiding this comment.
We could implement a ternary here.
Sorry, something went wrong.
| } | ||
|
|
||
| public boolean isForced() { | ||
| return (forced != null) ? forced : false; |
There was a problem hiding this comment.
We could use org.apache.commons.lang3.BooleanUtils here:
...
return BooleanUtils.toBoolean(forced);
...
Sorry, something went wrong.
| LoadBalancerConfig config = null; | ||
| try { | ||
| config = _entityMgr.findById(LoadBalancerConfig.class, getEntityId()); |
There was a problem hiding this comment.
As config is not referenced outside the try block, we could declare it inside.
Sorry, something went wrong.
| if (lbMaxConn != null) { | ||
| loadBalancingData.append(",lb.maxconn=").append(lbMaxConn); | ||
| } | ||
| if (lbFullConn != null) { | ||
| loadBalancingData.append(",lb.fullconn=").append(lbFullConn); | ||
| } | ||
| if (lbTimeoutConnect != null) { | ||
| loadBalancingData.append(",lb.timeout.connect=").append(lbTimeoutConnect); | ||
| } | ||
| if (lbTimeoutServer != null) { | ||
| loadBalancingData.append(",lb.timeout.server=").append(lbTimeoutServer); | ||
| } | ||
| if (lbTimeoutClient != null) { | ||
| loadBalancingData.append(",lb.timeout.client=").append(lbTimeoutClient); | ||
| } | ||
| if (lbBackendHttps != null) { | ||
| loadBalancingData.append(",lb.backend.https=").append(lbBackendHttps); | ||
| } | ||
| if (lbHttp2 != null) { | ||
| loadBalancingData.append(",http2=").append(lbHttp2); | ||
| } | ||
| if (serverMaxconn != null) { | ||
| loadBalancingData.append(",server.maxconn=").append(serverMaxconn); | ||
| } | ||
| if (serverMinconn != null) { | ||
| loadBalancingData.append(",server.minconn=").append(serverMinconn); | ||
| } | ||
| if (serverMaxqueue != null) { | ||
| loadBalancingData.append(",server.maxqueue=").append(serverMaxqueue); | ||
| } |
There was a problem hiding this comment.
This code seems repeated, but changing parameters; We could extract it to a method.
Sorry, something went wrong.
| if (id != null) { | ||
| sc.addAnd("id", SearchCriteria.Op.EQ, id); | ||
| } | ||
| if (scope != null) { | ||
| sc.addAnd("scope", SearchCriteria.Op.EQ, scope); | ||
| } | ||
| if (networkId != null) { | ||
| sc.addAnd("networkId", SearchCriteria.Op.EQ, networkId); | ||
| } | ||
| if (vpcId != null) { | ||
| sc.addAnd("vpcId", SearchCriteria.Op.EQ, vpcId); | ||
| } | ||
| if (loadBalancerId != null) { | ||
| sc.addAnd("loadBalancerId", SearchCriteria.Op.EQ, loadBalancerId); | ||
| } | ||
| if (name != null) { | ||
| sc.addAnd("name", SearchCriteria.Op.EQ, name); | ||
| } |
There was a problem hiding this comment.
This code seems repeated, but changing parameters; We could extract it to a method or create an addAndNotNull to SearchCriteria.
Sorry, something went wrong.
| sc.addAnd("name", SearchCriteria.Op.EQ, name); | ||
| } | ||
| List<LoadBalancerConfigVO> configs = new ArrayList<LoadBalancerConfigVO>(); | ||
| if (id != null || networkId != null || vpcId != null || loadBalancerId != null) { |
There was a problem hiding this comment.
We could use org.apache.commons.lang3.ObjectUtils here:
...
if (ObjectUtils.anyNotNull(id, networkId...
...
Sorry, something went wrong.
| } | ||
| throw new InvalidParameterValueException("networkId is required"); | ||
| } | ||
| if (vpcId != null || loadBalancerId != null) { |
There was a problem hiding this comment.
We could use org.apache.commons.lang3.ObjectUtils here:
...
ObjectUtils.anyNotNull(...
...
Sorry, something went wrong.
| if (scope == Scope.Network) { | ||
| if (networkId == null) { | ||
| if (listAll) { | ||
| return; | ||
| } | ||
| throw new InvalidParameterValueException("networkId is required"); | ||
| } | ||
| if (vpcId != null || loadBalancerId != null) { | ||
| throw new InvalidParameterValueException("vpcId and loadBalancerId should be null if scope is Network"); | ||
| } | ||
| if (networkId == null) { | ||
| throw new InvalidParameterValueException("networkId is required"); | ||
| } | ||
| NetworkVO network = _networkDao.findById(networkId); | ||
| if (network == null) { | ||
| throw new InvalidParameterValueException("Cannot find network by id " + networkId); | ||
| } | ||
| // Perform permission check | ||
| _accountMgr.checkAccess(caller, null, true, network); | ||
| if (network.getVpcId() != null) { | ||
| throw new InvalidParameterValueException("network " + network.getName() + " is a VPC tier, please add LB configs to VPC instead"); | ||
| } | ||
| } else if (scope == Scope.Vpc) { | ||
| if (vpcId == null) { | ||
| if (listAll) { | ||
| return; | ||
| } | ||
| throw new InvalidParameterValueException("vpcId is required"); | ||
| } | ||
| if (networkId != null || loadBalancerId != null) { | ||
| throw new InvalidParameterValueException("networkId and loadBalancerId should be null if scope is Vpc"); | ||
| } | ||
| VpcVO vpc = _vpcDao.findById(vpcId); | ||
| if (vpc == null) { | ||
| throw new InvalidParameterValueException("Cannot find vpc by id " + vpcId); | ||
| } | ||
| // Perform permission check | ||
| _accountMgr.checkAccess(caller, null, true, vpc); | ||
| } else if (scope == Scope.LoadBalancerRule) { | ||
| if (loadBalancerId == null) { | ||
| if (listAll) { | ||
| return; | ||
| } | ||
| throw new InvalidParameterValueException("loadBalancerId is required"); | ||
| } | ||
| if (networkId != null || vpcId != null) { | ||
| throw new InvalidParameterValueException("networkId and vpcId should be null if scope is LoadBalancerRule"); | ||
| } | ||
| LoadBalancerVO rule = _lbDao.findById(loadBalancerId); | ||
| if (rule == null) { | ||
| throw new InvalidParameterValueException("Cannot find load balancer rule by id " + loadBalancerId); | ||
| } | ||
| if (networkId != null) { | ||
| // Perform permission check | ||
| checkPermission(Scope.Network, rule.getNetworkId(), null, null); | ||
| } | ||
| } |
There was a problem hiding this comment.
This code seems repeated, but changing parameters; We could extract it to a method.
Sorry, something went wrong.
|
There is a lot of code addition, but none unit testing or javadoc. IMHO we should add they. |
Sorry, something went wrong.
|
@ravening @soreana |
Sorry, something went wrong.
|
@weizhouapache Sure! I asked Neven to make a room for it. |
Sorry, something went wrong.
|
@soreana can you resolve that confict, please? |
Sorry, something went wrong.
|
ping @soreana can you please fix the conflicting files. |
Sorry, something went wrong.
|
Ping @weizhouapache I think some more work may be needed on this as now Debian 11 has moved to haproxy 2.x, should this be targeted for next milestone. I worry it may not be stable within two weeks, ie current tentative RC date. |
Sorry, something went wrong.
@rhtyd it is ok to me. |
Sorry, something went wrong.
@rhtyd @weizhouapache yes lets move it out of this milestone as this will not make it in time |
Sorry, something went wrong.
|
@rhtyd @weizhouapache Sure let's do this. |
Sorry, something went wrong.
|
@weizhouapache @rhtyd I have created a new pr for this in #5799 |
Sorry, something went wrong.
@ravening |
Sorry, something went wrong.
Testing:
```
(local) mgt01 > replace loadbalancerconfigs networkid=bfdf8e5a-86bc-4dcf-9279-10482ffcb8ed scope=Network config[0].global.maxconn=5002 config[0].global.maxpipes=5003
{
"accountid": "e3a80e2d-0977-11eb-8a7f-069b900033a6",
"cmd": "org.apache.cloudstack.api.command.user.loadbalancer.ReplaceLoadBalancerConfigsCmd",
"completed": "2020-11-10T14:42:40+0000",
"created": "2020-11-10T14:42:28+0000",
"jobid": "0ea21420-6c48-40c1-9f5f-3fddceac1b0d",
"jobprocstatus": 0,
"jobresult": {
"success": true
},
"jobresultcode": 0,
"jobresulttype": "object",
"jobstatus": 1,
"userid": "e3a8b95f-0977-11eb-8a7f-069b900033a6"
}
```
…var/log/cloud.log
| Back | FazBrowse Home | New Git URL |
Description
As discussed in mailing list, create this PR for haproxy config customization.
FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/VR+haproxy+customization+in+CloudStack
Fixes #3789
It supports (or will support)
haproxy statistics uri, auth, enable/disable
global maxconn and maxpipes
timeout connection, client ,server globally and per rule
http, httpalive per rule
maxconn, fullconn per rule
maxconn, minconn, maxqueue per server in rule
transparent load balancer
SSL offloading
http2 support
Variable SSL configurations
TODO:
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?