Ingress & Routes
- Openshift support both Ingress & Routes
- Ingress (Ingress Controllers) are built in Kubernetes resources while Routes are Openshift specific
- Routers comes with built in TLS certificates routing, session affinity etc that basic ingress does not have
OpenShift Routes
- When traffic comes in to FQDN -> to external loadbalancer (e.g HAProxy) -> node -> router pod, OCP will check with etcd service if there is a service that user is requesting is currently running in the cluster
- There is no need to have a external loadbalancer IP address available as the external HAProxy will be able to redirect the request directly to the service in the cluster
- OCP Routes uses HAProxy internally to route traffic
- Comes with cli to expose routes from services or Applications Deployment:
oc expose svc/frontend --hostname frontend.apps.okd.punydev.me
Kubernetes Ingress
- Kubernetes Ingress utilises IngressControllers such as Traefik or Nginx IngressControllers to redirect traffic
- Require loadbalancer IP address in order for Ingress to work
Sticky Sessions
- Sticky sessions ensure all requests for a certain client always reaches the same pods.
- OCP does this by using cookies to configure session persistence
- This can be configured by annotating the following in an ingress or route object:
oc annotate ingress/ingress-example ingress.kubernetes.io/affinity=cookie
oc annotate route/route-example router.openshift.io/cookie_name=myapp