0

I'm trying to set up nodered (https://nodered.org/) locally in minikube. Nodered is a web service, exposing its service on 1880 by default.

I seem to have everything up and running, but the service is not responding when I open the endpoint:

C:\Users\foo\Desktop>minikube kubectl get ep nodered-service
NAME              ENDPOINTS         AGE
nodered-service   172.17.0.5:1880   7m54s

Everything seems to run fine in kubernetes dashboard after running the deployment and service yaml files.

Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nodered-deployment
spec:
  selector:
    matchLabels:
      app: nodered
  replicas: 1
  template:
    metadata:
      labels:
        app: nodered
    spec:
      containers:
      - name: nodered
        image: nodered/node-red:latest
        ports:
        - containerPort: 1880

Service:

apiVersion: v1
kind: Service
metadata:
  name: nodered-service
spec:
  type: NodePort
  selector:
    app: nodered
  ports:
    - protocol: TCP
      port: 1880
      targetport: 1880
      nodePort: 30100

From service section inside the dashboard:

enter image description here

Is there something wrong with my service.yaml file here?

u314
  • 87
  • 1
  • 7
  • Are you opening it on localhost:1880 or localhost:30100 ? – Jack Barger Dec 13 '21 at 21:22
  • @JackBarger tried both, get ERR_CONNECTION_REFUSED – u314 Dec 13 '21 at 21:42
  • 1
    Does `minikube service nodered-service --url` produce a usable URL? [Expose port in minikube](https://stackoverflow.com/questions/40767164/expose-port-in-minikube) has some more suggestions; since Minikube generally runs in its own VM/container, NodePort Services won't be directly accessible on `localhost`. – David Maze Dec 14 '21 at 00:31
  • Wow @DavidMaze, I got "http://127.0.0.1:60816" from that command it it actually works... Now I'm really really confused. Add answer and Ill accept it, but would be nice to know why it landed on port 60816 doh – u314 Dec 14 '21 at 18:30

0 Answers0