0

I can't wrap my head around this issue that I encountered. I have a k3 cluster (v1.24.4+k3s1), with multiple services running behind an nginx ingress (helm: ingress-nginx/ingress-nginx). It creates a controller service of type LoadBalancer:

Name:                     nginx-ingress-nginx-controller
Namespace:                kube-system
Labels:                   app.kubernetes.io/component=controller
                          app.kubernetes.io/instance=nginx
                          app.kubernetes.io/managed-by=Helm
                          app.kubernetes.io/name=ingress-nginx
                          app.kubernetes.io/part-of=ingress-nginx
                          app.kubernetes.io/version=1.3.1
                          helm.sh/chart=ingress-nginx-4.2.5
Annotations:              meta.helm.sh/release-name: nginx
                          meta.helm.sh/release-namespace: kube-system
Selector:                 app.kubernetes.io/component=controller,app.kubernetes.io/instance=nginx,app.kubernetes.io/name=ingress-nginx
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.43.58.186
IPs:                      10.43.58.186
LoadBalancer Ingress:     [external IP]
Port:                     http  80/TCP
TargetPort:               http/TCP
NodePort:                 http  31895/TCP
Endpoints:                10.42.0.73:80
Port:                     https  443/TCP
TargetPort:               https/TCP
NodePort:                 https  24843/TCP
Endpoints:                10.42.0.73:443
Session Affinity:         None
External Traffic Policy:  Cluster

in which you can see that it uses two NodePorts 31895/TCP, 24843/TCP. Which makes it available from the outside of the cluster on these ports (apart from 80 and 443).

  1. Why it uses NodePorts ?
  2. How to disable them or disable access to them from the outside of the cluster? (They are randomly assigned each time service is created)

I have tried setting allocateLoadBalancerNodePorts to false, but no luck.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.