Ingress¶
An API object that manages external access to the services in a cluster, typically HTTP.
Ingress can provide load balancing, SSL termination and name-based virtual hosting.
Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. An Ingress does nothing on its own: an ingress controller running in the cluster reads the Ingress objects and configures a proxy or load balancer.
Ingress on OpenShift
OpenShift's built-in router (the default IngressController) serves both Routes and standard Ingress objects. When you create an Ingress, OpenShift generates a matching Route automatically, so Ingress manifests from other Kubernetes distributions work unchanged. See Routes for the OpenShift-native API.
Ingress and Gateway API
The Ingress API is stable but frozen: it gets no new features. Its successor is Gateway API, which is more expressive (traffic splitting, header matching, multiple protocols) and separates the roles of cluster operators and app developers. The popular community Ingress NGINX controller was retired in 2026. For new work on upstream Kubernetes, prefer Gateway API. OpenShift supports Gateway API from version 4.19.
Resources¶
References¶
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
# ingressClassName: openshift-default # optional; the cluster default is used if omitted
rules:
- host: hello-world.apps.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 8080
tls: # optional: terminate TLS for this host
- hosts:
- hello-world.apps.example.com
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: example-route
spec:
parentRefs:
- name: example-gateway # a Gateway created by the platform team
namespace: gateway-system
hostnames:
- hello-world.apps.example.com
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: web
port: 8080
oc create deployment web --image=quay.io/nginx/nginx-unprivileged:1.29 --port=8080
oc expose deployment web --port=8080
Activities¶
| Lab | Description |
|---|---|
| Lab 11 - Routes & Ingress | Publish an app with an OpenShift Route and a Kubernetes Ingress |