Unable to configure UDP on ingress-nginx-controller
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Configuring UDP with ingress-nginx is different from ordinary HTTP ingress, and that difference is what usually causes confusion. UDP is not configured through a standard Ingress resource. Instead, ingress-nginx expects a controller-level TCP or UDP mapping, usually through a ConfigMap plus matching service ports on the controller.
Why normal Ingress YAML is not enough
A standard Ingress object is for HTTP and HTTPS routing. It understands host and path semantics, which do not apply to generic UDP traffic.
So if you try to solve UDP exposure with only this kind of resource:
you are usually solving the wrong problem. For UDP on ingress-nginx, you need stream-level forwarding configuration.
The ingress-nginx UDP pattern
The controller reads a ConfigMap that maps an exposed UDP port on the ingress controller to a Kubernetes service and target port.
Example UDP services ConfigMap:
This means:
- expose UDP port
5353on the ingress-nginx controller - forward it to service
dns-proxyin namespacedefault - use backend service port
5353
Tell the controller to use that ConfigMap
The controller deployment or Helm values must reference the UDP ConfigMap.
Helm-style example:
Or, in an argument-based deployment setup, the controller may need:
If the controller never receives this configuration, the ConfigMap can exist and still do nothing.
Expose the UDP port on the controller service
Another common omission is forgetting to expose the same UDP port on the ingress-nginx service itself.
Without a matching service port, the external load balancer or node-level service cannot receive that UDP traffic at all.
Verify the full path
When UDP still does not work, validate each layer separately:
- the backend service exists and listens on the expected UDP port
- the UDP ConfigMap is present and correct
- the controller is configured to watch that ConfigMap
- the ingress-nginx service exposes the UDP port
- the external load balancer or firewall allows UDP on that port
Useful checks:
Cloud and load balancer limitations
Even if Kubernetes configuration is correct, some environments add another constraint:
- the cloud load balancer may not forward UDP automatically
- security groups may allow TCP but not UDP
- a managed ingress setup may support HTTP only
So a working TCP ingress does not prove UDP will work on the same infrastructure.
Common Pitfalls
The most common mistake is trying to configure UDP through a normal Ingress resource. Another is creating the UDP ConfigMap but forgetting to expose the same UDP port on the controller service. Teams also often overlook the controller argument or Helm setting that tells ingress-nginx which ConfigMap to read. Cloud firewalls and load balancers are another frequent blind spot because they may be configured for TCP only. Finally, people often debug the ingress controller first when the backend service is not actually listening on the expected UDP port.
Summary
- UDP on ingress-nginx is not configured through ordinary HTTP ingress rules.
- Use a UDP mapping ConfigMap or the equivalent Helm configuration.
- Make sure the ingress controller is explicitly pointed at that UDP config.
- Expose the same UDP port on the ingress-nginx controller service.
- Verify backend service, controller config, and external network policy separately.
- Treat UDP support as a controller-plus-service-plus-infrastructure problem, not just an ingress manifest problem.
Related reading
- Unable to connect to AWS EKS cluster
- Unable to Copy data from POD to local using kubectl cp command
- Unable to create SparkApplications on Kubernetes cluster using SparkKubernetesOperator from Airflow DAG
- Unable to get a shell into citadel container in kubernetes
- Unable to increase file descriptors for rabbitmq
- Unable to remove PVC in Terraform
- Unable to connect to the server dial tcp i/o time out
- Unable to connect to the server net/http TLS handshake timeout

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.