Unable to open voting-app UI on browser

Hi Team,

I am unable to open voting-app UI on browser. however, pod & service for voting-app is up & running still I am unable to access the page.

Even I get response via curl request on the node itself.

Kindly help for the same.

Here is my pod & service definition files for your reference.

apiVersion: v1
kind: Pod
metadata:
  name: voting-app-pod
  labels:
    name: voting-app-pod
    app: demo-voting-app
spec:
  containers:
    - name: voting-app
      image: kodekloud/examplevotingapp_vote:v1
      ports:
        - containerPort: 80
apiVersion: v1
kind: Service
metadata:
  name: voting-service
  labels:
    name: voting-service
    app: demo-voting-app
spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30004
  selector:
    name: voting-app-pod
    app: demo-voting-app

Also, output of kubectl get all command for your reference.

i-0a396bfa3eca1837a voting-app]$ kubectl get all
NAME                 READY   STATUS    RESTARTS   AGE
pod/voting-app-pod   1/1     Running   0          5h31m

NAME                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
service/kubernetes       ClusterIP   10.96.0.1      <none>        443/TCP        47h
service/voting-service   NodePort    10.102.24.36   <none>        80:30004/TCP   5h30m

Thanks in advance!

Where are you running this? Looks to me like AWS. Is it a KodeKloud playground or some other account?

Assuming it is, creating a nodeport service doesn’t magically make it visible to your browser on your own workstation (implies it is publicly visible on the Internet). There’s quite a few things that may need to be set up