Aaron199 commented on issue #9026:
URL: https://github.com/apache/apisix/issues/9026#issuecomment-1463187382
I found the corresponding function through the debug error log and noticed
that the "new" function of etcd sets the link address of etcd through
deployment.role. The default setting for apisix is traditional, and the code is
as follows:
```lua
local function new()
local local_conf, err = fetch_local_conf()
if not local_conf then
return nil, nil, err
end
local etcd_conf = clone_tab(local_conf.etcd)
local proxy_by_conf_server = false
if local_conf.deployment then
if local_conf.deployment.role == "traditional"
-- we proxy the etcd requests in traditional mode so we can test
the CP's behavior in
-- daily development. However, a stream proxy can't be the CP.
-- Hence, generate a HTTP conf server to proxy etcd requests in
stream proxy is
-- unnecessary and inefficient.
and is_http
then
local sock_prefix = ngx_config_prefix
etcd_conf.unix_socket_proxy =
"unix:" .. sock_prefix .. "/conf/config_listen.sock"
etcd_conf.host = {"http://127.0.0.1:2379"}
proxy_by_conf_server = true
elseif local_conf.deployment.role == "control_plane" then
local addr =
local_conf.deployment.role_control_plane.conf_server.listen
etcd_conf.host = {"https://" .. addr}
etcd_conf.tls = {
verify = false,
}
if has_mtls_support() and local_conf.deployment.certs.cert then
local cert = local_conf.deployment.certs.cert
local cert_key = local_conf.deployment.certs.cert_key
etcd_conf.tls.cert = cert
etcd_conf.tls.key = cert_key
end
```
However, in apisix-0.13.1 helm, the etcd configuration in
https://github.com/apache/apisix-helm-chart/blob/apisix-0.13.1/charts/apisix-ingress-controller/templates/configmap.yaml
is set in the outermost layer using an old configuration method. This caused
the configuration of etcd to not take effect, even though it was configured.
This issue was resolved by adding deployment.role.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]