provided port is not in the valid range Kubernetes Origin: Platform & cloud Last updated 12 Oct 2026

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

Exact message you may see provided port is not in the valid rangeThe range of valid ports is 30000-32767nodePort: Invalid value
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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

0x80070422 — Windows Update error 0x80070422 (service is disabled) (Windows)0x80070422actively refused it — HttpRequestException: No connection could be made because the target machine actively refused it (localhost:5001) (.NET)actively refused itCannotPullContainerError — ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried (AWS)CannotPullContainerEr…default backend - 404 — Ingress returns "404 Not Found" / "default backend - 404" (ingress-nginx) (Kubernetes)default backend - 404DNS in pod — DNS not working inside a Kubernetes pod (could not resolve host / nslookup: can't resolve) (Kubernetes)DNS in podFailedCreatePodSandBox — Failed to create pod sandbox: plugin type="calico" failed (add): ... (FailedCreatePodSandBox) (Kubernetes)FailedCreatePodSandBoxiptables: No chain/target/match — driver failed programming external connectivity on endpoint: iptables: No chain/target/match by that name (Docker)iptables: No chain/ta…Job for x.service failed — Job for nginx.service failed because the control process exited with error code (Linux)Job for x.service fai…provided …

Explore the map of this error Full error map →

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

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.