Späť na blog
2026-06-24Networking

Routes vs. Ingress na OpenShift

Kedy použiť Route a kedy Ingress objekt.

Route je OpenShift-native objekt, ktorý priamo mapuje HAProxy router bežiaci v namespace `openshift-ingress`. Ingress je štandardný Kubernetes objekt – OpenShift ho automaticky konvertuje na Route cez ingress-to-route controller. Výsledok je rovnaký, ale detaily robia rozdiel.

Route má bohatšie TLS možnosti. Podporuje `edge` (TLS terminuje router), `passthrough` (TLS ide priamo do podu) a `reencrypt` (router dešifruje, znova šifruje k podu). Ingress bez custom anotácií vie iba edge. Ak potrebuješ mTLS medzi routerom a aplikáciou, Route je jediná cesta bez hackov.

Ingress má výhodu portability. Ten istý manifest bezo zmeny funguje na EKS, GKE aj OpenShift. Ak píšeš Helm chart pre viacero prostredí, ostaň pri Ingress a špecifiká rieš cez anotácie (`route.openshift.io/termination`, `haproxy.router.openshift.io/timeout`).

Wildcard routes a subdomain routing sú OpenShift ficura. Nastav `spec.host: ""` a `wildcardPolicy: Subdomain` – router bude routovať `*.example.com` na tvoj Service. Cez Ingress toto ide iba s custom IngressController konfiguráciou.

Prevádzková rada: ak beží veľa Routes (>500), rozdel ich medzi viac IngressController inštancií cez route selectors (label na namespace). Jeden HAProxy pod zvládne cca 1000 aktívnych routes bez degradácie latencie. Metriky sledui v `openshift-ingress` namespace – `haproxy_backend_response_errors_total` je tvoj kanárik.