For Kubernetes v1.21 and up, the NGINX Ingress controller no longer runs in hostNetwork by default. It instead uses hostPorts for port 80 and port 443, so you can configure the admission webhook to be accessible only through the ClusterIP. This ensures that the webhook is only accessible from within the cluster.
Because of this change to the controller, the default behavior no longer sets
true. However, you must set
true for TCP- and UDP-based Services to work.
Specify a hostname to use
If you use this option, Ingress routes requests for a hostname to the service or workload that you specify.
- Enter the Request Host that your Ingress controller will handle request forwarding for. For example,
- Add a Target Service.
- Optional: If you want to specify a workload or service when a request is sent to a particular hostname path, add a Path for the target. For example, if you want requests for
www.mysite.com/contact-usto be sent to a different service than
/contact-usin the Path. The first rule that you create does not typically include a path.
- Enter the Port number that each target operates on.
You must have an SSL certificate that Ingress can use to encrypt and decrypt communications. For more information, see Adding SSL Certificates.
- To create an Ingress controller, click the Certificates tab.
- Click Add Certificate.
- Select a Certificate - Secret Name from the drop-down list.
- Enter the host using encrypted communication.
- To add additional hosts that use the certificate, click Add Hosts.
Labels and Annotations
Add Labels and/or Annotations to provide metadata for your Ingress controller.
For a list of annotations available for use, see the Nginx Ingress Controller Documentation.