Ingress-nginx: Disable TCP exposed ports on Install not working. Need UDP, not ports mix protocols

Created on 13 May 2020  路  7Comments  路  Source: kubernetes/ingress-nginx

NGINX Ingress controller version:

NAME                    CHART VERSION   APP VERSION     DESCRIPTION
stable/nginx-ingress    1.36.3          0.30.0          An nginx Ingress controller that uses ConfigMap...
stable/nginx-lego       0.3.1                           Chart for nginx-ingress-controller and kube-lego

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:58:59Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.7", GitCommit:"169db3bff4b5fb7722e967c5b6356713f05f15ed", GitTreeState:"clean", BuildDate:"2020-04-03T16:14:09Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration:
    Azure AKS
  • OS (e.g. from /etc/os-release):
    Linux - working on local windows powershell using az commands
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:


I posted the question on stack overflow but once given advice to fix the problem I found that this didn't work. Trying to disable http and https ports so I can use my UDP ports.

When I install with the commands to disable the ports are not disabled and are still on the service.

StackOverflow question
What you expected to happen:


The helm commands to disable are not working.

How to reproduce it:
Install helm and try to disable the port 80 and 443 by setting controller.service.enableHttp=false controller.service.enableHttps=false on install through helm.

/kind bug

kinsupport

Most helpful comment

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx \
--set controller.replicaCount=2 \
--set controller.nodeSelector."beta\.kubernetes\.io/os"=linux \
--set controller.service.enableHttp=false \
--set controller.service.enableHttps=false \
--set udp.30000="default/service:30000"

All 7 comments

Install helm and try to disable the port 80 and 443

Why are you using ingress-nginx?

If you don't want to expose such ports, just apply a patch to remove those from the ingress-nginx service. That will update the LB mapping, removing 80 and 443.

@aledbf I am trying to expose pods on two different ports 30001 and 30002 running two servers that are sharing the same IP address.

In the stack overflow post I linked I stated I applied the patch, the patch does not work and I get the error I posted in Stack Overflow which is.

The Service "nginx-ingress-controller" is invalid: spec.ports: Invalid value:
 []core.ServicePort{core.ServicePort{Name:"proxied-udp-30001", Protocol:"UDP",
 Port:30001, TargetPort:intstr.IntOrString{Type:0, IntVal:30001, StrVal:""}, 
NodePort:0}, core.ServicePort{Name:"proxied-udp-30002", Protocol:"UDP", 
Port:30002, TargetPort:intstr.IntOrString{Type:0, IntVal:30002, StrVal:""}, 
NodePort:0}, core.ServicePort{Name:"http", Protocol:"TCP", Port:80, 
TargetPort:intstr.IntOrString{Type:1, IntVal:0, StrVal:"http"}, NodePort:32724},
 core.ServicePort{Name:"https", Protocol:"TCP", Port:443, 
TargetPort:intstr.IntOrString{Type:1, IntVal:0, StrVal:"https"}, 
NodePort:30127}}: cannot create an external load balancer with mix protocols

No matter how I try to patch/overwrite, it will not budge. I did get some advice to set these

--set controller.service.enableHttp=false --set controller.service.enableHttps=false

During helm install but then I got the error that ports have to exist. So then I was told to add a udp port like so

--set udp={30000: "default/service:30000"}

During install so I tried that and I get this error now

Error: unknown shorthand flag: 'e' in -encodedCommand

The Full command

helm install nginx-ingress stable/nginx-ingress --namespace ingress-nginx \
--set controller.replicaCount=2 \
--set controller.nodeSelector."beta\.kubernetes\.io/os"=linux \
--set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux \
--set controller.service.enableHttp=false \
--set controller.service.enableHttps=false \
--set udp={30000: "default/service:30000"}
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx \
--set controller.replicaCount=2 \
--set controller.nodeSelector."beta\.kubernetes\.io/os"=linux \
--set controller.service.enableHttp=false \
--set controller.service.enableHttps=false \
--set udp.30000="default/service:30000"

@marcusjwhelan the question remains, why are you using ingress-nginx for this?

The service service should just use a service type=LoadBalancer

@aledbf I plan to have 1000 or so applications, each on its own port, no dns, each with a shared IP and its own port on that IP. I was not able to do this any other way in azure, everyone routed me to using an ingress of some kind. Nginx is the only service like this I am familiar with.

IP's cost money. This is for game a game server cluster, a load balancer wouldn't give me the option to just visit the exact IP/port that hosts my specific world with its own dedicated disk and memory.

If that doesn't answer your question I don't know how to answer you, Its not like haven't tried every possible solution besides and ingress service before this without costing me more money.

@marcusjwhelan thank you for the answer. With that context, I understand the problem you are trying to solve.

Check the helm command I posted two comments ago. That creates the UDP port without 80 and 443

@marcusjwhelan can we close this issue?

Was this page helpful?
0 / 5 - 0 ratings