I have following configuration of a service:
apiVersion: v1
kind: Service
metadata:
name: academy-backend-service
spec:
selector:
app: academy-backend-app
type: NodePort
ports:
- port: 8081
targetPort: 8081
nodePort: 30081
Behind this service there is a deployment that runs a docker image of a spring boot application that expose port 8081. When I try to reach the application from browser on http://localhost:30081 I don't get anything (not reachable). However if I connect inside minikube cluster, the application is available on http:{servcieip}:8081. Any clues what is not configured properly? I thought that nodePort is enough.
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
academy-backend-service NodePort 10.97.44.87 <none> 8081:30081/TCP 34m