title: How to deploy nginx-ingress controller with Helm on k8s, with TCP/UDP load balancing
body: <p>I am trying to deploy an nginx-ingress controller on Kubernetes with Helm.</p>
  
  <p>I also want to configure it to bind specific ports of the nginx-ingress-controller service to specific node ports on the VM [I run it inside Vagrant].</p>
  
  <p>For example, I want :</p>
  
  <p>10000 node port -> 8080 nginx-ingress controller -> 10000 udp port of my backend service </p>
  
  <p>My Helm deployment is the following:</p>
  
  <pre><code>release_name=tcp-udp-nginx-ic
  http_nodePort=30080
  https_nodePort=30443
  
  echo
  echo "- Installing -${release_name}- into cluster ..." | cowsay
  
  helm del --purge ${release_name}
  helm upgrade --install ${release_name} \
  --set controller.service.type=NodePort \
  --set controller.service.nodePorts.http=${http_nodePort} \
  --set controller.service.nodePorts.https=${https_nodePort} \
  --set rbac.create=true \
  --set controller.replicaCount=1 \
  --set controller.resources.requests."memory"=300Mi \
  --set controller.resources.requests."cpu"=300m \
  --set controller.resources.limits."memory"=300Mi \
  --set controller.resources.limits."cpu"=300m \
  --set controller.ingressClass=nginx \
  --set controller.tcp.configMapNamespace=default \
  --set controller.udp.configMapNamespace=default \
  --set udp."8080"="default/the-backend-service:10000" \
  --set service.nodePorts.udp."8080"=10000 \
  stable/nginx-ingress
  </code></pre>
  
  <p>My question is , in what format should I enter the <code>--set service.nodePorts.udp</code> part in order to accomplish the above?</p>
  
  <p>The format I am using is referenced in the Helm documentation about the <a href="https://helm.sh/docs/using_helm/#the-format-and-limitations-of-set" rel="nofollow noreferrer">limitations of --set</a>.</p>
  
  <p>I know I am close because when I clone the chart locally and I set in the <code>values.yml</code> file the following, plays well.</p>
  
  <pre><code>    nodePorts:
        http: ""
        https: ""
        tcp: {}
  #      udp: {}
        udp:
          8080: 10000
          8081: 10001
  </code></pre>
  
  <p>When I deploy it like that and <code>desscribe</code> the ingress controller service I get:</p>
  
  <pre><code>Name:                     tcp-udp-nginx-ic-nginx-ingress-controller
  Namespace:                default
  Labels:                   app=nginx-ingress
                            chart=nginx-ingress-1.24.3
                            component=controller
                            heritage=Tiller
                            release=tcp-udp-nginx-ic
  Annotations:              &lt;none&gt;
  Selector:                 app=nginx-ingress,component=controller,release=tcp-udp-nginx-ic
  Type:                     NodePort
  IP:                       10.109.1.182
  Port:                     http  80/TCP
  TargetPort:               http/TCP
  NodePort:                 http  30080/TCP
  Endpoints:
  Port:                     https  443/TCP
  TargetPort:               https/TCP
  NodePort:                 https  30443/TCP
  Endpoints:
  Port:                     8080-udp  8080/UDP
  TargetPort:               8080-udp/UDP
  NodePort:                 8080-udp  10000/UDP
  Endpoints:
  
  Session Affinity:         None
  External Traffic Policy:  Cluster
  Events:                   &lt;none&gt;
  </code></pre>