Hello there!
Tried to test the HAProxy as a loadbalancer for HA controller mode and can't make it to work as round-robin evenly distributes the load and authentication data obtained upon ziti edge login
for one controller won't work with other controllers except that one that received the request.
Is it even possible to run a stateless load-balancer in front of ziti controllers?
My main objective to achieve auto failover of requests to the edge api in case one of the controllers(possibly a leader) is failed. Is it possible to achieve it by some other means?
My setup:
haproxy.conf
defaults
timeout connect 5000
timeout client 50000
timeout server 50000
frontend main
mode tcp
bind *:443
use_backend ctrl
backend ctrl
mode tcp
balance roundrobin
server ctrl1 127.0.0.1:1281 check
server ctrl2 127.0.0.1:1282 check
server ctrl3 127.0.0.1:1283 check
โ ziti agent cluster list -i ctrl1
โญโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโฎ
โ ID โ ADDRESS โ VOTER โ LEADER โ VERSION โ CONNECTED โ
โโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโค
โ ctrl1 โ tls:localhost:6201 โ true โ true โ v1.1.7 โ true โ
โ ctrl2 โ tls:localhost:6202 โ false โ false โ v1.1.7 โ true โ
โ ctrl3 โ tls:localhost:6203 โ false โ false โ v1.1.7 โ true โ
โฐโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโฏ
โ ziti -v
v1.1.7
Relevant logs showing that rounrobin would eventually hit the controller from which ziti edge login
was processed:
โ ziti edge list identities
error: error listing https://localhost:443/edge/management/v1/identities in Ziti Edge Controller. Status code: 401 Unauthorized, Server returned: {
"error": {
"code": "UNAUTHORIZED",
"message": "The request could not be completed. The session is not authorized or the credentials are invalid",
"requestId": "sdsGqP2bd"
},
"meta": {
"apiEnrollmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
โ ziti edge list identities
error: error listing https://localhost:443/edge/management/v1/identities in Ziti Edge Controller. Status code: 401 Unauthorized, Server returned: {
"error": {
"code": "UNAUTHORIZED",
"message": "The request could not be completed. The session is not authorized or the credentials are invalid",
"requestId": "VlsJxAoJY"
},
"meta": {
"apiEnrollmentVersion": "0.0.1",
"apiVersion": "0.0.1"
}
}
โ ziti edge list identities
โญโโโโโโโโโโโโฌโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฎ
โ ID โ NAME โ TYPE โ ATTRIBUTES โ AUTH-POLICY โ
โโโโโโโโโโโโโผโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโโโโค
โ Hq8usIlwt โ test โ Default โ โ Default โ
โ oLVMs-lwU โ admin โ Default โ โ Default โ
โฐโโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโโฏ
results: 1-2 of 2