spec.ports[0].nodePort: Invalid value: 80: provided port is not in the valid range. The range of valid ports is 30000-32767
A NodePort Service asked for a port outside the cluster’s NodePort range (default 30000–32767).
Seen on:
Kubernetes
Meaning
NodePorts are opened on every node and are restricted to a reserved range. To serve on 80/443, use a LoadBalancer Service or an Ingress controller, or (self-managed clusters) change --service-node-port-range.
Common causes
- nodePort set to 80/443/8080
- Confusing port, targetPort and nodePort fields
⚡ Quick fix
- Remove nodePort to let Kubernetes pick one
- Use a value 30000–32767
- Use LoadBalancer or Ingress for standard ports
Detailed fix by platform
YAML
- bash
spec: type: NodePort ports: - port: 80 # service port targetPort: 8080 # container port nodePort: 30080 # 30000-32767
How to diagnose
- Fields — port vs targetPort vs nodePort
- Range — API server --service-node-port-range
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 0x80070422 Windows Update error 0x80070422 (service is disabled)
- actively refused it HttpRequestException: No connection could be made because the target machine actively refused it (localhost:5001)
- CannotPullContainerError ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried
Most viewed in Kubernetes
- error converting YAML to JSON error converting YAML to JSON: yaml: line 12: did not find expected key
- is waiting to start Error from server (BadRequest): container "x" in pod "y" is waiting to start: ContainerCreating
- kubectl connection refused kubectl: The connection to the server localhost:8080 was refused — did you specify the right host or port?
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026