provided port is not in the valid range ☸️ Kubernetes

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

  1. Remove nodePort to let Kubernetes pick one
  2. Use a value 30000–32767
  3. Use LoadBalancer or Ingress for standard ports

Detailed fix by platform

YAML

  1. bash
    spec:
      type: NodePort
      ports:
      - port: 80        # service port
        targetPort: 8080 # container port
        nodePort: 30080  # 30000-32767

How to diagnose

  1. Fields — port vs targetPort vs nodePort
  2. 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:

🧠 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.