New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/william/genrpc ssl port align #11813
Fix/william/genrpc ssl port align #11813
Conversation
6b9e8bc
to
6346e0d
Compare
- name: genrpc2-auto | ||
containerPort: 5370 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be no need for this. ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need it for port port_discovery = stateless in gen_rpc, yes this is confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the override set in docker entrypoint, i don't think we need this port.
- name: genrpc2-auto | ||
containerPort: 5370 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -89,6 +89,7 @@ jobs: | |||
EMQX_RPC__CACERTFILE: /opt/emqx/etc/certs/cacert.pem | |||
EMQX_RPC__CIPHERS: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256 | |||
EMQX_RPC__TLS_VERSIONS: "[tlsv1.2]" | |||
EMQX_RPC__PORT_DISCOVERY: manual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this for redundance ? because it's set to manual in docker entrypoint script.
https://github.com/emqx/emqx/blob/master/deploy/docker/docker-entrypoint.sh#L52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought it was auto-discovery as it is the default in the schema. I set it to manual want to test both. shall we remove it from docker-entrypoint? I don't see good reason to have it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or we should change the schema default to manual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The override in docker entrypoint was added long ago, we keep it for backward compatibility reasons. (so that v4 and v5 has the same port mapping convention).
We cannot change the default in schema because for RPM/DEB/TGZ installation, it's offset based port mapping. --- also kept for backward compatibility reasons.
@@ -1151,6 +1151,7 @@ translation("emqx") -> | |||
translation("gen_rpc") -> | |||
[ | |||
{"default_client_driver", fun tr_gen_rpc_default_client_driver/1}, | |||
{"ssl_client_port", fun tr_gen_rpc_ssl_client_port/1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably the only change needed.
or fix this instead: gen_rpc has a default value for ssl clients to connect to 5370
https://github.com/emqx/gen_rpc/blob/46dd22100391f3d87daca989cde7e2ecc52a17b5/src/gen_rpc.app.src#L35
but we have set the same server port on 5369 for both tcp and ssl:
emqx/apps/emqx_conf/src/emqx_conf_schema.erl
Lines 798 to 813 in a4ab744
{"tcp_server_port", | |
sc( | |
integer(), | |
#{ | |
mapping => "gen_rpc.tcp_server_port", | |
default => 5369, | |
desc => ?DESC(rpc_tcp_server_port) | |
} | |
)}, | |
{"ssl_server_port", | |
sc( | |
integer(), | |
#{ | |
mapping => "gen_rpc.ssl_server_port", | |
default => 5369, | |
desc => ?DESC(rpc_ssl_server_port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for completeness, we should actually add tcp_client_port
too
otherwise manual will not work if one wants to change port for server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, to support manual
strategy properly, it should not be a simple translation and user server port.
should rather make the tcp and ssl ports configurable for the clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we force all nodes in the cluster to use the same server port, then maybe just a translation is enough.
but please also add the same tr for tcp_client_port.
Fixes
Summary
馃 Generated by Copilot at 6b9e8bc
This pull request introduces a new gen_rpc implementation for emqx nodes that supports SSL/TLS and two modes of port discovery. It also adds a new configuration option
ssl_client_port
and updates the helm charts to expose the new ports.PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update