I am deploying the nginx based ingress controller on Kubernetes cluster managed by RKE. ( I have also tried the same directly without RKE ).
In both the cases , it tries to use/bind to Ports 80 , and 443 on the host, and it fails because in the pod security policy for all service accounts I am not allowing host ports.
In fact I don't need to access the ingress directly on the hosts, but I want to access the ingress controller as a Service on the NodePort from external LoadBalancer.
Is there way to deploy Nginx ingress controller not to use any hostPort.
Done by disabling hostNetwork , and remove unnecessary privileges and capabilities:
and then creating a nodeport service pointing to the ingress controller ports: