
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: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 theingress-space namespace and uses the pre-created service account. Note the proper indentation, namespace specification, and container arguments:
--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: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 theapp-space namespace. The Ingress rules will direct:
- Requests to
/wearto thewear-serviceon port 8080. - Requests to
/watchto thevideo-serviceon port 8080.
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:
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:That concludes the lab on Kubernetes Ingress Networking. For further reading on Ingress configurations and best practices, consider exploring the following resources:
- Kubernetes Ingress Documentation
- NGINX Ingress Controller GitHub Repository
- Kubernetes Networking Concepts