Skip to main content
In this lesson, we explore Kubernetes Ingress Networking by deploying an Ingress Controller and configuring it to route traffic to two applications located in different namespaces. We will deploy a “video” app and a “wear” app within the app-space namespace while managing the Ingress Controller in its own namespace.
The image shows a terminal interface with a task description about exploring two deployed applications in different namespaces.

Step 1: Create the Ingress Namespace

Begin by creating a dedicated namespace for the Ingress Controller. Open your terminal and list all pods across all namespaces to confirm your setup:
Next, within the ingress-space namespace, create a ConfigMap (which may contain Nginx configuration data) and a Service Account. The related Roles and RoleBindings for the service account ingress-serviceaccount are pre-configured. Verify the roles and role bindings with:

Step 2: Deploy the Ingress Controller

Deploy the Ingress Controller using the following manifest. This YAML configuration ensures that the controller runs within the ingress-space namespace and uses the pre-created service account. Note the proper indentation, namespace specification, and container arguments:
Deploy the Ingress Controller by running:
Monitor the pod status (optionally using --watch), and wait for the pod to transition from ContainerCreating to Running:
After a short wait, the status should update to Running. This confirms that the Ingress Controller has been successfully deployed.

Step 3: Expose the Ingress Controller

To allow external access to your Ingress Controller, expose it using a Service of type NodePort. Execute the following command to expose the deployment:
Verify the details of the newly created service:
If you prefer a specific NodePort (for example, port 30080), edit the service accordingly:
Change the nodePort value to 30080 and save the changes.

Step 4: Create the Ingress Resource

Now, create an Ingress resource to route traffic to the applications deployed in the app-space namespace. The Ingress rules will direct:
  • Requests to /wear to the wear-service on port 8080.
  • Requests to /watch to the video-service on port 8080.
Run the following command to create the Ingress:
Verify the Ingress resource with:

Step 5: Debugging and Resolving Redirect Issues

If you observe that requests to the /watch path are not reaching the intended video service, and the logs remain inactive, review the Ingress Controller logs. You might see repeated HTTP 308 redirects indicating SSL redirection is enforced:
To resolve this, disable SSL redirection for this Ingress resource by adding the appropriate annotations. Edit the Ingress manifest to include:
Apply the changes by editing the existing Ingress:
After saving these changes, the SSL redirect issue should be resolved, ensuring proper routing of traffic to both applications.

Final Verification

Perform a final check of the service and Ingress statuses to confirm that everything is functioning as expected:
This confirms that the Ingress Controller is properly deployed, exposed, and routing traffic correctly with SSL redirection disabled.
That concludes the lab on Kubernetes Ingress Networking. For further reading on Ingress configurations and best practices, consider exploring the following resources:

Watch Video