Skip to main content
In this guide, we dive deeper into Ingress networking by deploying an Ingress controller and configuring traffic routing for your applications. We currently have two applications running in the “app-space” namespace: a video application and a wear application. Follow the steps below for a comprehensive setup and troubleshooting.

1. Verify the Existing Deployment

Before proceeding, ensure all your pods are running across all namespaces. Execute the command:

2. Setup: Ingress Namespace and Required Resources

a. Create the Ingress Namespace

Create a dedicated namespace for the Ingress controller:

b. Create a ConfigMap

The NGINX Ingress Controller requires a specific ConfigMap. Create it using the command below (replace the literal configuration with your actual settings if needed):

c. Create a Service Account

Deploy a service account named ingress-serviceaccount in the ingress-space namespace:

d. Set Up Roles and RoleBindings

Assign the required roles to ensure proper permissions for the Ingress controller. Verify the roles:
Inspect the role bindings:
For detailed role information, use:

3. Deploy the NGINX Ingress Controller

Deploy the Ingress controller by creating a deployment in the ingress-space namespace. Use the YAML configuration below (ensure proper spacing and namespace specifications):
Apply the deployment configuration:
Monitor the Ingress controller pods:

4. Expose the Ingress Controller via a Service

To make the Ingress controller accessible externally, expose it using a NodePort.
  1. Expose the deployment:
  2. Verify the service details:
If you prefer a different NodePort (e.g., 30080 instead of the default allocation), edit the service:
Change the nodePort field under the port configuration to 30080 and save.

5. Create the Ingress Resource to Route Traffic

Now configure routing rules to forward traffic from specified paths to your applications located in the app-space namespace. In this example:
  • Requests to /wear route to the wear-service on port 8080.
  • Requests to /watch route to the video-service on port 8080.
Create the Ingress resource with the following command:
Verify the Ingress resource:

6. Troubleshooting: Resolving Excessive Redirects

If you experience continuous HTTP 308 redirects when accessing the /watch path, inspect the Ingress controller logs:
You might find lines similar to:
These redirects are usually due to SSL redirection being enabled by default. ::: note “Note” To disable SSL redirection, update your Ingress resource with the following annotation: ::: Update your Ingress manifest to include the annotation:
Apply the changes by editing the Ingress resource:
After saving, retest your endpoints to confirm that the redirect issue is resolved.

7. Validate the Complete Setup

Ensure that the Ingress routes traffic correctly to your services:
  1. Validate that the backend pods are running in the app-space namespace:
  2. Check the logs of the video and wear applications to ensure new requests are reaching them:
This confirms that your applications are functioning correctly on port 8080. ::: note “Additional Information” The terminal outputs and log details provided above help verify correct operation. The supplementary image below offers an additional illustration but is not required for successfully following these instructions. :::
The image shows a terminal with logs and a task panel instructing to create an ingress resource for paths "/wear" and "/watch" in the "app-space" namespace.

Congratulations! You have successfully deployed an Ingress controller, exposed it via a NodePort service, configured the Ingress resource to route traffic to two distinct services, and resolved an SSL redirection issue. Happy networking!

Watch Video