I have two Ubuntu VMs created using Oracle Virtual Box on my Windows 11 laptop. I setup a k8s cluster using kubeadm with these two Ubuntu VMs, one of them is a master node and an another one is a worker node. Both the nodes are running with Ubuntu 20.04.3 LTS and docker://20.10.7. I deployed my spring boot app into the k8s cluster and exposed a node port service for my spring boot app with port 30000, but I am not really sure on how to access my node port service on the internet outside my cluster. Could you please help me with this issue?
Following are the IP address of my nodes in k8s cluster - master [192.168.254.94] and worker [192.168.254.95]. I tried with the following urls but none of them worked
http://192.168.254.94:30000/swagger-ui.html http://192.168.254.95:30000/swagger-ui.html
These above urls throwing message which says refused to connect
http://192.168.9.13:30000/swagger-ui.html http://192.168.9.14:30000/swagger-ui.html
These above urls says that the site cannot be reached
Below is the content of my application.yaml which I used for deploying the spring boot app and its corresponding service
apiVersion: apps/v1
kind: Deployment
metadata:
   name: dealer-engine
spec:
   replicas: 1
   selector:
      matchLabels:
         app: dealer-engine
   template:
      metadata:
        labels:
           app: dealer-engine
      spec:
         containers:
            - name: dealer-engine
              image: moviepopcorn/dealer_engine:0.0.1
              ports:
                 - containerPort: 9090
              env:
                 - name: MONGO_URL
                   value: mongodb://mongo-service:27017/mazda
              imagePullPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
   name: dealer-engine
spec:
   type: NodePort
   selector:
      app: dealer-engine
   ports:
      - port: 9091
        targetPort: 9090
        nodePort: 30000
   externalIPs:
    - 10.0.0.12
I am a beginner in k8s so please help me on how I can access my node port service outside my k8s cluster.


                        
I created a new simple Springboot application which returns "Hello world!!!" back to the user when the following endpoint "/helloWorld" is invoked. I deployed this spring boot app into my k8s cluster using the below yaml configuration
After successful deployment, I am able to access the helloWorld endpoint using the following url <K8S_MASTER_NODE_IP>:<NODE_PORT (30001)>.
Thank you all for your answers and inputs. Very much appreciated.