Make sure all firewalls are open? I just tested it and it works:
``` $ kubectl run udp --image=ubuntu -- bash -c "while true; do sleep 100000; done" deployment "udp" created $ kubectl expose deployment udp --port=12345 --protocol=UDP --type=LoadBalancer service "udp" exposed ``` Then I got the IP from `get svc`. I used `kubectl exec -ti` to exec into my pod and run `nc -l -p 12345 -u` in one terminal and I sent bytes to it via `netcat -u <public ip> 12345`. Tim On Tue, Jan 9, 2018 at 12:03 PM, Tameem Iftikhar <tameemiftikha...@gmail.com > wrote: > > down votefavorite > <https://stackoverflow.com/questions/48171383/kubernetes-udp-service-not-running-with-google-cloud-load-balancer#> > > I am trying to run a very simple UDP service in kubernetes on Google Cloud > but am unable to access the port I am exposing to the internet. Here is the > deployment and service file: > > Deployment.yaml > > apiVersion: extensions/v1beta1 > kind: Deployment > metadata: > name: udp-server-deployment > spec: > replicas: 2 > template: > metadata: > labels: > name: udp-server > spec: > containers: > - name: udp-server > image: jpoon/udp-server > imagePullPolicy: Always > ports: > - containerPort: 10001 > protocol: UDP > > Service.yaml: > > apiVersion: v1 > kind: Service > metadata: > name: udp-server-service > labels: > app: udp-server > spec: > type: LoadBalancer > ports: > - port: 10001 > protocol: UDP > selector: > name: udp-server > > This create the load balancer in google cloud with the correct port > exposed. Like so: > > Load balancer <https://i.stack.imgur.com/OHNeW.png> > > But when i try to access the port it's unaccessible. I have tried a few > variations in GCE to expose udp port but none seem to be working. > > ➜ udp-example telnet 35.192.59.72 10001 > Trying 35.192.59.72... > telnet: connect to address 35.192.59.72: Connection refused > telnet: Unable to connect to remote host > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kubernetes-users+unsubscr...@googlegroups.com. > To post to this group, send email to kubernetes-users@googlegroups.com. > Visit this group at https://groups.google.com/group/kubernetes-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.