kind: Connection refused when using nodeport

What happened: I got Connection refused error when access from node public ip and svc/nodeport,but all resources is running and it works well with port-forward,what happend? Is there difference with native k8s?

kubectl get svc
traefik      NodePort    10.106.154.77    <none>        8000:30009/TCP,8080:30572/TCP,4443:30044/TCP   3h49m
curl http://public_ip:30000
Connection refused
kubectl port-forward --address 0.0.0.0 service/traefik 30000:8000
curl http://public_ip:30000
all is well 

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment: kind v0.9.0 go1.15.2 linux/amd64 kubectl version v1.19.2 docker Version: 19.03.13

  • kind version: (use kind version):
  • Kubernetes version: (use kubectl version):
  • Docker version: (use docker info):
  • OS (e.g. from /etc/os-release):

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 21 (10 by maintainers)

Most upvoted comments

@wrbbz you can’t just curl a nodeport on loopback unless you also have a matching port forward configured in the kind cluster config. If you’re on Linux you can skip that but you must curl the node IP instead. You also need to check your firewall. See the known issues in the docs as well, e.g. fedora has broken networking recently.