Sobes.tech
Middle

What is the difference between a route and an ingress?

sobes.tech AI

Answer from AI

Route — a term used in OpenShift. It defines the method of accessing a service from outside the OpenShift cluster, providing a public hostname. The OpenShift Router handles routes and directs traffic to the appropriate services.

Ingress — a standard API object in Kubernetes. It manages external access to services within a Kubernetes cluster, usually via HTTP/HTTPS. The ingress controller implements the rules defined in the Ingress object.

Main differences:

Feature Route (OpenShift) Ingress (Kubernetes)
Standard Specific to OpenShift Standard Kubernetes API
Flexibility Built-in features (TLS, A/B testing) Depends on the ingress controller
Implementation OpenShift Router Various ingress controllers (Nginx, HAProxy, Traefik, etc.)
Support Only OpenShift Any Kubernetes distribution

Example of Ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 80

Example of Route:

apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: my-route
spec:
  host: myapp.openshift.example.com
  to:
    kind: Service
    name: my-service
    weight: 100
  port:
    targetPort: 8080
  tls:
    termination: edge