Providing more details and answers to your questions.
Yes, i've already exposed the port(TCP) - 6666. Exactly the same way i have exposed my HTTP port which my application uses.
#1 - No internal java error. Its connection refused.
#2 - Tried both actually. Tried nodeport with minikube and loadbalancer with Azure.
#3 - I yet have to try internal connection. There is no proxy and/or firewall noise. The service seems straight forward, like like you expose any HTTP based port. I can get this working on a local docker container. There are multiple threads online, which primarily talk about making sure jmx and rmi port are the same.
Here's the service.yaml file which i was trying with azure. I created a static IP in azure, so that i can set it within "java.rmi.server.hostname" upfront.
kind: Service
apiVersion: v1
metadata:
name: helloservice
spec:
loadBalancerIP: <static external IP>
selector:
app: hello-app
ports:
- name: port1
protocol: TCP
port: 8109
- name: port2
protocol: TCP
port: 6666
type: LoadBalancer
With this, i can remote access my app's http port using <static external IP>:8109. But the same doesn't work for JMX i.e. <static external IP>:6666.
Additionally, i checked azure's inbound and outbound network rules and this port is exposed there.