Not able to access application inside kubernetes POD

11/29/2021

Service.Yaml

pods.yaml

i am not able to access my application from browser. What mistake i am doing ?

if i give Ipaddress:30010 -> my app is not getting reached. (attached my pod.yaml and service.yaml here in attachment)

-- websparrow
docker
kubectl
kubernetes
kubernetes-pod
minikube

2 Answers

11/30/2021

You need to add targetPort setting in the ports section on your Service.yaml. This specifies the destination port of the container.

ports:
  - name: http
    port: 5432
    targetPort: 5432
    nodePort: 30010

port is a setting for in-cluster communication, that other containers in the cluster can access via {serviceName}:port.

-- Daigo
Source: StackOverflow

12/19/2021

You need to find your node ip. If you are using minikube then you find node ip list. By running kubectl cluster-info. Then in your browser go to http:node-ip:30010

-- Akshay Gopani
Source: StackOverflow