multiple app nodes how to expose jmx in kubernetes?

前端 未结 4 808
醉话见心
醉话见心 2021-01-29 23:21
  1. In kubernetes I can expose services with service. This is fine.
  2. Lets say I have 1 web instance and 10 java server instances.
  3. I
4条回答
  •  走了就别回头了
    2021-01-29 23:42

    We did it in following way

    1. Add a unique label for each pod. ex: podid=asdw23443
    2. Create a new service with selector of podid=asdw23443. Make sure in the service you expose jmx ports on pod through nodeport or loadbalancer.

    If you are selecting nodeport in service, because you a doing a NAT operation you may have to give following JVM argument for each jvm you need to connect through jconsole

    -Djava.rmi.server.hostname=
    

提交回复
热议问题