Kubernetes Cluster: Guide to Implementing Ingresses

Kubernetes Cluster: Implementing Ingresses

In Kubernetes, an Ingress serves as a load balancer that facilitates external access to services, offers SSL termination, and supports name-based virtual hosting. It operates based on a set of rules (spec) that are applied to all incoming requests.

Tip: In comparison to services exposed via NodePort, Ingress presents a more robust yet complex solution. It’s particularly beneficial when you need to expose multiple services under a single IP address. Moreover, Ingress is managed by a controller, which offers a plethora of built-in features such as SSL, authentication, and routing.

By default, Traefik is the ingress controller for managing Ingresses in the Kubernetes Cluster, with options like HAProxy and NGINX available in the upcoming 1.15.5 package version. The controller monitors objects, interprets specs/annotations, and converts them into redirection rules.

Note: Once the ingress controller is selected during installation, it cannot be changed using Kubernetes management add-ons or other automation tools. However, manual configuration adjustments are still feasible, and our support team is available to assist if needed.

An Ingress spec comprises a path rule, a backend service, and a port. Here’s an example of what your Ingress may look like:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  labels:
    app: myapp
  name: myapp
  annotations:
    kubernetes.io/ingress.class: traefik
    ingress.kubernetes.io/secure-backends: "true"
    traefik.frontend.rule.type: PathPrefixStrip
spec:
  rules:
  - http:
      paths:
      - path: /myapp
        backend:
          serviceName: myapp
          servicePort: 8080

This example exposes the “myapp” service, which is connected to port 8080, on a path within your Kubernetes environment’s default domain, using the “/myapp” suffix. This means that the service can be accessed via a URL like https://${envName}.${platformDomain.com}/myapp. For further details on configuring ingress rules, including path- and subdomain-based routing, please consult the official documentation.

Save $100 in the next
5:00 minutes?

Register Here