loxilb-io / loxicmd

loxicmd is the "kubectl" for loxilb
Apache License 2.0
14 stars 12 forks source link

loxicmd create lb can not change existing lb mode #25

Closed vincentmli closed 3 months ago

vincentmli commented 3 months ago

I have existing lb as below:

[root@bpfire-3 ~]# loxicmd get lb -o wide
|   EXT IP    | SEC IPS | PORT | PROTO | NAME | MARK | SEL |  MODE   |  ENDPOINT   | EPORT | WEIGHT | STATE  | COUNTERS |
|-------------|---------|------|-------|------|------|-----|---------|-------------|-------|--------|--------|----------|
| 1.1.1.1     |         |   80 | tcp   | lb1  |    0 | rr  | onearm  | 2.2.2.2     |  9080 |      1 | active | 0:0      |
|             |         |      |       |      |      |     |         | 3.3.3.3     |  9080 |      1 | active | 0:0      |
| 10.99.99.99 |         |   80 | tcp   |      |    0 | rr  | default | 192.168.3.6 |    80 |      1 | -      | 0:0      |

I want to change the lb1 mode from onearm to fullnat, so I run this

[root@bpfire-3 ~]# loxicmd create lb 1.1.1.1 --tcp=80:9080 --name=lb1 --mode=fullnat --endpoints=2.2.2.2:1,3.3.3.3:1
ProtoPortpair: map[tcp:[80:9080]]
Debug: response.StatusCode: 200
lbrule-exists error

it complains lbrule-exists error, but if I add or remove one of the endpoints along with the mode fullnat change, it succeeded

[root@bpfire-3 ~]# loxicmd create lb 1.1.1.1 --tcp=80:9080 --name=lb1 --mode=fullnat --endpoints=2.2.2.2:1
ProtoPortpair: map[tcp:[80:9080]]
Debug: response.StatusCode: 200
Success

so it appears I can't use loxicmd create lb to only change mode or select, is this bug?

UltraInstinct14 commented 3 months ago

Yes it was not supported before but has been added