Skip to main content
In this lesson we deploy an NGINX Ingress Controller and configure an Ingress resource to route external traffic to two backend applications: video and wear. The walkthrough covers creating the controller namespace, required ConfigMap and RBAC, deploying the controller, exposing it via a Service, creating the Ingress rules, and troubleshooting a common redirect loop. Prerequisites / initial cluster state — check running Pods:
Step 1 — create an ingress namespace Create a dedicated namespace for the ingress controller and related resources. Keeping controller resources isolated helps with management and RBAC scoping.
The NGINX Ingress Controller expects a ConfigMap named nginx-configuration in the controller namespace. Create the ConfigMap (empty in this example; add keys for custom behavior if needed):
Ensure Roles and RoleBindings exist for the controller’s ServiceAccount so it can read required resources:
Describe the Role to verify the allowed verbs and resources:
Step 2 — deploy the ingress controller Apply a corrected Deployment YAML for the NGINX ingress controller. Adjust the image tag, args, or labels to match your environment. This example includes required args to point to the ConfigMap and default backend service:
If the YAML is malformed you’ll see parsing errors when creating it:
Fix any syntax issues (common causes include incorrect indentation or stray characters), then create the Deployment. After successful creation, you should see the ingress controller Pod in the ingress-space namespace. Step 3 — expose the ingress controller with a Service Expose the controller Deployment so it can accept incoming traffic. A quick way is to use kubectl expose to create a NodePort Service which maps port 80 on the Service to a high-numbered node port:
Verify the Service and its assigned nodePort:
If you need a stable or specific node port, edit the Service and set spec.ports[0].nodePort:
(Editing an existing Service is often easier than authoring the Service YAML from scratch.) Step 4 — create the Ingress resource to route to the apps Confirm the application Services exist in the app-space namespace:
Create an Ingress that routes /wear to wear-service and /watch to video-service. The quick kubectl create command below constructs the rules for you:
Verify the Ingress is present:
Describe the Ingress to confirm backend endpoints are discovered by the controller:
Test access using the node IP and the Service NodePort from Step 3 (or use a LoadBalancer/Ingress controller IP if provisioned). If you receive the application 404 page, inspect logs and Ingress configuration:
A browser window showing a stylized purple 404 error page with the large text "OOPS!! 404" and a message saying the site is not ready yet. Bright geometric shapes and illustrations decorate the page.
Troubleshooting: check application and ingress logs Inspect app Pods and logs. These sample Flask apps show they’re running but won’t display incoming requests until the ingress forwards traffic:
Check the ingress controller logs — these show incoming requests and the upstream behavior. In this lab the controller logs revealed repeated 308 responses (redirects), indicating requests were being redirected rather than proxied:
If the browser reports too many redirects, you will see an error similar to this:
A Chrome browser window showing a dark error page that reads "This page isn't working" and reports the site redirected too many times (ERR_TOO_MANY_REDIRECTS). The message suggests clearing cookies and includes a "Reload" button.
Root cause and fix Repeated 308 responses typically mean either the backend or the ingress controller is performing an HTTP→HTTPS redirect. If your intent is to serve plain HTTP through the Ingress (or your backend already handles TLS), prevent the controller from automatically redirecting HTTP to HTTPS by adding the nginx.ingress.kubernetes.io/ssl-redirect: "false" annotation to your Ingress. Example Ingress with annotations to disable automatic SSL redirects and rewrite paths:
Apply the change by editing the Ingress:
After disabling the automatic SSL redirect, the redirect loop should stop and requests will be proxied to the intended backend services. Verify by accessing /wear and /watch via the node IP and NodePort (or via your LoadBalancer/ingress IP if available). Callouts and further considerations
If your application requires HTTPS, configure TLS for the Ingress (add a tls block and provide certificates) instead of simply disabling SSL redirects. The annotation nginx.ingress.kubernetes.io/ssl-redirect: "false" disables the controller’s automatic HTTP→HTTPS redirects but does not provide TLS termination or certificate management.
Helpful links and references

Watch Video