🕸️

Understanding Kubernetes Ingress Configuration

Apr 13, 2025

Lecture on Kubernetes Ingress

Introduction

  • Discussing Ingress in Kubernetes and its use cases.
  • Importance for UI applications to be accessible through browsers.
  • External service is suitable for testing but not for production.

Basics of Ingress

  • Ingress Concept: Allows accessing an application via a domain name and secure connection (HTTPS).
  • Ingress vs External Service: External services expose applications via IP address and port, while ingress uses a domain name.

External Service Configuration

  • Service Type: Load balancer assigns an external IP address.
  • YAML Syntax: Service of type load balancer and port details crucial for access.

Ingress Configuration

  • Kind: Ingress, instead of service.
  • Routing Rules: Map requests to internal service.
  • Host: The domain users enter in browsers.
  • Path: URL path after the domain, defining routing rules.
  • HTTP Protocol: Configured at the specification level.

Internal Service Configuration

  • Back-end Definition: Targets where requests are redirected.
  • Internal Service Type: Cluster IP, not load balancer.

Configuring Ingress Controller

  • Ingress Controller Role: Evaluates and manages ingress rules.
  • Installation: Multiple third-party implementations available.
  • Common Implementations: Kubernetes NGINX Ingress Controller.

Cloud and Bare Metal Environments

  • Cloud Environment: Uses cloud provider's load balancer.
  • Bare Metal Environment: Requires manual configuration of entry points.

Demonstration Using Minikube

  • Ingress Controller Installation: Using minikube addons enable ingress.
  • Ingress Rule Creation: Example for Kubernetes dashboard.
  • Accessing via Domain Name: Hostname to IP mapping required.

Default Backend

  • Function: Handles requests not mapped to any specific backend.
  • Use Case: Custom error messages for unmapped requests.

Advanced Ingress Configurations

Multiple Paths

  • Use Case: Single domain, multiple services (e.g., Google services).
  • Configuration: Define multiple paths under a single host.

Subdomains

  • Use Case: Different applications per subdomain.
  • Configuration: Multiple hosts, each corresponding to a subdomain.

Configuring TLS

  • Purpose: Enable HTTPS.
  • TLS Attribute: Specifies host and secret name for TLS.
  • Secret Configuration: Must match the ingress namespace.
  • Key Notes:
    • Data keys must be named tls.crt and tls.key.
    • Contents must be base64 encoded.

Conclusion

  • Reminder to like and subscribe for more content.
  • Encouragement to ask questions in the comments.