<p>For my project, I need to send UDP packets to a Kubernetes Pod from an outside cluster. How can I do this?</p>

<p>I am using Kubeadm for creating the cluster. I tried to use nodePort but it seems that my requirement cannot be fulfilled with Nodeport.</p>

Ranjith Koova
<p>Actually, <code>NodePort</code> can be used to expose ports within TCP and UDP protocols. What was the problem in your case?</p>

<p>You can consider using <code>Nginx Ingress Controller</code> and creating <code>ReplicationController</code> to implement <code>Nginx ingress</code> in order to expose your Pods across UDP port as described <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/udp" rel="nofollow noreferrer">Here</a> or you can check this <a href="https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/" rel="nofollow noreferrer">Link</a>.</p>

<p>Create <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">ConfigMap</a> and specify External port like <code>&lt;namespace/service name&gt;:&lt;service port&gt;</code> which you want to access from outside Kubernetes cluster.</p>

<p>Finally, Nginx ingress can be exposed, i.e., using <a href="https://kubernetes.io/docs/concepts/services-networking/service/#external-ips" rel="nofollow noreferrer">Kubernetes ExternalIP</a>.</p>
