I have an application running as a pod in a Kubernetes cluster, specifically on an Amazon EKS cluster. I want to monitor the heap size of this application using VisualVM. How can I connect VisualVM to the application in my Kubernetes cluster, and what configurations do I need to make? Do I need to modify the deployment YAML file, or can I make changes to the Dockerfile for this purpose?
expecting answers to solve my issue!
Not sure where your VisualVM running. If it's running on the same Kubernetes cluster you can use the service name to connect with Application.
If it's somewhere out and you have to expose your service to the internet and connect to VisualVM, you can use service type LoadBalancer or Use ingress.
You also might like to whitelist IP so that over the internet only VisualVM can connect to your service.
If your VisualVM running on AWS cloud VM(windows/linux) you can create internal LB service type on Kubernetes and expose your service and use that IP.
Update service.yaml