wildfly / wildfly-operator

Kubernetes Operator for WildFly
http://docs.wildfly.org/wildfly-operator/
Apache License 2.0
32 stars 39 forks source link

EJB3 node identifier configuration #288

Open eugenpro opened 10 months ago

eugenpro commented 10 months ago

Hello, when I'm using operator EJB3 identifier by default for each pod in statefulset is app-0.app-headless.app-namespace.svc.cluster.local, Due to some local limitation I need it to be basically app-0 for instance. I've tried to reconfigure it through cli script with /subsystem=transactions:write-attribute(name=node-identifier,value="${jboss.hostname}"), but it does not affect. Is there any way to fix it? WildFly Core 15.0.32

yersan commented 10 months ago

Hello @eugenpro

when I'm using operator EJB3 identifier by default for each pod in statefulset is app-0.app-headless.app-namespace.svc.cluster.local

The operator configures the client-mapping for the socked-binding used by the EJBs and uses the headless service name created for the StatefulSet. This configuration maps the StatefulSet pod DNS address as the destination address for the clients that use this socket.

This configuration is not exposed in the Operator custom resource, so if you need to change it, I think you will need to modify the socket-binding client-mapping configured on your server. I am not an EJB expert, but I think your EJB3 identifier is being calculated using this client-mapping. By default, this configuration is done under the /socket-binding-group=standard-sockets/socket-binding=http.

Due to some local limitation I need it to be basically app-0 for instance. I've tried to reconfigure it through cli script with /subsystem=transactions:write-attribute(name=node-identifier,value="${jboss.hostname}"), but it does not affect.

I guess you will need to continue using the name derived from the headless service to avoid any load balancing done by Kubernetes and to make the clients connect directly to the pod. I am not sure if using only the hostname will work, in addition, as soon as you need to call the EJB from a different namespace, it won't work either. I am being speculative here.

Maybe @tadamski can provide you with more information about how these EJB identifiers are calculated.