- From the Global view, open the project that you want to add ingress to.
- Click Resources in the main navigation bar. Click the Load Balancing tab. Then click Add Ingress.
- Enter a Name for the ingress.
- Select an existing Namespace from the drop-down list. Alternatively, you can create a new namespace on the fly by clicking Add to a new namespace.
- Optional: click Add Rule to create additional ingress rules. For example, after you create ingress rules to direct requests for your hostname, you’ll likely want to create a default backend to handle 404s.
Result: Your ingress is added to the project. The ingress begins enforcing your ingress rules.
Ingress Rule Configuration
If you choose this option, ingress routes requests to hostname to a DNS name that’s automatically generated. Rancher uses to automatically generates the DNS name. This option is best used for testing, not production environments.
- Add a Target Backend. By default, a workload is added to the ingress, but you can add more targets by clicking either Service or Workload.
- Optional: If you want 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-us
to be sent to a different service thanwww.mysite.com
, enter in the Path field. Typically, the first rule that you create does not include a path. - Select a workload or service from the Target drop-down list for each target you’ve added.
If you use this option, ingress routes requests for a hostname to the service or workload that you specify.
- Enter the hostname that your ingress will handle request forwarding for. For example,
www.mysite.com
. - Add a Target Backend. By default, a workload is added to the ingress, but you can add more targets by clicking either Service or Workload.
- Optional: If you want 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-us
to be sent to a different service than , enter/contact-us
in the Path field. Typically, the first rule that you create does not include a path. - Select a workload or service from the Target drop-down list for each target you’ve added.
- Enter the Port number that each target operates on.
Use this option to set an ingress rule for handling requests that don’t match any other ingress rules. For example, use this option to route requests that can’t be found to a 404
page.
- Add a Target Backend. Click either Service or Workload to add the target.
- Select a service or workload from the Target drop-down list.
- Click Add Certificate.
- Select a Certificate from the drop-down list.
- To add additional hosts that use the certificate, click Add Hosts.
Add Labels and/or to provide metadata for your ingress.